2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4           allowed inside a switch (without loop). Fixed bug #75433.
5
6 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
7
8         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
9         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10
11 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
12
13         * driver.cs : kinda reverting the default encoding changes (not exact 
14           revert since I noticed that "codepage:reset" might not work fine).
15
16 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
17
18         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
19           Location. Now getter and setter store location correctly.
20           (errors/cs0111-12.cs now reports the expected location.)
21
22 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
23
24         * driver.cs : Use default encoding on the environment.
25           Removed (now that) extra parameter for SeekableStreamReader.
26         * support.cs : (SeekableStreamReader) third .ctor() argument for
27           StreamReader is not required (always true). preamble size could
28           be acquired in simpler and safe way.
29
30 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
31
32         * cs-parser.jay: report CS0642 at warning level 3
33           and report CS0642 for an if else statement also
34           fixes bug #74745. Patch by John Luke (and a bit
35           modified by me).
36           Removed extra CS0642 warning check for "while",
37           "for" and "fixed".
38         * statement.cs: In Block.Resolve(), CS0642 check
39           is reimplemented to check a sequence of an empty
40           statement and a block.
41
42           Both fix bug #66777.
43
44 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
45
46         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
47         detection until I fix it.
48         
49         * cs-tokenizer.cs: Changed error message.
50         
51         * cs-parser.jay: Fixed 2 error locations.
52         
53         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
54         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
55         properties.
56         
57         * enum.cs (GetSignatureForError): Fixed.
58         
59         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
60         method detection.
61         
62         * class.cs,
63         * typemanager.cs (RegisterProperty): Removed.
64         
65         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
66
67 2005-08-24  Raja R Harinath  <rharinath@novell.com>
68
69         Fix #75874.
70         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
71         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
72
73 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
74
75         * expression.cs : tiny fix is required for not warning positive ulong.
76           See test-441.cs.
77
78 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
79
80         * expression.cs : add CS0652 check for constant and integral
81           expression. Fixed bug #53974.
82
83 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
84
85         * expression.cs : in DoNumericPromotions(), check if there is implicit
86           conversion overload for string (to check CS0034). Fixed bug #52492.
87
88 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
89
90         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
91
92 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
93
94         * ecore.cs : report location when it is *not* Null.
95
96 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
97
98         * codegen.cs,
99           ecore.cs,
100           flowanalysis.cs,
101           expression.cs:
102           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
103           correctly. Fixed bug #75721.
104
105 2005-08-23  Raja R Harinath  <rharinath@novell.com>
106
107         * support.cs (SeekableStreamReader.Position): Avoid an expensive
108         loop that performs 'min (pos, char_count)'.
109
110         Fix #75862.
111         * expression.cs (Unary.ResolveOperator): Don't discard implicit
112         converted value in Operator.OnesComplement.
113
114 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
115
116         * anonymous.cs: If the anon method is pulled into a helper class,
117         it needs to be `internal' not `private'. Fixes runtime behavior on
118         msft. bug #75704
119
120 2005-08-20  Martin Baulig  <martin@ximian.com>
121
122         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
123         scope if we don't already have it.
124
125         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
126         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
127         fixes #75867.
128
129 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
130
131         Fix #75803
132         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
133         is a partial class.
134
135 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
136
137         The big constants rewrite
138         Fix #75746, #75685 and more
139         As a side effect saved 1MB for MWF ;-)
140         
141         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
142         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
143         enum based for corlib compilation.
144         
145         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
146         subtractions.
147         
148         * class.cs (FixedField.Define): Use ResolveAsConstant.
149         
150         * const.cs (IConstant): Interface constants and enums.
151         (Const.ResolveValue): New method for constant resolvning.
152         (ExternalConstant): Constants from imported assemblies.
153         
154         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
155         conversion; like enums.
156         (Constant.ToType): Converts this constant to different type.
157         (Constant.Increment): Adds 1.
158         
159         * convert.cs (ImplicitConversionRequired): Simplified.
160         
161         * cs-parser.jay: Create EnumMember directly.
162         
163         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
164         
165         * doc.cs (GenerateEnumDocComment): Removed.
166         
167         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
168         (ConvertIntLiteral): Removed.
169         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
170         
171         * enum.cs (EnumMember): Implement IConstant.
172         (Enum.IsValidEnumConstant): Removed.
173         (Enum.GetNextDefaultValue): Removed.
174         (Enum.FindMembers): Updated.
175         (Enum.GenerateDocComment): Iterate enum members.
176         
177         * expression.cs (Cast.TryReduce): Handle enums correctly.
178         (New.Constantify): Made public.
179         (MemberAccess.DoResolve): Removed contant specific if(s).
180         
181         * literal.cs (NullLiteral): Implement new abstract methods.
182         
183         * statement.cs (GotoCase.Resolve): Use new constant methods.
184         (SwitchLabel.ResolveAndReduce): Use new constant methods.
185         
186         * typemanager.cs (LookupEnum): Removed.
187         (IsEnumType): Fixed to work with corlib.
188         (RegisterConstant): Removed.
189         (LookupConstant): Removed.
190         (GetConstant): Changed to work with IConstant.
191
192 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
193
194         * location.cs : Fixed overflown (>255) column number.
195
196 2005-08-03  Raja R Harinath  <rharinath@novell.com>
197
198         First cut of the qualified-alias-member feature.
199         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
200         token.
201         * cs-parser.jay (DOUBLE_COLON): New token.
202         (namespace_or_type_name): Add rule for recognizing
203         qualified-alias-members.
204         (primary_expression): Likewise.
205         (element_access): Allow QualifiedAliasMember as a possible
206         type-bearing expression.
207         (local_variable_type, local_variable_pointer_type): Likewise.
208         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
209         aliases in the current and enclosing namespace declarations.
210         (NamespaceEntry.UsingAlias): Add CS0440 warning.
211         * decl.cs (MemberName.is_double_colon): New.
212         (MemberName.MemberName): Add new constructor for alias-member.
213         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
214         * expression.cs (QualifiedAliasMember): New expression type.
215
216 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
217
218         * location.cs : it borked when no argument was specified.
219
220 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
221
222         * location.cs : tiny ToString() format fix.
223
224 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
225
226         * statement.cs : oops, it was missing.
227
228 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
229
230         A set of fixes for precise line/column location.
231
232         * location.cs :
233           "token" field now holds a file/line "delta", a line number offset 
234           from the segment, and a column number. See also:
235           http://lists.ximian.com/pipermail/mono-devel-list/2004-
236           December/009508.html
237           Removed static IsNull. Use instance IsNull property instead.
238         * cs-tokenizer.cs :
239           For some tokens it stores Location. For Identifier it stores
240           LocatedToken which is a pair of string name and location.
241           Column numbers are adjusted only at getChar().
242         * report.cs :
243           Use Location.ToString() for reporting (it now contains column).
244         * cs-parser.jay :
245           Largely modified to use LocatedToken instead of
246           string (IDENTIFIER), and to acquire Location from some tokens.
247         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
248           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
249           codegen.cs :
250           Now MemberName holds Location. DeclSpace.ctor() receives Location
251           as a parameter. Removed extra parameters to all derived classes.
252           Replaced Location.IsNull() with instance property.
253         * assign.cs, expression.cs :
254           Added .ctor() overload that omits Location.
255         * attribute.cs :
256           Added "nameEscaped" flag that indicates the identifier was escaped
257           in the source file. This fixes bug #57047.
258
259 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
260
261         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
262         New method, looking for lo-case imported cls type.
263
264         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
265         here.
266
267         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
268
269         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
270
271         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
272         all_imported_types.
273         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
274
275         Optimized to save 3.5 MB for SWF compilation.
276
277 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
278
279         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
280         (PartialContainer.Create): Moved logic AddToContainer.
281         (PartialContainer.MarkForDuplicationCheck): Shares name.
282         
283         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
284         place.
285         
286         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
287         initialization.
288         (Namespace.GetSignatureForError): New method.
289         
290         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
291         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
292
293 2005-08-01  Raja R Harinath  <rharinath@novell.com>
294
295         Fix #75669.
296         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
297         member lookup rather than qualifier_type, since qualifier_type can
298         be null.
299
300 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
301
302         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
303         enum member.
304
305 2005-07-31  Miguel de Icaza  <miguel@novell.com>
306
307         * statement.cs: Copy the local exception into the exception
308         captured local.  Fixes 75674
309
310 2005-07-31  Raja R Harinath  <harinath@gmail.com>
311
312         Fix #75658.
313         * expression.cs (Invocation.OverloadResolve): Don't report error
314         CS1501 if error CS1502 has been reported.
315         (New.DoResolve): Delegate CS1501 reporting to
316         Invocation.OverloadResolve.
317
318         Fix #75656.
319         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
320         invariant-meaning-in-block property in an enclosing block if
321         necessary.
322
323 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
324
325         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
326         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
327         (Switch.CheckSwitch): Just save 50kb for SWF.
328
329 2005-07-27  Martin Baulig  <martin@ximian.com>
330
331         * anonymous.cs (CaptureContext.AddField): Added
332         `AnonymousContainer am' argument; compute its toplevel scope if
333         it's not already computed.  Fixes #75649.
334
335 2005-07-26  Raja R Harinath  <rharinath@novell.com>
336
337         Fix #75628.
338         * class.cs (Constructor.Emit): Reset block to null if the block
339         resolve fails.
340
341 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
342
343         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
344
345 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
346
347         * class.cs (MethodData.Define): Check whether accessor implementing
348         interface is public.
349
350         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
351
352 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
353
354         Fix #57245
355         * namespace.cs (LookupType): Moved same type check to...
356         
357         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
358         with the same name.
359
360 2005-07-21  Raja R Harinath  <rharinath@novell.com>
361
362         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
363         already found a typebuilder.
364         * class.cs (MethodCore.IsDuplicateImplementation): Compare
365         MemberNames, not strings.
366
367         * const.cs (Error_ExpressionMustBeConst): 
368         Rename from Error_EpressionMustBeConst.
369         * const.cs, class.cs, statement.cd: Update.
370
371 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
372
373         Fix #65573
374
375         * const.cs (Const.LookupConstantValue): Report missing contant expression
376         everytime.
377         (Error_EpressionMustBeConstant): Only one error method.
378
379         * class.cs, statement.c: Updated.
380
381 2005-07-20  Raja R Harinath  <rharinath@novell.com>
382
383         * statement.cs (Block.Flags): Add back HasVarargs.
384         (Block.flags): Make protected.
385         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
386
387         * typemanager.cs (types, typecontainers, user_types): Remove.
388         (UserTypes, TypeContainers): Likewise.
389         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
390         (CleanUp, Reset): Update.
391         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
392         (GetNestedType): Use Type.GetNestedType.
393         (CoreLookupType): Take two arguments, the namespace and the
394         basename of the type.  Update to use the Namespace.Lookup
395         mechanism.
396         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
397         (RealMemberLookup): Use IsNestedChildOf instead of playing with
398         string concatenation and substring matches.
399         * class.cs, enum.cs, delegate.cs: Update to changes.
400
401 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
402
403         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
404         Expression and made virtual.
405
406         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
407         (ImplicitStandardConversionExists): Fixed `byte' typo ?
408
409         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
410
411         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
412         error message.
413
414         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
415         change.
416
417 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
418
419         Fix #57707
420         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
421         AssemblyCultureAttribute is not used on executable.
422
423         * rootcontext.cs,
424         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
425
426 2005-07-16  Raja R Harinath  <rharinath@novell.com>
427
428         Fix #60638.
429         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
430         New.  Reports CS0252/CS0253.
431         Mostly taken from preliminary patch by Duncak Mak.
432         (Binary.DoResolveOperator): Store results of operator lookup.
433         Use them to detect if we need to warn about unintended reference
434         comparisons.
435
436 2005-07-15  Raja R Harinath  <rharinath@novell.com>
437
438         Fix #72969.
439         * namespace.cs (Namespace.Lookup): Add back location parameter.
440         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
441         * delegate.cs, ecore.cs, expression.cs: Update to changes.
442
443         * codegen.cs (EmitContext.DeclSpace): Make readonly.
444         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
445         (Namespace.LookupType): ... this.
446         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
447         of namespaces.
448         * typemanager.cs (LookupTypeReflection): Remove buggy code that
449         purported to handle pointers.
450         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
451         CoreLookupType.
452
453 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
454
455         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
456         type as namespace.
457
458 2005-07-15  Raja R Harinath  <rharinath@novell.com>
459
460         * namespace.cs (Namespace.Lookup): Drop location parameter.
461         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
462         (NamespaceEntry.Lookup): ... this.
463         (NamespaceEntry.Error_AmbiguousTypeReference):
464         Move here from DeclSpace.
465         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
466         names ...
467         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
468         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
469         Move to NamespaceEntry.
470         * delegate.cs, expression.cs: Update to changes.
471
472 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
473
474         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
475         CheckAttributeType and refactored.
476         (Attribute.ResolvePossibleAttributeType): Changed to reuse
477         ResolveAsTypeTerminal error handling.
478         (ResolveAsTypeTerminal): Introduced because of global attributes extra
479         handling.
480         (GetSignatureForError): Print errors in same way.
481
482         * class.cs,
483         * codegen.cs: Reflect attribute GetSignatureForError change.
484
485         * ecore.cs,
486         * expression.cs: Add silent parameter to ResolveAsTypeStep.
487
488         * namespace.cs (UsingEntry): Refactored to make fields private.
489
490         * assign.cs,
491         statement.cs: Error_UnexpectedKind has extra parameter.
492
493 2005-07-14  Raja R Harinath  <rharinath@novell.com>
494
495         * ecore.cs (IAlias): Remove.
496         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
497         that implement the interface.
498         * namespace.cs (Namespace): Likewise.
499         (Namespace.declspaces): Renamed from 'defined_names'.
500         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
501         DeclSpace instead of an IAlias.
502         * tree.cs (Tree.AddDecl): Update.
503
504 2005-07-12  Raja R Harinath  <rharinath@novell.com>
505
506         * statement.cs (Block.Flags); Remove HasVarargs.
507         (Block.HasVarargs): Move to ToplevelBlock.
508         (Block.ThisVariable, Block.AddThisVariable): Likewise.
509         (Block.Variables): Make protected.  Initialize variable hashtable
510         if necessary.
511         (Block.AddVariable): Update.
512         (Block.Resolve): Update to changes.
513         (ToplevelBlock.HasVarargs): New boolean.
514         (ToplevelBlock.ThisVariable): Move here from Block.
515         (ToplevelBlock.AddThisVariable): Likewise.
516         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
517         * expression.cs (This.ResolveBase): Update to changes.
518         (ArglistAccess.DoResolve): Likewise.
519
520 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
521
522         Fix #75321
523         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
524
525         * class.cs (TypeContainer.VerifyMembers): Distinguish between
526         not used and not used & assigned.
527         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
528
529 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
530
531         Fix #75053
532         * expression.cs (Is.DoResolve): null is never provided type.
533
534 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
535
536         Fix #52496
537         * cs-parser.jay: Less strict event error rule to catch more errors.
538
539 2005-07-08  Martin Baulig  <martin@ximian.com>
540
541         Fix test-iter-10.cs - distinguish whether we `yield' in a property
542         gettter (allowed) or setter (not allowed).
543
544         * class.cs (Accessor): Implement IIteratorContainer.
545         (Accessor.Yields): New public field.
546         (PropertyBase.PropertyMethod.Define): Handle iterators on a
547         per-accessor basis.
548
549         * cs-parser.jay
550         (get_accessor_declaration, set_accessor_declaration): Set the
551         `yields' flag on the accessor, not the property.
552         (property_declaration): Do the iterators check on a per-accessor
553         basis and not for the whole property.
554
555 2005-07-08  Martin Baulig  <martin@ximian.com>
556
557         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
558         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
559
560 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
561
562         Fix #74975
563         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
564         (ExtractSecurityPermissionSet): Cope with self referencing security
565         attributes properly.
566
567         * driver.cs (SetOutputFile): Made public property OutputFile.
568
569 2005-07-07  Raja R Harinath  <rharinath@novell.com>
570
571         Fix #75486.
572         * class.cs (TypeContainer.first_nonstatic_field): Rename from
573         has_nonstatic_fields.  Make into a FieldBase pointer.
574         (TypeContainer.AddField): Add CS0282 check.
575         (TypeContainer.EmitType): Update.
576
577 2005-07-06  Miguel de Icaza  <miguel@novell.com>
578
579         * cs-tokenizer.cs (consume_identifier): Do not create strings to
580         compare if they start with __.
581
582 2005-07-06  Raja R Harinath  <rharinath@novell.com>
583
584         * statement.cs (Switch.SwitchGoverningType): Only look at
585         UserCasts that don't need implicit standard conversions to one of
586         the allowed switch types (Fixes test-322.cs).
587         (LocalInfo.Resolve): Re-enable sanity-test.
588
589 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
590
591         * cs-tokenizer.cs (consume_identifier): Detect double undescores
592         
593         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
594         
595         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
596
597 2005-07-06  Raja R Harinath  <rharinath@novell.com>
598
599         Fix #75472.
600         * ecore.cs (SimpleName.GetSignatureForError): Add.
601         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
602         (MemberAccess.GetSignatureForError): Add.
603
604 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
605  
606         The big error and warning messages review.
607         
608         * anonymous.cs,
609         * assign.cs,
610         * attribute.cs,
611         * class.cs,
612         * codegen.cs,
613         * convert.cs,
614         * cs-parser.jay,
615         * cs-tokenizer.cs,
616         * decl.cs,
617         * delegate.cs,
618         * doc.cs,
619         * driver.cs,
620         * ecore.cs,
621         * enum.cs,
622         * expression.cs,
623         * flowanalysis.cs,
624         * iterators.cs,
625         * literal.cs,
626         * location.cs,
627         * modifiers.cs,
628         * namespace.cs,
629         * parameter.cs,
630         * pending.cs,
631         * report.cs,
632         * rootcontext.cs,
633         * statement.cs,
634         * support.cs,
635         * tree.cs,
636         * typemanager.cs: Updated.
637         
638         * class.cs: (MethodCore.SetYields): Moved here to share.
639         (PropertyMethod.Define): Moved iterator setup here.
640         
641         * iterators.cs: Add orig_method to have full access to parent
642         container.
643
644 2005-07-05  Raja R Harinath  <rharinath@novell.com>
645
646         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
647         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
648         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
649         variable of struct type.
650         * expression.cs (Unary.ResolveOperator): Update to change.
651         (Indirection.VerifyFixed): Likewise.
652         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
653         (ParameterReference.VerifyFixed): Value parameters are fixed.
654         (This.VerifyFixed): Treat 'this' as a value parameter.
655         * statement.cs (LocalInfo.IsFixed): Remove.
656
657 2005-07-01  Martin Baulig  <martin@ximian.com>
658
659         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
660         `ec.EmitThis ()' to get the correct scope.
661
662 2005-07-01  Martin Baulig  <martin@ximian.com>
663
664         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
665         instance is a ParameterReference; fixes #75299.
666
667 2005-07-01  Martin Baulig  <martin@ximian.com>
668
669         Reverted Marek's latest patch (r46725):
670         - it contains structural changes which are neither mentioned in
671           the ChangeLog nor explained anywhere; for example the additional
672           argument of EmitContext's and Iterator's .ctor's and the
673           TypeContainer.DefineMembers() change.
674         - structural changes like this should go in in seperate patches
675           and not be hidden in a huge patch which just seems to affect
676           warnings and errors.
677           a big and hard to understand patch.
678         - it breaks iterators and causes regressions, for instance in
679           test-iter-03.cs.      
680
681 2005-06-30  Raja R Harinath  <rharinath@novell.com>
682
683         Fix #75412.
684         * expression.cs (Indexers.map): Remove.
685         (Indexers.Append): Filter out inaccessible setters and getters.
686         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
687
688         Fix #75283.
689         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
690         Refactored from ...
691         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
692         (FieldExpr.Emit, PropertyExpr.Emit): Update.
693         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
694         * expression.cs (Invocation.EmitCall): Add CS0120 check.
695
696 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
697
698         Fix #75322
699         * class.cs (FieldBase.GetInitializerExpression): One more field
700         for backup.
701
702 2005-06-28  Miguel de Icaza  <miguel@novell.com>
703
704         * pending.cs: Do not define a proxy if the base method is virtual,
705         it will be picked up by the runtime (bug 75270).
706
707 2005-06-08  Martin Baulig  <martin@ximian.com>
708
709         The big Iterators rewrite :-)
710
711         * iterators.cs: Rewrite this to use the anonymous methods framework.
712
713         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
714         before the TypeContainers; see 2test-21.cs.
715
716         * class.cs
717         (TypeContainer.DefineType): Don't create a new EmitContext if we
718         already have one (this only happens if we're an Iterator).
719         (TypeContainer.Define): Also call Define() on all our iterators.
720         (Method.CreateEmitContext): Added support for iterators.
721
722         * anonymous.cs
723         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
724         (AnonymousContainer.CreateMethodHost): Moved here from
725         AnonymousMethod and made abstract.
726         (AnonymousContainer.CreateScopeType): New abstract method.
727         (AnonymousContainer.IsIterator): New public property.
728         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
729         get the ScopeTypeBuilder rather than manually defining it here. 
730         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
731         iterators here.
732
733         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
734         before RootContext.DefineTypes().
735
736         * codegen.cs (EmitContext.RemapToProxy): Removed.
737         (EmitContext.CurrentAnonymousMethod): Changed type from
738         AnonymousMethod -> AnonymousContainer.
739         (EmitContext.ResolveTopBlock): Protect from being called twice.
740         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
741         (EmitContext.EmitThis): Removed the iterators hacks; use the
742         anonymous methods framework for that.
743
744         * statement.cs
745         (ToplevelBlock.Container): Make this a property, not a field.
746         (ToplevelBlock.ReParent): New public method; move the
747         ToplevelBlock into a new container.
748         (Foreach.TemporaryVariable): Simplify.
749
750 2005-06-05  Martin Baulig  <martin@ximian.com>
751
752         * statement.cs (LocalInfo.CompilerGenerated): New flag.
753         (Block.AddTemporaryVariable): New public method; creates a new
754         `LocalInfo' for a temporary variable.
755         (Block.EmitMeta): Create the LocalBuilders for all the temporary
756         variables here.
757         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
758         non-iterator variables.
759
760 2005-06-05  Martin Baulig  <martin@ximian.com>
761
762         * statement.cs (Foreach.TemporaryVariable): Create the
763         LocalBuilder in the Emit phase and not in Resolve since in some
764         situations, we don't have an ILGenerator during Resolve; see
765         2test-19.cs for an example.
766
767 2005-06-04  Martin Baulig  <martin@ximian.com>
768
769         **** Merged r45395 from GCS ****
770
771         The big Foreach rewrite - Part II.
772
773         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
774         with `PropertyInfo ienumerator_getcurrent'.
775
776         * codegen.cs (VariableStorage): Removed.
777
778         * statement.cs
779         (Foreach): Derive from Statement, not ExceptionStatement.
780         (Foreach.CollectionForeach): New nested class.  Moved all the code
781         dealing with collection foreach here.
782         (Foreach.ForeachHelperMethods): Removed.
783         (Foreach.TemporaryVariable): Implement IMemoryLocation.
784
785 2005-05-23  Martin Baulig  <martin@ximian.com>
786
787         * statement.cs (Try.DoResolve): Don't create a `finally' if we
788         don't need to.  Fix #75014.
789
790 2005-05-20  Martin Baulig  <martin@ximian.com>
791
792         Merged r44808 from GMCS.
793
794         * class.cs (TypeContainer.CircularDepException): Removed.
795         (TypeContainer.DefineType): Removed the `InTransit' stuff.
796         (TypeContainer.CheckRecursiveDefinition): Check for circular class
797         (CS0146) and interface (CS0529) dependencies here.
798
799 2005-06-21  Raja R Harinath  <rharinath@novell.com>
800
801         * expression.cs (Invocation.EmitCall): Fix initialization
802         'this_call' to reflect current behaviour.  Fix indentation.
803
804         * convert.cs (FindMostEncompassedType): Add two trivial special
805         cases (number_of_types == 0 || number_of_types == 1).
806         (FindMostEncompasingType): Likewise.
807
808 2005-06-17  Raja R Harinath  <rharinath@novell.com>
809
810         Some cleanups preparing for the fix of #75283.
811         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
812         error testing.
813         (EventExpr.InstanceResolve): Likewise.
814         (EventExpr.DoResolve): Remove redundant checks.
815
816 2005-06-10  Duncan Mak  <duncan@novell.com>
817
818         * cs-tokenizer.cs (process_directives): New flag for controlling
819         the processing of preprocessor directives.
820         (x_token): After seeing a '#', return Token.NONE instead of going
821         to handle_preprocessing_directive() when not processing
822         directives. This avoids unnecessary processing during the token peek in
823         is_punct().
824
825         This fixes #74939.
826
827         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
828         the existing error reporting methods instead of Report.Error.
829
830         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
831         after Raja's rewrite.
832
833 2005-06-08  Miguel de Icaza  <miguel@novell.com>
834
835         * class.cs: Small fix.
836
837 2005-06-08  Raja R Harinath  <rharinath@novell.com>
838
839         Fix #75160.
840         * class.cs (GetPartialBases): Fix return value check of
841         part.GetClassBases.
842
843 2005-06-07  Raja R Harinath  <rharinath@novell.com>
844
845         Ensure that partial classes are registered in their enclosing
846         namespace.  Initial part of fix of #75160.
847         * tree.cs (Tree.RecordDecl): Add new namespace argument.
848         Register declspace with namespace here, not in
849         DeclSpace.RecordDecl.
850         * cs-parser.jay: Pass namespace to RecordDecl.
851         * class.cs (PartialContainer.Create): Likewise.
852         (ClassPart.DefineType): New sanity-check.  Throws an exception if
853         called.
854         * decl.cs (Declspace.RecordDecl): Remove.
855         * namespace.cs (NamespaceEntry.DefineName): Remove.
856
857 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
858
859         * rootcontext.cs: Reset TargetExt as well.
860
861 2005-06-03  Raja R Harinath  <rharinath@novell.com>
862
863         * ecore.cs (Expression.Resolve): Emit CS0654 error when
864         -langversion:ISO-1.
865
866 2005-06-02  Raja R Harinath  <rharinath@novell.com>
867
868         Fix #75080, cs0119.cs.
869         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
870         of ...
871         (Expression.Resolve): ... this.  Use it.  Remove bogus code
872         allowing ExprClass.Type and ExprClass.Namespace for
873         ResolveFlags.VariableOrValue.
874         (Expression.Resolve) [1-argument variant]: Change default resolve
875         flags based on language version.
876         (Expression.Error_UnexpectedKind): Use a simple string array
877         rather than an ArrayList.
878         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
879         not ExprClass.Type.
880         (TypeOfVoid.DoResolve): Likewise.
881         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
882         flags argument -- it always has the same value.
883
884 2005-05-31  Raja R Harinath  <rharinath@novell.com>
885
886         Fix #75081.
887         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
888         Use it in the error message.
889         * assign.cs, expression.cs, statement.cs: Update.
890
891 2005-05-30  Raja R Harinath  <rharinath@novell.com>
892
893         Fix #75088.
894         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
895         the "almostMatchedMember" case too.
896         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
897         that failed the accessibility checks to 'almost_match'.
898
899 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
900
901         * attribute.cs: Use internal MethodBuilder methods to set
902         ExactSpelling and SetLastError on PInvoke methods, instead
903         of passing them via charset.  Fixes #75060.
904
905 2005-05-27  Raja R Harinath  <rharinath@novell.com>
906
907         * parameter.cs (Parameter): Remove TODO comment.
908         (Parameter.DefineParameter): Remove Location parameter.
909         (Parameters.LabelParameters): Likewise.
910         * class.cs (Constructor.Emit): Update to change.
911         (MethodData.Emit): Likewise.
912         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
913         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
914
915 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
916
917         * parameter.cs,
918           Removed Parameters.Location and added Parameter.Location instead.
919           Removed Location parameter from Emit() and GetSignature().
920         * anonymous.cs,
921           class.cs,
922           cs-parser.jay,
923           delegate.cs,
924           iterators.cs,
925           statement.cs :
926           Modified all related calls.
927
928 2005-05-26  Raja R Harinath  <rharinath@novell.com>
929
930         Improve user-defined conversion handling.
931         * convert.cs (GetConversionOperators): Rewrite.  Return only the
932         applicable operators.
933         (AddConversionOperators): New.  Helper for GetConversionOperators.
934         (FindMostEncompassedType, FindMostEncompassingType): Verify that
935         there is only one most encompassed/encompassing type.
936         (FindMostSpecificSource, FindMostSpecificTarget): Remove
937         "applicable operator" handling.
938         (UserConversion): Move cache here from GetConversionOperators.
939         Directly cache the chosen operator, rather than the whole
940         MethodGroup.
941         (ExplicitNumericConversion): Fix buggy implementation of Decimal
942         case.  Allow conversion of decimal to sbyte and byte too.
943         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
944         New static methods.  Used to avoid allocating EmptyExpressions in
945         convert.cs.
946
947 2005-05-24  Duncan Mak  <duncan@novell.com>
948
949         * ecore.cs (CastFromDecimal): New class for casting a decimal to
950         another class, used in Convert.ExplicitNumericConversion.
951         (CastToDecimal): New class, similar to above, but casts to
952         System.Decimal, used in Convert.ImplicitNumericConversion and also
953         in explicit convesion from double/float to decimal.
954
955         * convert.cs (ImplicitNumericConversion): Handle implicit
956         conversions to System.Decimal.
957         (ExplicitNumericConversion): handle explicit conversions to
958         System.Decimal.
959
960         This fixes #68711.
961         
962 2005-05-20  Miguel de Icaza  <miguel@novell.com>
963
964         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
965         know the type at this stage, just break through.   Fixes #75008 
966
967 2005-05-19  Martin Baulig  <martin@ximian.com>
968
969         * delegate.cs
970         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
971         to disable error reporting.
972
973         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
974         here since we don't want to report an error; see the new test-336.cs.
975
976 2005-05-19  Raja R Harinath  <rharinath@novell.com>
977
978         * statement.cs (ToplevelBlock.GetParameterReference)
979         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
980         Move here from class Block.
981         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
982         * expression.cs (ParameterReference.DoResolveBase): Likewise.
983
984 2005-05-18  Martin Baulig  <martin@ximian.com>
985
986         Fix #74978.
987
988         * flowanalysis.cs
989         (FlowBranching.Reachability): Add non-static public And() and Or()
990         methods.
991         (FlowBranchingSwitch): New class; do the `break_origins' thing
992         like in FlowBranchingLoop.
993         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
994         reachability, not just locals and parameters.
995         (FlowBranching.MergeChild): Remove some of the hacks for loop and
996         switch; MergeBreakOrigins() now takes care of that.
997
998 2005-05-18  Martin Baulig  <martin@ximian.com>
999
1000         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1001         a loop and may leave it, reset the barrier; fixes #74974.
1002
1003 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1004         
1005         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1006         is back.
1007         
1008         * cs-parser.jay: Catch more lexical errors.
1009         
1010         * report.cs: Add one more Error method.
1011         
1012         * rootcontext.cs,
1013         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1014
1015 2005-05-17  Martin Baulig  <martin@ximian.com>
1016
1017         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1018         #70970. 
1019
1020 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1021
1022         Fix test-382.cs.  Emit values of decimal constants.
1023         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1024         Carved out of ...
1025         (TypeContainer.AddField): ... this.
1026         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1027         with initializers to include 'Const's.
1028         (ClassPart.RegisterFieldForInitialization): Forward to
1029         PartialContainer.
1030         * const.cs (Const.Const): Pass initializer to base class.
1031         (Const.Define): In case of decimal constants, register them for
1032         initialization in a static constructor.
1033
1034 2005-05-14  Martin Baulig  <martin@ximian.com>
1035
1036         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1037         do not call ResolveUnreachable() on unreachable statements in
1038         here, see the comment in the source code.
1039
1040 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1041
1042         Fix #74934.
1043         * expression.cs (BinaryResolveOperator): If one of the operands of
1044         an equality comparison is 'null' and the other is a pointer type,
1045         convert the null to a NullPointer.
1046         * convert.cs (ImplicitReferenceConversion): If the expression is a
1047         NullLiteral and the target type is a pointer type, return a
1048         NullPointer instead.
1049         (ImplicitConversionStandard): Likewise.
1050
1051 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1052         
1053         * cs-parser.jay: Set readonly context based on special constructs.
1054         
1055         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1056         readonly variable error handling.
1057         
1058         * rootcontext.cs (EmitCode): Don't verify members when error
1059         occurred.
1060         
1061         * statement.cs (LocalInfo): Add reaodnly context information.
1062         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1063
1064 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1065
1066         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1067         for #74041 to initialize 'resolved' to false only for explicit
1068         blocks.  Fixes #74873.
1069
1070 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1071
1072         Fix #74920.
1073         * typemanager.cs (unmanaged_enclosing_types): New.
1074         (IsUnmanagedType): Avoid infloops by using
1075         'unmanaged_enclosing_types' to talk with recursive invocations.
1076
1077 2005-05-13  Martin Baulig  <martin@ximian.com>
1078
1079         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1080         instance variable, not a local.  Fix #74873.
1081         (Block.ResolveUnreachable): Set it to true here.
1082
1083 2005-05-11  Duncan Mak  <duncan@novell.com>
1084
1085         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1086         continuing to process for 'arg'.
1087         (handle_preprocessing_directive): Check the argument of the #endif
1088         directive and report error CS1025 if there are any trailing
1089         characters.
1090
1091         According to the C# spec, having even whitespace after the #endif
1092         directive is illegal; however, because we call arg.TrimEnd ()
1093         beforehand, we have the same behavior as csc, allowing whitespace
1094         after the directive.
1095
1096         Fixes #74892.
1097
1098 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1099
1100         Fix #74863.
1101         
1102         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1103         (Constructor.GetObsoleteAttribute): Implemented correctly.
1104
1105 2005-05-10  Martin Baulig  <martin@ximian.com>
1106
1107         * support.cs (ReflectionParameters.ParameterModifier): Use
1108         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1109         and `ParameterAttributes.In'.  Fixes #74884.
1110
1111 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1112
1113         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1114         
1115         * expression.cs (Argument.GetParameterModifier): Turned to property.
1116         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1117         
1118         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1119         its C# equivalent.
1120         
1121 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1122
1123         Fix #74852.
1124         * decl.cs (MemberCache.AddMethods): Register override methods,
1125         rather than non-override methods.
1126         * typemanager.cs (RegisterOverride): New.
1127         (IsOverride): Update.
1128
1129 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1130
1131         Fix #73105.
1132         
1133         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1134         recursive declaration.
1135         
1136         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1137         
1138 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1139
1140         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1141         
1142         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1143
1144 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1145
1146         Fix #74797.
1147         * decl.cs (DeclSpace.FamilyAccessible): 
1148         Use TypeManager.IsNestedFamilyAccessible.
1149
1150         Fix reopened #64812.
1151         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1152         internal'.
1153
1154 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1155             Abin Thomas  <projectmonokochi@rediffmail.com>
1156             Anoob V E  <projectmonokochi@rediffmail.com>
1157             Harilal P R  <projectmonokochi@rediffmail.com>
1158
1159         Fix #64812.
1160         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1161         allow access to all static members.
1162
1163 2005-05-04  Martin Baulig  <martin@ximian.com>
1164
1165         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1166
1167 2005-05-04  Martin Baulig  <martin@ximian.com>
1168
1169         Fix #74655.
1170
1171         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1172         section at the end; make things work if `default' is not the last
1173         section.        
1174
1175 2005-05-04  Martin Baulig  <martin@ximian.com>
1176
1177         Fix #70400.
1178
1179         * statement.cs (Switch): Replaced the `got_default' field with a
1180         `default_section' one.
1181         (Switch.CheckSwitch): Set `default_section' here.
1182         (Switch.Resolve): If we're a constant switch and the constant is
1183         not found, use the default section.
1184
1185 2005-05-03  Martin Baulig  <martin@ximian.com>
1186
1187         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1188
1189         * statement.cs (Foreach.ArrayForeach): New nested class.
1190         (Foreach.TemporaryVariable): New nested class.
1191         (Foreach.EmitArrayForeach): Removed; this is now in the new
1192         ArrayForeach class.
1193
1194 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1195
1196         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1197         more conservative.
1198         (VerifyPendingMethods): Revert change below.
1199
1200         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1201         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1202         that used to trigger warning -28.  Remove warning -28.
1203         * expression.cs (Invocation.OverloadResolve): Use
1204         TypeManager.IsOverride to distinguish override methods.
1205
1206         Fix #74773.
1207         * pending.cs (VerifyPendingMethods): If a base type implements the
1208         requested interface, don't bother checking individual methods of
1209         the base type.  As a side-effect, this prevents the creation of
1210         unnecessary proxies.
1211
1212 2005-05-02  Martin Baulig  <martin@ximian.com>
1213
1214         Fix #70182.
1215
1216         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1217         Also `And' the locals if the old vector is null.
1218         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1219         null; in this case we basically reset all the variables.        
1220
1221 2005-05-02  Martin Baulig  <martin@ximian.com>
1222
1223         Fix #74529.
1224
1225         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1226         Added `FlowBranching branching' argument; always `and' the
1227         variables instead of `or'ing them unless we're an infinite loop.
1228
1229         * statement.cs (While.Resolve): Create a new sibling unless we're
1230         infinite.       
1231
1232 2005-05-02  Martin Baulig  <martin@ximian.com>
1233
1234         Fix #70140.
1235
1236         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1237         arguments; use it instead of creating a new TopLevelBlock.
1238         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1239         our ConstructorInitializer.
1240
1241         * statement.cs
1242         (TopLevelBlock.TopLevelBranching): New public property.
1243         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1244         and create our `TopLevelBranching'.
1245
1246         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1247         anonymous method host, use `block.TopLevelBranching' rather than
1248         creating a new branching.
1249
1250 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1251
1252         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1253         a ScopeInfo, if any of the current children is a child of the new
1254         entry, move those children there.
1255
1256 2005-04-30  Martin Baulig  <martin@ximian.com>
1257
1258         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1259         at the beginning of a SwitchSection.  Fix #73335.
1260
1261 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1262
1263         Fix #74378
1264         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1265         
1266         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1267         (FieldExpr.DoResolve): Obsolete members are ignored for field
1268         initializers.
1269         
1270 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1271
1272         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1273         of arrays detection.
1274
1275         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1276         verification.
1277         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1278
1279         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1280         arrays report.
1281
1282 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1283
1284         * cs-parser.jay: Use the prefered version of -unsafe in error
1285         message.
1286
1287 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1288
1289         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1290         circumstances.
1291
1292 2005-04-20  John Luke  <john.luke@gmail.com>
1293
1294         * driver.cs: fix typo in error message, --outout to --output
1295
1296 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1297
1298         * codegen.cs (InRefOutArgumentResolving): New field.
1299         
1300         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1301         fields outside contructor.
1302         
1303         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1304         
1305 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1306
1307         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1308         parameter code was not completed ever, so it was not as up-to-date
1309         as local variables.  Must finish it.
1310
1311         The bug fix was to compare the Toplevel of the block, not the
1312         current block.  Thanks for Ben for pointing this out. 
1313
1314 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1315
1316         * decl.cs (AddMethods): Use the declaring type of the problem
1317         method to determine if we want to squash a warning.
1318
1319 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1320
1321         * attribute.cs: Removed debug output.
1322
1323         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1324         
1325         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1326         Report.Stderr.
1327         
1328 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1329
1330         Fix #74481.
1331         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1332         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1333         all null comparisons against reference types.
1334
1335 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1336
1337         Fix# 74565
1338         * class.cs (TypeContainer.CircularDepException) New nested
1339         exception class.
1340         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1341         (TypeContainer.DefineType): Removed error, reset InTransit before
1342         exit.
1343         (Class.DefineType): Throw exception when is in Transit.
1344         Catch exception and report error.
1345         (Struct.DefineType): Throw exception when is in Transit.
1346         Catch exception and report error.
1347         (Interface.DefineType): Throw exception when is in Transit.
1348         Catch exception and report error.
1349
1350         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1351         handle nested exception handlers.
1352
1353         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1354         a catch.
1355
1356         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1357         InFinally and InCatch storage.
1358
1359         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1360         (Catch.Resolve): Set and Restore ec.InCatch.
1361         (Try.Resolve): Set and Restore ec.InFinally.
1362         (Try.HasCatch): True when try has catch.
1363
1364 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1365
1366         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1367           for the same event member, so exclude such cases from warning 419.
1368           Fixed bug #74633.
1369
1370 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1371
1372         * expression.cs (Binary.ResolveOperator): Apply patch from John
1373         Luke to fix bug 59864: operators &, | and ^ on enumerations
1374         require that the same enum type on both sides.
1375
1376         * driver.cs: Add warnings to old flag usage, this is to assist
1377         people who produce Makefiles and hope that the Makefiles will be
1378         used on Windows.
1379
1380         * class.cs (TypeContainer.EmitType): Moved the definition of the
1381         special $PRIVATE$ field from the resolve phase to the Emit phase.
1382         During resolve we do not know if we are a struct with
1383         HasExplicitLayout, we know this only after the attributes for the
1384         type are emitted.
1385
1386         Set the FieldOffset to zero on the dummy field that we create for
1387         the class.   Fixes 74590.
1388
1389 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1390
1391         Fix #73834.
1392         * ecore.cs (PropertyExpr.resolved): New.
1393         (DoResolve): Use it to handle a case of double resolution here.
1394         Handle a case of identical-name-and-type-name.
1395         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1396         resolution by storing the results of expression resolution back
1397         into the "probes" array.
1398
1399 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1400
1401         Fix cs0208-7.cs and cs0208-8.cs.
1402         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1403         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1404         error reporting to point out the reason a struct is not unmanaged.
1405
1406 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1407
1408         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1409           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1410
1411 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1412
1413         Fix #74528.
1414         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1415         IdenticalNameAndTypeName here.
1416         (EventExpr.InstanceResolve): Likewise.
1417
1418 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1419
1420         C# 2.0 DefaultCharSetAttribute implementation
1421         
1422         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1423         which allows us to set GlobalNamespace for every resolve.
1424         (Attribute.ResolveArguments): Cut from Resolve.
1425         (Attribute.GetCharSetValue): Returns CharSet named argument.
1426         (Attribute.DefinePInvokeMethod): Gets default charset from
1427         module settings.
1428         (GlobalAttribute.ResolveAsTypeStep): Override.
1429         (GlobalAttribute.ResolveArguments): Override.
1430         
1431         * class.cs (TypeAttr): Is protected.
1432         
1433         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1434         (ModuleClass.DefaultCharSetType): New memeber.
1435         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1436         
1437         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1438         charset from module.
1439         
1440         * delegate.cs (TypeAttr): Override.
1441         (Delegate.DefineType): Use this TypeAttr.
1442         
1443         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1444         at very early stage (before types are defined) to resolve model
1445         module attributes. It will probably not work with corlib but it
1446         should be ok.
1447         
1448         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1449         charset from module.
1450         
1451         * typemanager.cs (default_charset_type): New type.
1452
1453 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1454
1455         * decl.cs (MemberCache.AddMethods): Don't warn if
1456         System.Object.Finalize has buggy MethodAttributes.
1457
1458         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1459         removed below.
1460
1461 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1462
1463         * doc.cs : detect ambiguous reference to overloaded members.
1464           Fixed bug #71603. MS 1.1 csc does not detect it.
1465
1466 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1467
1468         * doc.cs : delegates must not be referenced with parameters.
1469           Fixed bug #71605.
1470
1471 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1472
1473         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1474
1475 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1476
1477         * driver.cs (MainDriver): Stop processing if the CLS stage found
1478         errors. 
1479
1480         (CompilerCallableEntryPoint.InvokeCompiler): Always
1481         reset after execution;   Take a TextWriter argument for the
1482         output.
1483
1484         * report.cs: Use the error stream instead of hardcoding stderr. 
1485
1486 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1487
1488         * class.cs: Reduce code paths to test, too small of an
1489         optimization to make it worth the extra testing.  Always perform
1490         it. 
1491
1492 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1493
1494         Fix #74510.
1495         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1496         operators that had errors reported on them.
1497
1498 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1499
1500         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1501         argument types.
1502         (Attribute.Resolve): Add named argument type checking.
1503         
1504         * class.cs (FixedField.Define): Use IsPrimitiveType
1505         
1506         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1507         
1508         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1509         unsafe parameter types.
1510         
1511         * statement.cs (Using.ResolveExpression): Add better error description.
1512         
1513         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1514         
1515 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1516
1517         Fix #74484.
1518         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1519         AttributeUsageAttribute in the emitcontext of the attribute class,
1520         not in the emitcontext of the attributable entity it was attached to.
1521         * cs-parser.jay: Use 'current_class', not 'current_container',
1522         when creating a GlobalAttribute.
1523
1524 2005-04-08  Alp Toker  <alp@atoker.com>
1525
1526         * pending.cs: The fix to #58413 failed to compile methods implementing
1527         interfaces with/without params modifiers and vice versa, even though
1528         params modifiers aren't part of the signature. Make the modifier check
1529         less strict as in csc.
1530
1531 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1532             Anoob V E  <projectmonokochi@rediffmail.com>
1533             Harilal P R  <projectmonokochi@rediffmail.com>
1534
1535         Fix #58413.
1536         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1537         modifiers of pending methods.
1538         (PendingImplementation.PendingImplementation): Initialize it.
1539         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1540         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1541         with ParameterData.  Add check for modifiers.
1542         * class.cs (MethodData.Define): Update to changes.
1543
1544 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1545
1546         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1547
1548 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1549
1550         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1551         property.
1552         
1553         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1554         
1555         * rootcontext.cs,
1556         * typemanager.cs: Registered RequiredAttributeAttribute.
1557         
1558 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1559
1560         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1561         Warning CS0169 is back at level 3.
1562         (IMethodData.SetMemberIsUsed): New method.
1563         
1564         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1565         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1566         
1567         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1568
1569         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1570         contants.
1571         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1572         is used.
1573         
1574         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1575         is used.
1576         
1577         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1578         to avoid the problems with nested types.
1579
1580 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1581             Anoob V.E  <projectmonokochi@rediffmail.com>
1582             Harilal P.R  <projectmonokochi@rediffmail.com>
1583             Raja R Harinath  <rharinath@novell.com>
1584
1585         Fix #73820.
1586         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1587         attribute.
1588         * typemanager (GetConstructor): Make public.
1589
1590 2005-04-05  John Luke  <john.luke@gmail.com>
1591             Raja R Harinath  <rharinath@novell.com>
1592
1593         Fix #62232.
1594         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1595         struct too.  Return false quicker in a few cases.
1596         (VerifyUnManaged): Use it.
1597
1598 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1599
1600         Fix #74041.
1601         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1602         not 'unreachable_seen'.
1603
1604 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1605
1606         * attribute.cs (Attribute.GetValue): Removed unused.
1607         
1608         * codegen.cs (CodeGen.TrimExt): Removed unused.
1609         
1610         * cs-parser.jay (output): Removed unused.
1611         
1612         * cs-tokenizer.cs (hex_digits): Removed unused.
1613         
1614         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1615         
1616         * expression.cs (Indirection.LoadExprValue): Removed unused.
1617         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1618         
1619         * iterators.cs (Iterator.param_types): Removed unused.
1620         
1621         * statement.cs (Goto.block): Removed unused.
1622         (ToplevelBlock.did): Removed unused.
1623         (Switch.ResolveConstantSwitch): Removed unused.
1624
1625 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1626
1627         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1628         resetting thingy.
1629
1630 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1631
1632         Fix #74232 and cs0208-3.cs.
1633         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1634         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1635         unmanaged type.  Don't use FieldBuilders when 't' is a
1636         TypeBuilder.  Use ModFlags and MemberType fields.
1637         * class.cs (MemberBase.member_type): Rename from MemberType.
1638         (MemberBase.MemberType): New property.  Determines member_type on
1639         demand.
1640         (MemberBase.DoDefine): Don't initialize MemberType here.
1641         (FieldMember.Define): Likewise.
1642
1643 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1644
1645         Fix #74241
1646         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1647         Attributes are emitted there.
1648         
1649 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1650
1651         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1652         keyword in 'partial enum' too.
1653         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1654         is not allowed).
1655         Report from Kamil Skalski <nazgul@omega.pl>.
1656
1657         Fix #74309.
1658         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1659         have partial containers too.
1660
1661         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1662         in block' checks to Block.CheckInvariantMeaningInBlock.
1663         * statement.cs (Block.GetKnownVariableInfo): Make private.
1664         (Block.IsVariableUsedInChildBlock): Remove.
1665         (Block.IsVariableUsedInBlock): Likewise.
1666         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1667         conflicting declaration.
1668         (Block.AddVariable): Make error messages less long-winded and more
1669         specific.  Show location of conflicting declaration.
1670         * parameter.cs (Parameters.Location): New readonly property.
1671
1672 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1673
1674         Clean up semantics of invoking ResolveMemberAccess.
1675         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1676         can have an instance, ensure that we pass in a non-TypeExpression
1677         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1678         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1679         argument.  Update to changes and simplify.
1680         (FieldExpr.Emitinstance): Remove CS0120 check.
1681         (PropertyExpr.EmitInstance): Likewise.
1682         * expression.cs (Argument.Resolve): Likewise.
1683         (Invocation.DoResolve): Update to changes in semantics of
1684         InstanceExpression.
1685
1686 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1687
1688         Fix #74241
1689         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1690         customization.
1691         
1692         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1693
1694 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1695
1696         Fix difference in behaviour with commandline invocation.
1697         * driver.cs (Driver.Reset): New.
1698         (CompilerCallableEntryPoint): Call it.
1699
1700         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1701         variable" warnings if the boolean expression failed to resolve.
1702
1703 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1704
1705         * attribute.cs: Fix the union of several permissions when some of them
1706         are unrestricted (so the result isn't an unrestricted permission set).
1707         Fix #74036.
1708
1709 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1710
1711         * ecore.cs (MemberExpr): New class.  Convert from interface
1712         IMemberExpr.
1713         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1714         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1715         error checks.
1716         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1717         (MethodGroupExpr.IsExplicitImpl): Remove.
1718         (Expression.GetFieldFromEvent): Remove.
1719         (SimpleName.MemberStaticCheck): Remove.
1720         (SimpleName.DoSimpleNameResolve): Update to changes.
1721         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1722         (MemberAccess.IdenticalNameAndTypeName): Remove.
1723         (MemberAccess.error176): Move to MemberExpr.
1724         (MemberAccess.DoResolve): Update to changes.
1725         (BaseAccess.DoResolve): Likewise.
1726
1727 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1728
1729         C# 2.0 Conditional attribute class implementation
1730         
1731         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1732         Analyzes class whether it has attribute which has ConditionalAttribute
1733         and its condition is not defined.
1734         
1735         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1736         (Class.IsExcluded): New method. Search for at least one defined
1737         condition in ConditionalAttribute of attribute class.
1738
1739 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1740
1741         * ecore.cs (PropertyExpr): Derive from Expression, not
1742         ExpressionStatement.
1743         (PropertyExpr.EmitStatement): Remove.
1744
1745 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1746
1747         Fix #74060.
1748         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1749         internal field "value__" of an enum be private.  The examples for
1750         "value__" that I found on MSDN all used FieldAttributes.Private.
1751
1752         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1753         Don't mention IL method attribute names.
1754
1755         Fix #47991.  Remove a TODO.
1756         * statement.cs (Block.Toplevel): Make into a field.
1757         (Block.Parameters): Move into ToplevelBlock.
1758         (Block.known_variables): Rename from child_variable_names.
1759         (Block.Block): Remove variants that take Parameters.  Initialize
1760         'Toplevel' with the immediately surrounding toplevel block.
1761         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1762         LocalInfo parameter.
1763         (Block.GetKnownVariableInfo): New.
1764         (Block.IsVariableNameUsedInChildBlock): Update.
1765         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1766         the block, even though it may not be in scope.
1767         (Block.AddVariable): Remove Parameters parameter.  Use
1768         Toplevel.Parameters instead.
1769         (Block.AddConstant): Remove Parameters parameter.
1770         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1771         (Block.IsParamaterReference): Likewise.
1772         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1773         (ToplevelBlock.Parameters): New.  Moved from Block.
1774         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1775         initialize Parameters to a non-null value.
1776         * cs-parser.jay: Update to changes.
1777         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1778         simple names that mean different things in the same block.  Use
1779         Block.IsVariableNameUsedInBlock.
1780
1781 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1782
1783         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1784         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1785         GetTypeHandle.  It is possible for a reflected type to derive from
1786         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1787         System.Array during mscorlib compilation).
1788         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1789         contain a method_hash, don't create one either.  Don't create a
1790         deep copy of the base cache's method_hash.
1791         (MemberCache.SetupCache): Rename back from DeepCopy.
1792         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1793         already initialized.  If we see an override function, add its
1794         underlying base virtual function to the member_hash too.
1795
1796         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1797
1798 2005-03-26  Raja R Harinath  <harinath@acm.org>
1799
1800         Fix #73038.
1801         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1802         fails to resolve, ensure that the LHS is still resolved as an
1803         lvalue.
1804
1805 2005-03-25  Raja R Harinath  <harinath@acm.org>
1806
1807         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1808         ec.ContainerType.
1809         (Enum.current_ec): Remove.
1810         (Enum.LookupEnumValue): Remove EmitContext argument.
1811         Just uses the one created during DefineType.
1812         (Enum.FindMembers): Update.
1813         * expression.cs (MemberAccess.DoResolve): Update.
1814
1815 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1816
1817         * assign.cs (Assign.DoResolve): Check for CS1717 when
1818         source and target are same (uses Equals).
1819
1820         * expression.cs (LocalVariableReference, ParameterReference,
1821         This): Implemented Equals, GetHashCode.
1822
1823         * statement.cs (Block.GetParameterReference): Removed useless
1824         local variable.
1825
1826 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1827
1828         Fix cs0128.cs
1829         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1830         blocks before deciding whether the error is cs0136 or cs0128.
1831
1832         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1833         (using_alias_directive, using_namespace_directive): Pass
1834         MemberName, not an expression to Namespace.UsingAlias and
1835         Namespace.Using.
1836         (MakeName): Use the MemberName of the namespace.
1837         * namespace.cs (Namespace.MemberName): New.
1838         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1839         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1840         Likewise.
1841         * decl.cs (MemberName.Name): Make readonly.
1842         (MemberName.FromDotted): New "constructor".
1843         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1844         (MemberCore.Name): Compute from MemberName on demand.
1845         (MemberCore.SetMemberName): Provide a way to change the
1846         MemberName.
1847         (MemberCore.AddToContainer): Don't take a fullname parameter.
1848         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1849         fully qualified name of the container to the member name.
1850         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1851         only if the type is a member of the root container.
1852         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1853         MemberName.Left rather than searching for an embedded ".".
1854         (PartialContainer.CreatePart): Update to changes in RootContext.
1855         (MemberBase.ShortName): Turn into a property.  Use
1856         MemberCore.SetMemberName.
1857         (MemberBase.ExplicitInterfaceName): Remove.
1858         (MemberBase.UpdateMemberName): Remove.
1859         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1860         (PropertyBase.SetMemberName): New override.
1861         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1862         (Tree.GetDecl): New.
1863         (Tree.AllDecls): Rename from Decls.
1864         * attribute.cs, enum.cs, report.cs: Update to changes.
1865         * driver.cs (MainDriver): Use MemberName.FromDotted on
1866         RootContext.MainClass.
1867
1868 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1869
1870         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1871         checks.
1872
1873         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1874
1875 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1876
1877         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1878         property accessor modifiers.
1879
1880         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1881         fixed buffer attribute (CS1716).
1882         (PropertyMethod.HasCustomAccessModifier): When property accessor
1883         has custom modifier.
1884
1885         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1886         modifiers.
1887         (PropertyExpr.DoResolveLValue): Add CS0272.
1888
1889 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1890
1891         * convert.cs: When converting to a pointer, use the proper Conv.U
1892         or Conv.I depending on the source data type.
1893
1894         * cs-tokenizer.cs: Make the size for large decimal constants,
1895         fixes #72957.
1896
1897 2005-03-17  Martin Baulig  <martin@ximian.com>
1898
1899         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1900         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1901
1902 2005-03-17  Martin Baulig  <martin@ximian.com>
1903
1904         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1905         to bool so we can return an error condition.
1906         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1907         returned an error.
1908
1909 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1910
1911         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1912         attributes.
1913
1914 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1915
1916         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1917         Refactor to avoid traversing the list of assemblies, and to avoid
1918         string concatenation.
1919         * typemanager.cs (guid_attr_type): Remove.
1920         (negative_hits, pointers, references): Remove hashes.
1921         (type_hash): New.
1922         (GetConstructedType): New.  Uses type_hash to handle constructed
1923         types (arrays, references, pointers).
1924         (GetReferenceType, GetPointerType): Use it.
1925         (GetNestedType): New.  Uses type_hash to handle nested types of
1926         reflected types.
1927         (LookupType, LookupTypeDirect): Remove.
1928         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1929         'types' hash and LookupTypeReflection directly.
1930         (params_string, params_object): Use GetConstructedType.
1931         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1932         top-level types.
1933         (Namespace.Lookup): Use cached_types.
1934         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1935         provided by old TypeManager.LookupType.
1936         * rootcontext.cs (MakeFQN): Remove.
1937         * decl.cs (DeclSpace.MakeFQN): Likewise.
1938         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1939         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1940         TypeManager.GetConstructedType.
1941         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1942
1943 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1944
1945         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
1946         indexers.
1947
1948         * cs-parser.jay: Reports CS1527 for any namespace element.
1949
1950         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1951         Added CS0407.
1952
1953         * expression.cs (ParameterReference.IsAssigned): Changed error to
1954         CS0269.
1955         (Error_WrongNumArguments): Moved CS0245 detection here.
1956
1957         * statement.cs (Return.Resolve): Add CS1622 report.
1958
1959 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1960
1961         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1962
1963 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1964
1965         * attribute.cs expression.cs: Get rid of some allocations.
1966
1967 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1968
1969         * doc.cs : just eliminate the latest change.
1970
1971 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1972
1973         * doc.cs : commented out the latest change. It breaks xml-030.cs
1974
1975 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1976
1977         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1978           fail. So invoke CreateType() in FindDocumentedType().
1979
1980 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1981
1982         * cs-tokenizer.cs : added IsKeyword().
1983         * doc.cs : Detect keyword incorrectly used as identifier.
1984           Allow identifiers prefixed by @.
1985
1986 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1987
1988         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1989         It caused exception in namespace resolving (again!).
1990         
1991         * class.cs (Class.ctor): Removed exit.
1992         (PropertyMethod.ctor): ditto.
1993         
1994         * codegen.cs (Codegen.Reset): Reset static data.
1995         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1996         
1997         * cs-tokenizer.cs (Cleanup): Removed.
1998         
1999         * driver.cs (GetSystemDir): Rewrote to one line command.
2000         It caused problem with unloaded dynamic modules.
2001         (UnixParseOption): Removed Exit.
2002         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2003         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2004         Now can be mcs used as library.
2005         
2006         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2007         empty location.
2008         
2009         * location.cs (Reset): Reset static data.
2010         
2011         * namespace.cs (Reset): Reset static data.
2012         
2013         * report.cs (Report.Reset): Reset static data.
2014         
2015         * rootcontext.cs (RootContext.Reset): Reset static data.
2016         
2017         * tree.cs (RootTypes.ctor): Use Location.Null
2018         
2019         * typemanager.cs (TypeManager.Reset): Reset static data.
2020         (CoreLookupType): Removed Exit.
2021         (TypeHandle.Reset): Reset static data.
2022         
2023 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2024
2025         Fix #73516.
2026         * typemanager.cs (ComputeNamespaces): Import namespaces from
2027         referenced modules too.
2028
2029 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2030
2031         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2032         than '.'.
2033
2034 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2035
2036         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2037         enclosing DeclSpace.  This ensures that a name-lookup populates
2038         more caches and there are fewer 'TypeExpression's.  Carve out
2039         nested type lookup into ...
2040         (LookupNestedTypeInHierarchy): ... this.
2041
2042 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2043
2044         Clean up a few partial-class semantics.  
2045         Fixes test-357.cs and cs1618-2.cs.
2046         * cs-parser.jay (struct_declaration): Use 'current_class' as
2047         parent of newly-created struct.  Remove call to Register ().
2048         Use 'pop_current_class' to complete handing the current struct.
2049         (interface_declaration): Likewise.
2050         (class_declaration): Likewise.
2051         (enum_declaration): Use 'current_class' as parent of newly created
2052         enum.
2053         (delegate_declaration): Likewise.
2054         (pop_current_class): New function.  This is used to handle closing
2055         up the 'current_class' and 'current_container', and pointing them
2056         to the enclosing class/container.
2057         (CSharpParser): Initialize 'current_class' too.
2058         * decl.cs (MemberCore): Add check for invariant: a partial
2059         container is not a parsed entity, and thus does not enclose any
2060         parsed members.
2061         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2062         (DeclSpace.BaseTypeExpr): Use it.
2063         (DeclSpace.LookupType): Add check for invariant.
2064         * class.cs (TypeContainer): Add check for invariant: a nested
2065         class should have the same NamespaceEntry as its enclosing class.
2066         (TypeContainer.EmitFieldInitializers): Make virtual.
2067         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2068         MemberCore.
2069         (TypeContainer.Register): Remove.
2070         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2071         null.  Use TypeResolveEmitContext for resolving base types and
2072         interfaces.  Move initialization of Parts.TypeBuilder here from
2073         ...
2074         (TypeContainer.DefineNestedTypes): ... here.
2075         (PartialContainer): Take a Namespace not a NamespaceEntry.
2076         (PartialContainer.Create): Don't use Register.  Call the
2077         appropriate Add... function directly.
2078         (ClassPart): Take both the PartialContainer and the enclosing
2079         class as constructor arguments.
2080         (ClassPart.EmitFieldInitializers): Override.
2081         (ClassPart.PartFindNestedTypes): Remove.
2082         (FieldBase.GetInitializerExpression): Resolve the initializer
2083         expression in the emit context of the enclosing class.
2084         * tree.cs (RootTypes): Remove Register ().
2085         
2086 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2087
2088         * cs-parser.jay: Removed CS0134.
2089         
2090         * driver.cs: Removed CS1901.
2091         
2092         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2093         for predefined types.
2094
2095 2005-03-07  Duncan Mak  <duncan@novell.com>
2096
2097         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2098         well. Fixes bug #73454.
2099
2100 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2101
2102         * cs-tokenizer.cs (xtoken): Add CS1035.
2103         
2104         * class.cs (MethodData.Define): Add CS0683.
2105         (FieldMember.ctor): Add CS0681.
2106
2107 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2108
2109         * ecore.cs (SimpleName.DoResolve): Rename from
2110         SimpleName.DoResolveAllowStatic.
2111         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2112         Pass 'intermediate' flag to MemberStaticCheck.
2113         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2114         of "intermediate" lookups via MemberAccess.
2115         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2116         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2117
2118 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2119
2120         Fix #73394.
2121         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2122         slipped in because of variable names that are identical to a
2123         builtin type's BCL equivalent ('string String;', 'int Int32;').
2124         (PropertyExpr.EmitInstance): Likewise.
2125
2126 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2127
2128         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2129         
2130         * report.cs (warning_ignore_table): Made public.
2131
2132 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2133
2134         Fix #73282.
2135         * class.cs (MethodData.Emit): Pass 'container' to
2136         container.GetObsoleteAttribute instead of 'container.Parent'.
2137
2138 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2139
2140         * cs-parser.jay: Add 1534 error test.
2141
2142         * iterators.cs (Yield.CheckContext): Add error 1629.
2143         (Iterator.ctor): Save unsafe modifier.
2144         (MoveNextMethod.DoEmit): Restore unsafe context.
2145
2146         * namespace.cs (UsingAlias): Better error message.
2147
2148 2005-03-03  Dan Winship  <danw@novell.com>
2149
2150         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2151         the warning message [#73219]
2152
2153 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2154
2155         Fix compile with MCS 1.0.0.0.
2156         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2157         w_restore to not depend on string constant folding.
2158
2159 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2160
2161         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2162         CS0246 check to users who passed 'silent = false'.
2163         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2164         check.
2165         (SimpleName.SimpleNameResolve): Update.
2166         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2167         (MemberAccess.IdenticalNameAndTypeName): Update.
2168         * doc.cs (FindDocumentedTypeNonArray): Update.
2169
2170 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2171
2172         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2173         * parameters.cs (ComputeAndDefineParameters): Remove.
2174         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2175         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2176         Use GetParameterInfo.
2177
2178 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2179
2180         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2181
2182 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2183
2184         Unify DeclSpace.LookupType and DeclSpace.FindType.
2185         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2186         is in charge of defining nested types on demand.
2187         (DeclSpace.LookupType): Use it when the current_type is a
2188         TypeBuilder.  Use LookupTypeDirect for reflected types.
2189         (DeclSpace.FindType): Remove.
2190         (DeclSpace.LookupInterfaceOrClass): Likewise.
2191         (DeclSpace.DefineTypeAndParents): Likewise.
2192         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2193         DeclSpace.LookupType.
2194         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2195         * typemanager.cs (LookupType): Simplify.
2196         (AddUserType): Remove type from negative_hits.
2197         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2198         * class.cs (TypeContainer.FindMembers): Move handling of nested
2199         types ...
2200         (TypeContainer.FindMembers_NestedTypes): ... here.
2201         (TypeContainer.FindNestedType): Implement override.
2202         (ClassPart.FindNestedType): Delegate to PartialContainer.
2203         (ClassPart.PartFindNestedType): Looks up the nested types of the
2204         part alone.
2205
2206 2005-03-02  Martin Baulig  <martin@ximian.com>
2207
2208         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2209         static constructor in static classes.
2210
2211 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2212
2213         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2214         sizeParamIndex is not specified.
2215
2216 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2217
2218         Fix #73117
2219         * report.cs (WarningMessage.IsEnabled): Missing null check.
2220
2221 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2222
2223         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2224         in the fields and not in the properties.
2225
2226 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2227
2228         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2229         fields as well.
2230
2231 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2232
2233         * attribute.cs: Small refactoring (improved robustness).
2234         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2235         (ValidateGuid): Removed.
2236         (Resolve): Removed referenced to above mentioned.
2237         (GetAttributeUsage): Made private and changed to work without
2238         class assistance.
2239         (GetIndexerAttributeValue): Don't crash.
2240         (GetConditionalAttributeValue): Ditto.
2241         (GetClsCompliantAttributeValue): Ditto.
2242         (ExtractSecurityPermissionSet): All attributes exceptions are
2243         error 648.
2244         (GetPropertyValue): New helper.
2245         (GetMethodImplOptions): New method.
2246         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2247         some missing properties.
2248         
2249         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2250         (Method.ApplyAttributeBuilder): Updated.
2251         
2252         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2253         exception.
2254
2255 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2256
2257         Fix #73052.
2258         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2259         non-simple types (array, pointer, reference).
2260
2261 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2262
2263         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2264
2265         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2266         for operators.
2267         (Method.CheckBase): Catch wrong destructor here.
2268         (MethodData.Define): Add errors 550, 668.
2269
2270         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2271
2272         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2273
2274         * pending.cs (VerifyPendingMethods): Add error 551.
2275
2276         * typemanager.cs (CSharpName): Next error report helper.
2277
2278 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2279
2280         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2281         attributes. Removed useless attribute double check.
2282         It saves almost 2MBs for corlib.
2283
2284 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2285
2286         Fix #72924.
2287         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2288         called twice in case of error.
2289
2290 2005-02-23  Chris Toshok  <toshok@ximian.com>
2291
2292         Fix compiler portions of #72827.
2293         * statement.cs (Block.Emit): call Begin/EndScope on the
2294         EmitContext instead of the ILGenerator.
2295
2296         * codegen.cs (EmitContext.BeginScope): new method, call
2297         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2298         we have one.)
2299         (EmitContext.BeginScope): same, but EndScope and CloseScope
2300
2301         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2302         offset and call the superclass's OpenScope(int) with it.
2303         (SymbolWriter.CloseScope): get the current il
2304         offset and call superclass's CloseScope(int) with it.
2305
2306 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2307
2308         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2309         CS1677 for out and ref as well.
2310
2311         * class.cs (Method.Define): Add error CS1599 detection.
2312         
2313         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2314         
2315         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2316         
2317         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2318         
2319         * support.cs.cs (ModifierDesc): New helper method.
2320
2321 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2322             Abin Thomas  <projectmonokochi@rediffmail.com>
2323             Anoob V E  <projectmonokochi@rediffmail.com>
2324             Harilal P R  <projectmonokochi@rediffmail.com>
2325
2326         Fix #57851, #72718.
2327         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2328         MemberLookup (used for error reporting) actually returns a result.
2329         Fix error report number (122, not 112).
2330
2331 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2332             Anoob V E  <projectmonokochi@rediffmail.com>
2333             Harilal P R  <projectmonokochi@rediffmail.com>
2334
2335         Fix #71134.
2336         * pending.cs (PendingImplementation.GetAbstractMethods):
2337         Find NonPublic members too.
2338
2339 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2340
2341         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2342         Fixed error 217.
2343         
2344         * class.cs (MethodCore.CheckMethodAgainstBase):
2345         Add error 239 report.
2346
2347 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2348
2349         Fix #68955.
2350         * expression.cs (Invocation.IsApplicable): Make public.
2351         (Invocation.IsParamsMethodApplicable): Likewise.
2352         * delegate.cs (Delegate.VerifyApplicability): Don't use
2353         Invocation.VerifyArgumentCompat for parameter applicability
2354         testing.  Use Invocation.IsApplicable and
2355         Invocation.IsParamsMethodApplicable.
2356
2357 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2358
2359         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2360         
2361         * class.cs (Operator.Define): Add error 217 report.
2362         
2363 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2364
2365         * namespace.cs (UsingEntry.Resolve): Undo change below.
2366
2367 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2368
2369         Fix #72756.
2370         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2371         disable the error message when the extended MemberLookup also
2372         fails.
2373         (Expression.MemberLookupFinal): Update.
2374         (SimpleName.DoSimpleNameResolve): Update.
2375         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2376         Don't use MemberLookupFinal.
2377         (New.DoResolve): Update.
2378         (BaseAccess.CommonResolve): Update.
2379
2380 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2381
2382         Fix #72732.
2383         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2384         occured previously, don't resolve again.
2385
2386 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2387
2388         Fix #69949
2389         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2390         argument. Call ResolveAttributeUsage for unresolved.
2391         when types doesn't match ctor arguments.
2392         
2393         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2394         for nested attribute classes.
2395         (Class.attribute_usage): Removed.
2396         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2397         for attribute class.
2398         
2399         * ecore.cs (IsAttribute): Removed.
2400         
2401         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2402         
2403         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2404         now normal types.
2405         (attribute_types): Removed.
2406         (EmitCode): Global attributes are emited as the latest.
2407
2408 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2409
2410         * class.cs (EmitFieldInitializers): Don't emit field initializer
2411         for default values when optimilization is on.
2412         
2413         * constant.cs (Constant.IsDefaultValue): New property.
2414         
2415         * driver.cs: Add /optimize handling.
2416         
2417         * constant.cs,
2418         * ecore.cs,
2419         * literal.cs: Implement new IsDefaultValue property.
2420         
2421         * rootcontext.cs (Optimize): New field, holds /optimize option.
2422
2423 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2424
2425         Fix crasher in re-opened #72347.
2426         * namespace.cs (Namespace.Lookup): Return null if
2427         DeclSpace.DefineType returns null.
2428
2429         Fix #72678.
2430         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2431
2432 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2433
2434         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2435         now returns null if it cannot resolve to an lvalue.
2436         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2437         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2438         returned null.  Remove check for SimpleName.
2439         (EventExpr.DoResolveLValue): New.
2440         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2441         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2442         error from ...
2443         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2444         avoid CS0131 error.
2445         (Unary.ResolveOperator): Move CS0211 check ...
2446         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2447         CS0131 error.
2448         (Unary.DoResolveLValue): Simplify.
2449         (AddressOf.DoResolveLValue): New.
2450         (ArrayAccess.DoResolveLValue): New.
2451
2452 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2453
2454         * attribute.cs (Attribute.Resolve): Add arguments casting for
2455         when types doesn't match ctor arguments.
2456
2457 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2458
2459         Fix parts of #63202.
2460         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2461         lookup of operator in base type.  Ensure that all checks happen
2462         when the operator resolves to an "op_..." method.
2463
2464 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2465
2466         Fix #71992.
2467         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2468         'ignore_cs0104' parameter.  Pass it to ...
2469         (NamespaceEntry.Lookup): ... this.
2470         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2471         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2472         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2473         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2474         Update.  Request that cs0104 errors be ignored.
2475         (ComposedCast.ResolveAsTypeStep): Update.
2476
2477 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2478
2479         Fix #59209.
2480         * expression.cs (Invocation.BetterFunction): Remove support for
2481         comparing virtual functions and their overrides.
2482         (Invocation.IsOverride): New.
2483         (Invocation.OverloadResolve): Don't consider 'override' functions
2484         during candidate selection.  Store them in a lookaside list.
2485         If the selected method is a 'virtual' function, use the list to
2486         find any overrides that are closer to the LHS type.
2487
2488 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2489
2490         * expression.cs (New.DoResolve): Add complex core type reduction.
2491         (New.Constantify): Converts complex core type syntax like 'new int ()'
2492         to simple constant.
2493         
2494 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2495
2496         * decl.cs (EntryType.EntryType): New constructor to create an
2497         updated copy of a cache entry.
2498         (MemberCache.AddMethods): Use it.
2499         (MemberCache.ClearDeclaredOnly): Remove.
2500         (MemberCache.MemberCache): Update.
2501
2502 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2503
2504         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2505         variable.  This one is represents the actual low-level declaration
2506         of the method, as opposed to the semantic level `IsStatic'.   
2507
2508         An anonymous method which is hosted into a static method might be
2509         actually an instance method.  IsStatic would reflect the
2510         container, while MethodIsStatic represents the actual code
2511         generated.
2512
2513         * expression.cs (ParameterReference): Use the new MethodIsStatic
2514         instead of IsStatic.
2515
2516         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2517         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2518         set on the current EmitContext. 
2519
2520         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2521         resolve our casted expression as an LValue.  This triggers the
2522         proper LValue processing that is later required by Assign.
2523
2524         This fixes 72347.
2525
2526         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2527
2528 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2529
2530         C# 2.0 Fixed buffer implementation
2531
2532         * anonymous.cs: Update after RegisterHelperClass renaming.
2533
2534         * attribute.cs (AttributeTester.fixed_buffer_cache):
2535         Cache of external fixed buffers.
2536         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2537         implementation if field is fixed buffer else null.
2538
2539         * class.cs
2540         (TypeContainer.AddField): Accept FieldMember instead of Field.
2541         (FieldBase.IsFieldClsCompliant): Extracted code from
2542         VerifyClsCompliance descendant customization.
2543         (FixedField): New class handles fixed buffer fields.
2544         (FixedFieldExternal): Keeps information about imported fixed
2545         buffer.
2546         (IFixedField): Make access to internal or external fixed buffer
2547         same.
2548
2549         * cs-parser.jay: Add fixed buffer parsing.
2550
2551         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2552         buffer.
2553
2554         * expression.cs (Indirection): Extended implementation to accept
2555         fixed buffer field.
2556         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2557         (ElementAccess.MakePointerAccess): Get type as parameter.
2558         (DoResolve): Add fixed buffer field expression conversion.
2559         (DoResolveLValue): Ditto.
2560         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2561         (ArrayPtr): Derives from FixedBufferPtr.
2562         (ArrayPtr.Emit): Add extra emit for array elements.
2563
2564         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2565
2566         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2567         for compiler generated types.
2568         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2569
2570         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2571         and consume less memory.
2572         (Fixed.Resolve): Add fixed buffer case.
2573
2574         * typemanager.cs (compiler_generated_attr_ctor,
2575         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2576         (HasElementType): Add our own implementation to work on every
2577         runtime.
2578
2579 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2580
2581         * anonymous.cs (CaptureContext): Track whether `this' has been
2582         referenced.   
2583
2584         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2585         only captured `this' if it was implicitly done (instance
2586         methods/variables were used). 
2587
2588         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2589         `this' must be captured.
2590
2591 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2592  
2593         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2594         is null it means that there has been no need to capture anything,
2595         so we just create a sibling.
2596
2597         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2598
2599         Just a partial fix.  The other half is fairly elusive.
2600         
2601 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2602
2603         Fix #52586, cs0121-4.cs.
2604         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2605         and return a hashtable.
2606         (MemberCache.ClearDeclaredOnly): New.
2607         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2608         the method_hash of a base type too.
2609         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2610         type methods.  Overwrite entries with the same MethodHandle so
2611         that the ReflectedType is correct.  The process leaves in base
2612         virtual functions and their overrides as distinct entries.
2613         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2614         matters since it was boxed in a ArrayList before.
2615         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2616         modifier.
2617         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2618         case of a virtual function and its override (choose the overload
2619         as better).
2620         (Invocation.OverloadResolve): Avoid 'override' members during
2621         'applicable_type' calculation.
2622
2623 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2624
2625         Combine two near-redundant caches.
2626         * typemanager.cs (method_params): Rename from method_internal_params.
2627         (TypeManager.GetParameterData): New.  Replace
2628         Invocation.GetParameterData.
2629         (TypeManager.LookupParametersByBuilder): Remove.
2630         * expression.cs (Invocation.method_parameter_cache): Remove.
2631         (Invocation.GetParameterData): Remove.
2632         Update to changes.
2633         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2634         Update to changes.
2635
2636 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2637
2638         Fix #72015.
2639         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2640         TypeManager.multicast_delegate_type is null, resolve it by looking
2641         up "System.MulticastDelegate".
2642         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2643
2644 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2645             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2646             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2647
2648         Fix cs0164.cs.
2649         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2650         (LabeledStatement.AddReference): New.  Set 'referenced'.
2651         (Goto.Resolve): Use it.
2652
2653 2005-02-05  John Luke  <john.luke@gmail.com>
2654
2655         * driver.cs: remove duplicate -doc line in Usage ()
2656
2657 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2658
2659         * location.cs (Location.AddFile): Fix CS2002 error report.
2660
2661 2005-02-02  Martin Baulig  <martin@ximian.com>
2662
2663         * delegate.cs (Delegate.DefineType): Report an internal error if
2664         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2665         details.        
2666
2667 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2668
2669         Fix a crasher in a variant of #31984.
2670         * const.cs (Constant.CheckBase): New override that defers the
2671         new-or-override check in case the base type hasn't been populated
2672         yet.
2673         (Constant.Define): Ensure the new-or-override check is performed.
2674
2675 2005-02-01  Duncan Mak  <duncan@ximian.com>
2676
2677         * const.cs (LookupConstantValue): Check that `ce' is not null
2678         before calling GetValue ().
2679
2680 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2681
2682         Fix test-334.cs (#69519).
2683         * cs-parser.jay (using_alias_directive): Pass in an expression to
2684         NamespaceEntry.UsingAlias.
2685         (using_namespace_directive): Pass in an expression to
2686         NamespaceEntry.Using.
2687         (namespace_name): Don't flatten to a string.
2688         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2689         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2690         ResolveAsTypeStep.
2691         (NamespaceEntry.UsingEntry): Likewise.
2692         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2693         changes.
2694         (NamespaceEntry.LookupForUsing): Remove.
2695         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2696         names.
2697         (NamespaceEntry.Lookup): Remove support for dotted names.
2698
2699 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2700
2701         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2702         split into two.
2703         (NamespaceEntry.ImplicitParent): Compute on demand.
2704         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2705         parallels the current.
2706         (NamespaceEntry.LookupForUsing): Use it.
2707         (NamespaceEntry.Lookup): If the current namespace-entry is
2708         implicit, don't search aliases and using tables.
2709
2710 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2711
2712         Fix #31984.
2713         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2714         BaseCache here.
2715         (TypeContainer.BaseCache): Compute on demand.
2716         (TypeContainer.FindMembers): Define constants and types if they're
2717         not already created.
2718         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2719         check.
2720         * const.cs (Constant.Define): Make idempotent.
2721
2722 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2723
2724         * pending.cs: Produce better code (no nops produced by using Ldarg
2725         + value).
2726         
2727         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2728         i - 1' it should be arg + 1.
2729
2730         Fixes bug #71819.
2731
2732 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2733
2734         * attribute.cs (Attribute.CheckAttributeType): Make private
2735         non-virtual.
2736         (Attribute.ResolveType): Make virtual.
2737         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2738         handling of RootContext.Tree.Types.
2739
2740 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2741
2742         Update attribute-handling to use the SimpleName/MemberAccess
2743         mechanisms.
2744         * cs-parser.jay (attribute): Pass in an expression to the
2745         constructors of Attribute and GlobalAttribute.
2746         * attribute.cs (Attribute): Take an expression for the name.
2747         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2748         passed in attribute name expression.
2749         (Attribute.CheckAttributeType): Use it.
2750         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2751         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2752         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2753         argument to prevent error messages if the lookup fails.
2754
2755 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2756
2757         * expression.cs (Indirection): Implemented IVariable interface
2758         to support indirection in AddressOf operator.
2759         (PointerArithmetic.Emit): Add optimalization for case where
2760         result can be precomputed.
2761
2762 2005-01-26  Martin Baulig  <martin@ximian.com>
2763
2764         * class.cs (TypeContainer.AttributeTargets): Return the correct
2765         AttributeTargets depending on our `Kind' instead of throwing an
2766         exception; fixes #71632.
2767
2768 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2769
2770         Fix #71257
2771         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2772         constant members.
2773
2774 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2775
2776         Fix #71602.
2777         * expression.cs (MemberAccess.DoResolve): Don't complain with
2778         cs0572 when the LHS of a member access has identical name and type
2779         name.
2780
2781 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2782
2783         Fix #71651, #71675
2784         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2785         CreatePermission.
2786         Create custom PermissionSet only for PermissionSetAttribute.
2787
2788 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2789
2790         Fix #71649
2791         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2792         delegates in static class.
2793
2794 2005-01-24  Martin Baulig  <martin@ximian.com>
2795
2796         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2797         merging an implicit block, just use its reachability.
2798
2799         * statement.cs (Block.Resolve): Make the unreachable code check
2800         work wrt. implicit blocks; see test-337 from #63842.
2801
2802 2005-01-21  Alp Toker  <alp@atoker.com>
2803  
2804         * cs-parser.jay: destructor_declaration's container is PartialContainer
2805         not Class when partial types are used, so use Kind prop instead of
2806         'is'.
2807         
2808 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2809
2810         * cs-parser.jay: Improve error reporting when an interface
2811         declares new types.
2812
2813 2005-01-20  Dick Porter  <dick@ximian.com>
2814
2815         * support.cs: SeekableStreamReader fix from Sandor Dobos
2816         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2817         chars are read.  Fixes bug 70369.
2818
2819 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2820
2821         * cs-parser.jay (catch_clause): Simplify current_block handling
2822         somewhat.
2823
2824 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2825
2826         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2827         code with ImplicitStandardConversion to handle the implicit
2828         conversion of method groups into valid delegate invocations. 
2829
2830         The problem is that in parameter handling we were using this code
2831         path.  Fixes bug #64698
2832
2833 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2834
2835         * cs-parser.jay: Fix several infelicities.
2836         - Avoid assigning to the parser value stack.  Code like 
2837           '$3 = null' is unclean.  Synthesize a value for the code block
2838           instead. 
2839         - Avoid using oob_stack for storing location information.  Use ...
2840         (_mark_): ... this.  New (empty) rule.  Saves the current location
2841         in $$.
2842         (foreach_statement): Avoid using oob_stack for current_block
2843         handling.  Use technique used in for_statement and
2844         using_statement.  Synthesize a value for the code block to store
2845         additional intermediate information.
2846
2847 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2848
2849         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2850         of a different type is only allowed to private fields of a
2851         containing type, not on fields of a base class.
2852
2853         See test-174.cs and error cs0122-9.cs
2854
2855 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2856
2857         Fix test-335.cs (bug #58126).
2858         * cs-parser.jay (argument): Split out non-expression parts of the
2859         rule into 'non_simple_argument'.
2860         (invocation_expression): Support parenthesized invocations with
2861         multiple arguments, and with single non-simple arguments.
2862
2863 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2864
2865         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2866         places.
2867
2868 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2869
2870         Fix cs0038-1.cs, cs1640-6.cs.
2871         * ecore.cs (Expression.Resolve): Remove special-case for
2872         SimpleName in error-handling.
2873         (Expression.almostMatchedMembers): Relax access permission to
2874         protected.
2875         (Expression.MemberLookupFailed): Handle duplicates in
2876         almostMatchedMembers list.
2877         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2878         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2879         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2880         overload if the passed in MemberInfo is a MethodBase.
2881
2882 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2883
2884         Fix #70749
2885         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2886         for non-CAS & merge permission sets properly.
2887
2888 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2889
2890         Improve standard-compliance of simple name and member access 
2891         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2892         * ecore.cs (FullNamedExpression): New abstract base class 
2893         for Namespaces and TypeExpressions.
2894         (ResolveFlags.SimpleName): Remove.
2895         (SimpleName): Remove support for dotted names.
2896         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2897         DeclSpace.FindType and DeclSpace.LookupType.
2898         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2899         (Expression.ExprClassName): Make member function.
2900         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2901         a namespace.  Remove creation of dotted "SimpleName"s.
2902         (MemberAccess.DoResolve): Likewise.
2903         * decl.cs (DeclSpace.Cache): Make private.
2904         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2905         (DeclSpace.FindType): Update.
2906         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2907         FullNamedExpression.
2908         * namespace.cs (Namespace): Derive from FullNamedExpression
2909         so that it can be part of expression resolution.
2910         (Namespace.Lookup): Return an FullNamedExpression.
2911         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2912         namespace.
2913         * rootcontext.cs (NamespaceLookup): Remove.
2914         (LookupType): Move to DeclSpace.
2915         * attribute.cs (CheckAttributeType): Update.
2916         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2917         (FindDocumentedTypeNonArray): Likewise.
2918
2919 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2920
2921         Fix cs0509.cs, cs1632.cs.
2922         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2923         is the same as IsInterface.
2924         (TypeContainer.GetClassBases): Likewise.
2925         * statement.cs (LabeledStatement.ig): New field.
2926         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2927         label.
2928         (LabeledStatement.DoEmit): Check that the label was created with
2929         the same ILGenerator.
2930
2931 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2932
2933         Fix #71058
2934         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2935         accessors to its properties.
2936
2937         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2938         from accessors to property.
2939         
2940 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2941
2942         Fix #70722
2943         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2944         only for overrides.
2945         
2946 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2947
2948         * attribute.cs: Check for null and empty strings.  
2949
2950         I have lost another battle to Paolo.
2951
2952 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2953
2954         Fix #70942
2955         * class.cs (PropertyMethod): Set Parent field in ctors.
2956         (SetMethod.InternalParameters): Add unsafe switch hack.
2957         Override MarkForDuplicationCheck where it is appropriate.
2958
2959         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2960         It says whether container allows members with the same name.
2961         Base default is no.
2962         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2963         Removed is_method parameter.
2964
2965 2005-01-06  Duncan Mak  <duncan@ximian.com>
2966
2967         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2968         because the previous change led to incorrect reporting of CS1032
2969         ("Cannot define/undefine preprocessor symbols after first token in
2970         file"). Instead of using `tokens_seen' as the only flag that
2971         triggers CS1040, introduce `comments_seen'. This new flag is used
2972         to signify having seen comments on the current line, so it is
2973         unset after a newline.
2974
2975 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2976
2977         * doc.cs : When searching for a type, find nested type too.
2978           This fixes bug #71040.
2979
2980 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2981
2982         * doc.cs :
2983           - Warn missing member comment on those classes which also does not
2984             have doc comments. Fixed bug #71041.
2985           - Don't warn missing doc comment on default constructor.
2986             Fixed bug #71042.
2987
2988 2005-01-06  Duncan Mak  <duncan@ximian.com>
2989
2990         * cs-tokenizer.cs (xtoken): After handling traditional C-style
2991         comments, set `tokens_seen' to true. This allows us to detect
2992         misplaced preprocessor directives (i.e. not at the beginning of
2993         the a line, nor after whitespaces). In that case, report error
2994         CS1040. This fixes bug #56460.
2995
2996         * cs-parser.jay (interface_member_declaration): Add checks for
2997         IsExplicitImpl, and report CS0541 error if an interface member is
2998         defined as an explicit interface declaration.
2999
3000 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3001
3002         Fix #70817
3003         * class.cs (PropertyMethod): Set Parent field in ctors.
3004         (SetMethod.InternalParameters): Add unsafe switch hack.
3005         
3006         * decl.cs (MemberCore.Parent): Cannot be readonly.
3007
3008 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3009
3010         * decl.cs (DeclSpace.ResolveType): Remove.
3011         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3012         Merge in code from ...
3013         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3014         * class.cs, enum.cs: Update to changes.
3015
3016 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3017
3018         * anonymous.cs: Ensure that we init the scope of our parent if it
3019         has not been initialized yet.
3020
3021 2004-12-30  Duncan Mak  <duncan@ximian.com>
3022
3023         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3024         if field.FieldBuilder is null. Fixes #70758.
3025
3026         * convert.cs: Fixed some typos and updated some of the comments.
3027         (ImplicitStandardConversionExists):
3028         (TryImplicitIntConversion): If `target_type' is an interface and
3029         the type of `ic' implements this interface, return true or a new
3030         BoxedCast instead of null. This fixes #70468.
3031
3032 2004-12-29  Duncan Mak  <duncan@ximian.com>
3033
3034         * expression.cs (Argument.Emit): Check that Expr is
3035         IMemoryLocation before casting to it, and report CS1510 otherwise.
3036
3037         This fixes #70402.
3038
3039 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3040
3041         * statement.cs (Block.ThisVariable): remove the recursion here, to
3042         make the --profile more sane.
3043
3044 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3045
3046         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3047         assembly, by JB Evain.
3048
3049 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3050
3051         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3052           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3053         "parent" refers to enclosing type/class.  "base" refers to superclass.
3054
3055 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3056
3057         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3058         Ensure that we only have GlobalAttributes.
3059         * attribute.cs (Attribute.Emit): Make non-virtual.
3060         (GlobalAttribute.Emit): Remove.
3061         (Attribute.Resolve): Make virtual.
3062         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3063         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3064         the argument. Don't create one.
3065         (Attribute.GetObsoleteAttribute): Likewise.
3066         (Attribute.GetClsCompliantAttributeValue): Likewise.
3067         * class.cs, decl.cs: Update to changes.
3068
3069 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3070
3071         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3072         
3073         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3074         
3075         * statement.cs (Foreach.Resolve): Add error 186 report.
3076
3077 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3078
3079         * expression.cs (Conditional.DoResolve): Add warning 429.
3080         
3081         * statement.cs (If.Resolve): Add warning 665.
3082
3083 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3084
3085         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3086         except when in the parser, and in GlobalAttribute.
3087         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3088         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3089         RootContext.Tree.Types.NamespaceEntry once work is done.
3090         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3091         and resets RootContext.Tree.Types.NamespaceEntry.
3092
3093 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3094
3095         * cs-parser.jay: Don't create a block for every variable.
3096
3097 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3098
3099         * location.cs: Provide extra information.
3100
3101         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3102         variables from the captured environment, it is the ldarg_0.
3103
3104 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3105
3106         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3107         find a conclusion.
3108         
3109         * class.cs: Changed warning level for 169 to avoid developer
3110         displeasure from warning flooding. It will be changed back when they
3111         fix most of current BCL warnings.
3112         
3113         * RootContext.cs: Pushed default WarningLevel to 3.
3114         
3115         * statement.cs: Removed unused variable.
3116
3117 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3118
3119         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3120         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3121         Add error 502 report.
3122         (StaticClass.DefineType): Add error 441 report.
3123         (Class.AllowedModifiersProp): New virtual property as temporary
3124         extension to AllowedModifiers.
3125         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3126         to share implementation with StaticClass and don't call virtual
3127         methods from ctor.
3128         
3129         * driver.cs (MainDriver): Add error 1558 test.
3130
3131         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3132         report. Moved error 36 test here.
3133
3134         * statement.cs (Throw.Resolve): Add error 724 report.
3135
3136         * typemanager.cs: Add out_attribute_type core type.
3137         
3138 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3139
3140         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3141         3018 report.
3142         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3143
3144         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3145         3017 report.
3146         
3147         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3148
3149         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3150         Add error 3023 report.
3151         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3152
3153         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3154         implementation.
3155
3156 2004-12-12  John Luke  <john.luke@gmail.com>
3157
3158         * driver.cs (AddArgs): take -- into account when
3159         adding arguments, fixes bug 65710 
3160
3161 2004-12-12  Martin Baulig  <martin@ximian.com>
3162
3163         * expression.cs (Unary.TryReduceNegative): Added support for
3164         SByteConstant and ByteConstant.
3165         (Unary.Reduce): Check error values from TryReduceNegative().
3166
3167 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3168
3169         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3170         and report exception as error 182.
3171
3172 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3173
3174         * driver.cs (Main): Fix message when there are warnings.
3175
3176 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3177
3178         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3179
3180 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3181
3182         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3183         Reduced number of warnings.
3184         
3185         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3186
3187 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3188
3189         * driver.cs: Removed message.
3190
3191         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3192
3193 2004-12-08    <vargaz@freemail.hu>
3194
3195         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3196
3197 2004-12-08  Martin Baulig  <martin@ximian.com>
3198
3199         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3200         instead of a CS3002 for properties and indexer.
3201
3202 2004-12-08  Martin Baulig  <martin@ximian.com>
3203
3204         * decl.cs (MemberName.ToString): Make this work again.
3205
3206 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3207
3208         * attribute.cs (Resolve): Add error 591 detection.
3209
3210         * class.cs (FieldMember.Define): Add error 1547 detection.
3211         (Indexer.Define): Add error 620 detection.
3212         (Operator.Define): Add error 590 detection.
3213
3214         * ecore.cs: Missing argument for error 79.
3215
3216         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3217         detection.
3218
3219 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3220
3221         Fix #70106
3222         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3223         only.
3224
3225 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3226
3227         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3228           Some operator comments were suppressed.
3229         * doc.cs : Implicit/explicit operator name in doc comments are like
3230           "op_Explicit(type)~returnType", so added suffix handling.
3231
3232 2004-12-07  Martin Baulig  <martin@ximian.com>
3233
3234         * decl.cs
3235         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3236         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3237         (DeclSpace.ec): New protected field; store the EmitContext here.
3238         (DeclSpace.EmitContext): New public property; moved here from
3239         `TypeContainer'.
3240         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3241         EmitContext.
3242
3243         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3244         (Enum.Emit): Don't create a new EmitContext.
3245
3246         * delegate.cs (Delegate.DefineType): Always create the
3247         EmitContext.
3248
3249         * iterators.cs (Iterators.DefineIterator): Create a new
3250         EmitContext and store it in `ec'.
3251
3252 2004-08-24  Martin Baulig  <martin@ximian.com>
3253
3254         * typemanager.cs
3255         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3256         this for accessibility checks.
3257         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3258         IsNestedFamilyAccessible.
3259         (TypeManager.IsSubclassOf): New method, do what the name actually
3260         says.   
3261
3262 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3263
3264         Fix crash on cs0657-17.cs.
3265         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3266         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3267         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3268         the case where the NamespaceEntry gets overwritten.
3269
3270 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3271
3272         Fixed #69195, #56821
3273         * ecore.cs (ResolveBoolean): Tiny refactoring.
3274
3275         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3276         of right expression resolving when left is false constant and
3277         operator is LogicalAnd OR true constant and operator is LogicalOr.
3278
3279         * statement.cs (ResolveUnreachable): Always reports warning.
3280
3281 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3282
3283         * class.cs: Distinguish between 1721 and 1722 (just a little help
3284         for the programmer).
3285
3286 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3287
3288         * delegate.cs: Only allow this on new versions of the language. 
3289
3290 2004-12-02  Duncan Mak  <duncan@ximian.com>
3291
3292         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3293         Expression class.
3294         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3295         here as a static method. Take an additional bool out parameter
3296         `must_do_cs1540_check' for signaling to InstanceResolve.
3297         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3298         member field from PropertyExpr class and made it an argument of
3299         the method instead.
3300         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3301         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3302         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3303         and `remove_accessor' as well as InstanceResolve: report CS0122
3304         where applicable.
3305
3306         Fixes #70129.
3307
3308 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3309
3310         Fix test-327.cs, test-328.cs, and put in early infrastructure
3311         for eventually fixing #52697.
3312         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3313         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3314         from other methods.
3315         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3316         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3317         (VerifyUsing, error246): Update.
3318         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3319         'NamespaceEntry.LookupNamespaceOrType'.
3320
3321 2004-12-03  Martin Baulig  <martin@ximian.com>
3322
3323         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3324         method as our child, call AnonymousMethod.Compatible() on it.
3325
3326 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3327
3328         Disable XML documentation support in 'basic' profile.
3329         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3330         Redirect XmlElement to System.Object.
3331         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3332         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3333         * mcs.exe.sources: Add doc-bootstrap.cs.
3334         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3335         of doc.cs.
3336
3337 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3338
3339         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3340           comments are allowed.
3341
3342 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3343
3344         * delegate.cs: Add checks for subtypes in paramaters and return values
3345         in VerifyMethod () to add support for Covariance/Contravariance
3346         in delegates.
3347         
3348 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3349
3350         * report.cs: Remove extra closing parenthesis.
3351
3352         * convert.cs (Error_CannotImplicitConversion): If the name of the
3353         types are the same, provide some extra information.
3354
3355         * class.cs (FieldBase): Use an unused bit field from the field to
3356         encode the `has_offset' property from the FieldMember.  This saves
3357         a couple of Ks on bootstrap compilation.
3358
3359         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3360         method as our child, return the AnonymousMethod resolved
3361         expression.
3362
3363         * expression.cs (New.DoResolve): Allow return values from
3364         NewDelegate to also include AnonymousMethods.
3365
3366         Fixes #70150.
3367
3368 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3369
3370         Fix bug #70102
3371         * attribute.cs (Resolve): Improved implementation of params
3372         attribute arguments.
3373
3374         * support.cs (ParameterData): Add HasParams to be faster.
3375
3376 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3377
3378         all things are for /doc support:
3379
3380         * doc.cs: new file that supports XML documentation generation.
3381         * mcs.exe.sources: added doc.cs.
3382         * driver.cs:
3383           Handle /doc command line option.
3384           Report error 2006 instead of 5 for missing file name for /doc.
3385           Generate XML documentation when required, after type resolution.
3386         * cs-tokenizer.cs:
3387           Added support for picking up documentation (/// and /** ... */),
3388           including a new XmlCommentState enumeration.
3389         * cs-parser.jay:
3390           Added lines to fill Documentation element for field, constant,
3391           property, indexer, method, constructor, destructor, operator, event
3392           and class, struct, interface, delegate, enum.
3393           Added lines to warn incorrect comment.
3394         * rootcontext.cs :
3395           Added Documentation field (passed only when /doc was specified).
3396         * decl.cs:
3397           Added DocComment, DocCommentHeader, GenerateDocComment() and
3398           OnGenerateDocComment() and some supporting private members for
3399           /doc feature to MemberCore.
3400         * class.cs:
3401           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3402         * delegate.cs:
3403           Added overriden DocCommentHeader.
3404         * enum.cs:
3405           Added overriden DocCommentHeader and GenerateDocComment().
3406
3407 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3408
3409         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3410         unwrapping the enumeration values, chain to
3411         DoConstantNumericPromotions again, so we can promote things to the
3412         fundamental types (takes care of enums that are bytes, sbytes).
3413
3414         Fixes bug #62054.
3415
3416 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3417
3418         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3419         Fix long-standing bug in type-lookup.  Use FindType instead of
3420         LookupType when ec.ResolvingTypeTree.
3421         (Attribute.ResolveType, Attribute.Resolve)
3422         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3423         Update to changes.
3424         (Attributes.Search): Remove internal version.  Update.
3425         (Attributes.SearchMulti): Update.
3426         (Attributes.GetClsCompliantAttribute): Remove.
3427         (Attributes.GetIndexerNameAttribute): Remove.
3428         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3429         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3430         * class.cs (Indexer.Define): Likewise.
3431
3432 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3433
3434         Fix bug #68790
3435         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3436         MarshallByReference members access.
3437
3438         * expression.cs: Use CheckMarshallByRefAccess;
3439         Better error CS0197 message.
3440
3441         * report.cs: Print whole related error message.
3442
3443 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3444
3445         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3446         the current directory to help debugging.
3447
3448 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3449
3450         * class (GetClassBases): Better error 60 report.
3451         (EventProperty): Disabled warning 67 detection.
3452
3453 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3454
3455         Fix bug #60324
3456         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3457
3458         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3459         precise values.
3460
3461 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3462
3463         Fix bug #49488
3464         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3465
3466         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3467
3468 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3469
3470         * attribute.cs (Attribute.Resolve): Refine error reporting and
3471         report a cs0117 if the identifier does not exist, to distinguish
3472         from 0617 which is a miss-use of the actual identifier.
3473
3474         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3475         between cs0070 and cs0079.
3476
3477         * class.cs (MemberBase.DoDefine): When reporting a wrong
3478         accessibility level, we use MethodCore to compare instead of
3479         Method (this was a regression in some refactoring effort).
3480
3481         So now we correctly report cs0056 again.
3482
3483         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3484         testing the target_type (which was known to be object_type) and
3485         not the source type (which is anonymous_method).
3486
3487         Fixed reporting of error cs1660.
3488
3489         * expression.cs (UserCast.Source): Expose the underlying cast.
3490
3491         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3492         allowed types to find a match to int32 first (most common).
3493
3494         In addition, it ignores any ImplicitUserConversions that did an
3495         internal implicit conversion (as the switch statement allows only
3496         one integral conversion to exist).
3497
3498         * class.cs (PartialContainer.Create): rename `name' to
3499         `member_name' for clarity.  Then replace the string calls with a
3500         call to MemberName.GetPartialName, as now using
3501         MemberName.ToString is an error (this is due to the side effects
3502         it had, that were fixed in the past).
3503
3504         This will restore the error reporting on a number of partial class
3505         errors that were missusing this (and getting an exception as a
3506         results, which is now just a plain textual warning, because
3507         yyparse debug output would crash otherwise).
3508
3509 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3510
3511         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3512
3513 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3514
3515         * rootcontext.cs (LookupType): Make sure to cache lookups that
3516         don't give us a negative result. This saves about 5% of corlib
3517         compilation time.
3518
3519 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3520
3521         * report.cs (AbstractMessage.Print): messages are sent to stderr
3522
3523         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3524         non-interface in the list of interfaces (at this point, either
3525         parent was properly set, or a base class is being listed in the
3526         interfaces section).
3527
3528         This flags error 1722, and resolves the crash from bug 69259.
3529
3530 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3531
3532         * statement.cs (Using.EmitExpressionFinally): make this work right
3533         for valuetypes. Fixes 69926.
3534
3535 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3536
3537         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3538         converted to an enum" here, before we try to change the underlying
3539         type.  This code exists, but it is a different code path than the
3540         one used while encoding constants.
3541
3542         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3543         old bug: when converting from the null literal to a pointer,
3544         return an EmptyCast, not the NullLiteral.
3545
3546         This fixes #69921, the recent null_type changes probably made this
3547         bug more prominent.
3548
3549         (ImplicitReferenceConversionExists): In addition, resynchronized
3550         the code here, so it matches the same code in
3551         ImplicitReferenceConversionExists for the `from any class-type S
3552         to any interface-type T'.
3553         
3554
3555 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3556
3557         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3558
3559 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3560
3561         * cs-parser.jay: Use verbosity accordingly. 
3562
3563 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3564
3565         * expression.cs (Unary.ResolveOperator): Do not report warning;
3566         AddressOf reads from variable.
3567         
3568         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3569
3570 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3571
3572         Fix bug #69462
3573
3574         * attribute.cs (Attributable): Removed CheckTargets.
3575         (Attributes.Emit): Explicit attribute targets are tested here.
3576
3577         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3578         not enabled for interfaces.
3579
3580         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3581         (GetAssemblyName): Ouch next bug there.
3582
3583 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3584
3585         * expression.cs: Error 275 added.
3586         
3587 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3588
3589         Fix bug #69177 (Implemented decimal constant support)
3590
3591         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3592         (BinaryFold): Add DecimalConstant.
3593
3594         * const.cs (Define): Decimal constant 
3595         (is not constant.
3596         (ChangeType): Add decimal type handling.
3597         (LookupConstantValue): Don't set value for decimal type but
3598         emit DecimalConstantAttribute. Needed for constant optimization.
3599
3600         * constant.cs (ToDecimal): New method.
3601         (ConvertToDecimal): New method.
3602         (IntConstant): Implemented ConvertToDecimal.
3603         (DecimalConstant.Emit): Emit optimized version for decimals in
3604         int range.
3605
3606         * expression.cs (ResolveOperator): Changed order of constant
3607         reduction to work correctly with native types which have
3608         overloaded operators.
3609         (ResolveMemberAccess): Extract constant value from attribute
3610         for decimal type.
3611
3612         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3613
3614         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3615         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3616         (ChangeType): Decimal is special.
3617         (TypeToCoreType): Add decimal type.
3618
3619 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3620
3621         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3622         decimal types.
3623
3624 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3625
3626         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3627         test cs1667-5.cs.
3628
3629 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3630
3631         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3632
3633         * pending.cs (PendingImplementation): Grab only interfaces.
3634
3635 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3636
3637         * statement.cs (ForeachHelperMethods): Add location member and
3638         error 202 detection.
3639
3640 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3641
3642         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3643         automatically handled by executable.make.
3644         (PROGRAM): Make profile-specific.
3645
3646 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3647
3648         * expression.cs (DoResolveBase): Fixed wrong warning for out
3649         variables.
3650
3651 2004-11-18  Martin Baulig  <martin@ximian.com>
3652
3653         Merged latest changes into gmcs.  Please keep this comment in
3654         here, it makes it easier for me to see what changed in MCS since
3655         the last time I merged.
3656
3657 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3658
3659         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3660         (TypeHandle.GetMemberCache): New.
3661         (TypeHandle.TypeHandle): Update.
3662         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3663         (TypeManager.LookupParentInterfacesCache):
3664         Rename from LookupInterfaceCache.  Optimize slightly.
3665         (TypeManager.MemberLookup_FindMembers): Update.
3666         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3667         multi-type variant.
3668         (AddCacheContents): Rename from AddHashtable.
3669         * class.cs (TypeContainer.parent_container): Remove.
3670         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3671         (TypeContainer.DoDefineMembers): Don't initialize it.
3672         Update to name changes.
3673         
3674 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3675
3676         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3677         that factors the code to check access modifiers on override.  
3678
3679         (PropertyBase): Use the code here.
3680
3681         Patch from Lluis S'anchez, fixes bug #69361.
3682
3683 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3684
3685         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3686         routine that is used to report the use of a captured variable
3687         whose address has been taken.
3688
3689         There are two checks: one when variables are being captured and
3690         the other check is when the address of a variable is taken. 
3691         
3692         (because an anonymous methods might be resolved before *or* after
3693         the address has been taken) and 
3694
3695         * expression.cs (Conditional.DoResolve): Remove the special
3696         casing that Martin added to trueExpr and falseExpr being both
3697         NullLiteral.  We get the right behavior now just by introducing
3698         the null_type into the compiler. 
3699
3700         * convert.cs (ExplicitConversion): Change the code to use
3701         null_type instead of testing `expr is NullLiteral'.
3702         (ImplicitConversionStandard): use null_type too.
3703         (ImplicitReferenceConversionExists): use null_type too.
3704         (ImplicitReferenceConversion): use null_type too.
3705
3706         * literal.cs: The type of `NullLiteral' is now null_type instead
3707         of object_type. 
3708         (Resolve): Set the type here.
3709
3710         * typemanager.cs: Introduce null_type.
3711
3712 2004-11-17  Martin Baulig  <martin@ximian.com>
3713
3714         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3715         direction, like FindMembers() does.  Fixes #69546, testcase is in
3716         test-315.cs.    
3717
3718 2004-11-16  Martin Baulig  <martin@ximian.com>
3719
3720         This is based on a patch from Marek Safar, see bug #69082.
3721         Fixes bugs #63705 and #67130.
3722
3723         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3724         method; create a MemberCache for an interface type and cache the
3725         result.
3726
3727         * decl.cs (IMemberContainer.ParentContainer): Removed.
3728         (IMemberContainer.ParentCache): New property.
3729         (MemberCache.SetupCacheForInterface): Removed.
3730         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3731         to create a cache for an interface's "parent".
3732
3733         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3734         interfaces too.
3735
3736 2004-11-16  Martin Baulig  <martin@ximian.com>
3737
3738         Merged back from gmcs; these changes already went into gmcs a
3739         couple of weeks ago.
3740
3741         * typemanager.cs
3742         (TypeManager.AddUserType): Removed the `ifaces' argument.
3743         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3744         `TypeExpr []'.
3745         (TypeManager.AddUserInterface): Removed.
3746         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3747         `TypeExpr []'.
3748         (TypeManager.GetInterfaces): Likewise.
3749         (TypeManager.GetExplicitInterfaces): Likewise.
3750
3751         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3752
3753         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3754         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3755
3756 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3757
3758         * statement.cs: Avoid adding bools to a hashtable.
3759
3760 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3761
3762         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3763         calling an unsafe method from a safe location.
3764
3765 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3766
3767         Fix #69167
3768         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3769
3770 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3771
3772         * namespace.cs (VerifyUsing): use GetPartialName instead of
3773         ToString. 
3774
3775 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3776
3777         * statement.cs (Return.Resolve): Fix regression in typo: if
3778         `in_exc', we have to request a NeedReturnLabel, this was a typo
3779         introduced in the anonymous method check-in.  Fixes #69131.
3780
3781         * Indexers were using the ShortName when defining themselves,
3782         causing a regression in the compiler bootstrap when applying the
3783         patch from 2004-11-02 (first part), now they use their full name
3784         and the bug is gone.
3785
3786 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3787
3788         * driver.cs: Strip the path from the names of embedded resources. Fixes
3789         #68519.
3790
3791 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3792
3793         Fix error message regression: cs0104-2.cs.
3794         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3795         (AliasEntry.Resolve): Update.
3796         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3797         'silent' flag.
3798         (RootContext.LookupType): Update.
3799
3800 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3801
3802         * cs-parser.jay: Add support for handling accessor modifiers
3803         * class: Add support port accessor modifiers and error checking,
3804         define PropertyMethod.Define as virtual (not abstract anymore)
3805         * ecore.cs: Add checking for proeprties access with access modifiers
3806         * iterators.cs: Modify Accessor constructor call based in the modified
3807         constructor
3808 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3809
3810         * expression.cs (StringConcat): Handle being called twice,
3811         as when we have a concat in a field init with more than two
3812         ctors in the class
3813
3814 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3815
3816         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3817         special case explicit implementations, we should always produce
3818         the .property or .event declaration.
3819         
3820         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3821         since it will not return correct data if people use this
3822         unresolved in the presence of using statements (see test-313).
3823
3824         * class.cs (MethodData.Define): If we are an explicit interface
3825         implementation, set the method name to the full name of the
3826         interface plus the name of the method.  
3827
3828         Notice that using the method.MethodName.GetFullName() does not
3829         work, as it will only contain the name as declared on the source
3830         file (it can be a shorthand in the presence of using statements)
3831         and not the fully qualifed type name, for example:
3832
3833         using System;
3834
3835         class D : ICloneable {
3836                 object ICloneable.Clone ()  {
3837                 }
3838         }
3839
3840         Would produce a method called `ICloneable.Clone' instead of
3841         `System.ICloneable.Clone'.
3842
3843         * namespace.cs (Alias.Resolve): Use GetPartialName.
3844         
3845 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3846
3847         * cs-parser.jay: Add error 1055 report.
3848
3849 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3850
3851         * assign.cs (Assign.DoResolve): Only do the transform of
3852         assignment into a New if the types are compatible, if not, fall
3853         through and let the implicit code deal with the errors and with
3854         the necessary conversions. 
3855
3856 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3857
3858         * cs-parser.jay: Add error 1031 report.
3859
3860         * cs-tokenizer.cs: Add location for error 1038.
3861
3862 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3863
3864         * cs-parser.jay: Add error 1016 report.
3865
3866 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3867
3868         * cs-parser.jay: Add errors 1575,1611 report.
3869
3870 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3871
3872         * cs-parser.jay: Add error 1001 report.
3873
3874 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3875
3876         Fix #68850
3877         * attribute.cs (GetMarshal): Add method argument for
3878         caller identification.
3879
3880         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3881         agument for GetMarshal and RuntimeMissingSupport.
3882
3883 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3884
3885         * attribute.cs (ExtractSecurityPermissionSet): Removed
3886         TypeManager.code_access_permission_type.
3887
3888         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3889
3890 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3891
3892         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3893         for obsolete use of a variable here.   Fixes regression on errors
3894         cs0619-25 and cs0619-26.
3895
3896 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3897
3898         Fix #62358, implemented security attribute encoding.
3899
3900         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3901         Tests permitted SecurityAction for assembly or other types.
3902         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3903         data from SecurityPermissionAttribute to PermisionSet class.
3904
3905         * class.cs (ApplyAttributeBuilder): Added special handling
3906         for System.Security.Permissions.SecurityAttribute based types.
3907
3908         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3909         special handling for System.Security.Permissions.SecurityAttribute
3910         based types.
3911
3912         * enum.cs (ApplyAttributeBuilder): Added special handling
3913         for System.Security.Permissions.SecurityAttribute based types.
3914
3915         * parameter.cs (ApplyAttributeBuilder): Added special handling
3916         for System.Security.Permissions.SecurityAttribute based types.
3917
3918         * rootcontext.cs: Next 2 core types.
3919
3920         * typemanager.cs (TypeManager.security_permission_attr_type):
3921         Built in type for the SecurityPermission Attribute.
3922         (code_access_permission_type): Build in type.
3923
3924 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3925
3926         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3927         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3928         all of this information into
3929         EmitContext.EmitCapturedVariableInstance.
3930         
3931         * codegen.cs (EmitCapturedVariableInstance): move here the
3932         funcionality of emitting an ldarg.0 in the presence of a
3933         remapping.   This centralizes the instance emit code.
3934
3935         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3936         then emit a load of this: it means that we have reached the
3937         topmost ScopeInfo: the one that contains the pointer to the
3938         instance of the class hosting the anonymous method.
3939
3940         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3941         captures to the topmost CaptureContext.
3942
3943 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3944
3945         * expression.cs (LocalVariableReference): Move the knowledge about
3946         the iterators into codegen's EmitCapturedVariableInstance.
3947
3948 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3949
3950         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3951         all code paths return a value from an anonymous method (it is the
3952         same as the 161 error, but for anonymous methods).
3953
3954 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
3955
3956         The introduction of anonymous methods in the compiler changed
3957         various ways of doing things in the compiler.  The most
3958         significant one is the hard split between the resolution phase
3959         and the emission phases of the compiler.
3960
3961         For instance, routines that referenced local variables no
3962         longer can safely create temporary variables during the
3963         resolution phase: they must do so from the emission phase,
3964         since the variable might have been "captured", hence access to
3965         it can not be done with the local-variable operations from the runtime.
3966         
3967         * statement.cs 
3968
3969         (Block.Flags): New flag `IsTopLevel' to indicate that this block
3970         is a toplevel block.
3971
3972         (ToplevelBlock): A new kind of Block, these are the blocks that
3973         are created by the parser for all toplevel method bodies.  These
3974         include methods, accessors and anonymous methods.
3975
3976         These contain some extra information not found in regular blocks:
3977         A pointer to an optional CaptureContext (for tracking captured
3978         local variables and parameters).  A pointer to the parent
3979         ToplevelBlock.
3980         
3981         (Return.Resolve): Catch missmatches when returning a value from an
3982         anonymous method (error 1662).
3983         Invoke NeedReturnLabel from the Resolve phase instead of the emit
3984         phase.
3985
3986         (Break.Resolve): ditto.
3987
3988         (SwitchLabel): instead of defining the labels during the
3989         resolution phase, we now turned the public ILLabel and ILLabelCode
3990         labels into methods called GetILLabelCode() and GetILLabel() that
3991         only define the label during the Emit phase.
3992
3993         (GotoCase): Track the SwitchLabel instead of the computed label
3994         (its contained therein).  Emit the code by using
3995         SwitchLabel.GetILLabelCode ().
3996
3997         (LocalInfo.Flags.Captured): A new flag has been introduce to track
3998         whether the Local has been captured or not.
3999
4000         (LocalInfo.IsCaptured): New property, used to tell whether the
4001         local has been captured.
4002         
4003         * anonymous.cs: Vastly updated to contain the anonymous method
4004         support.
4005
4006         The main classes here are: CaptureContext which tracks any
4007         captured information for a toplevel block and ScopeInfo used to
4008         track the activation frames for various local variables.   
4009
4010         Each toplevel block has an optional capture context associated
4011         with it.  When a method contains an anonymous method both the
4012         toplevel method and the anonymous method will create a capture
4013         context.   When variables or parameters are captured, they are
4014         recorded on the CaptureContext that owns them, for example:
4015
4016         void Demo () {
4017              int a;
4018              MyDelegate d = delegate {
4019                  a = 1;
4020              }
4021         }
4022
4023         Here `a' will be recorded as captured on the toplevel
4024         CapturedContext, the inner captured context will not have anything
4025         (it will only have data if local variables or parameters from it
4026         are captured in a nested anonymous method.
4027
4028         The ScopeInfo is used to track the activation frames for local
4029         variables, for example:
4030
4031         for (int i = 0; i < 10; i++)
4032                 for (int j = 0; j < 10; j++){
4033                    MyDelegate d = delegate {
4034                         call (i, j);
4035                    }
4036                 }
4037
4038         At runtime this captures a single captured variable `i', but it
4039         captures 10 different versions of the variable `j'.  The variable
4040         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4041         recorded on a child.  
4042
4043         The toplevel ScopeInfo will also track information like the `this'
4044         pointer if instance variables were referenced (this is necessary
4045         as the anonymous method lives inside a nested class in the host
4046         type of the method). 
4047
4048         (AnonymousMethod): Expanded to track the Toplevel, implement
4049         `AnonymousMethod.Compatible' to tell whether an anonymous method
4050         can be converted to a target delegate type. 
4051
4052         The routine now also produces the anonymous method content
4053
4054         (AnonymousDelegate): A helper class that derives from
4055         DelegateCreation, this is used to generate the code necessary to
4056         produce the delegate for the anonymous method that was created. 
4057
4058         * assign.cs: API adjustments for new changes in
4059         Convert.ImplicitStandardConversionExists.
4060
4061         * class.cs: Adjustments to cope with the fact that now toplevel
4062         blocks are of type `ToplevelBlock'. 
4063
4064         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4065         insteda of standard blocks.
4066
4067         Flag errors if params arguments are passed to anonymous methods.
4068
4069         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4070         `CurrentAnonymousMethod' which points to the current Anonymous
4071         Method.  The variable points to the AnonymousMethod class that
4072         holds the code being compiled.  It is set in the new EmitContext
4073         created for the anonymous method.
4074
4075         (EmitContext.Phase): Introduce a variable and an enumeration to
4076         assist in enforcing some rules about when and where we are allowed
4077         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4078         only one that enfonces this right now).
4079
4080         (EmitContext.HaveCaptureInfo): new helper method that returns
4081         whether we have a CapturedContext initialized.
4082
4083         (EmitContext.CaptureVariable): New method used to register that a
4084         LocalInfo must be flagged for capturing. 
4085
4086         (EmitContext.CapturedParameter): New method used to register that a
4087         parameters must be flagged for capturing. 
4088         
4089         (EmitContext.CapturedField): New method used to register that a
4090         field must be flagged for capturing. 
4091
4092         (EmitContext.HaveCapturedVariables,
4093         EmitContext.HaveCapturedFields): Return whether there are captured
4094         variables or fields. 
4095
4096         (EmitContext.EmitMethodHostInstance): This is used to emit the
4097         instance for the anonymous method.  The instance might be null
4098         (static methods), this (for anonymous methods that capture nothing
4099         and happen to live side-by-side with the current method body) or a
4100         more complicated expression if the method has a CaptureContext.
4101
4102         (EmitContext.EmitTopBlock): Routine that drives the emission of
4103         code: it will first resolve the top block, then emit any metadata
4104         and then emit the code.  The split is done so that we can extract
4105         any anonymous methods and flag any captured variables/parameters.
4106         
4107         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4108         during this phase, the ILGenerator should not be used as labels
4109         and local variables declared here might not be accessible to any
4110         code that is part of an anonymous method.  
4111
4112         Exceptions to this include the temporary variables that are
4113         created by some statements internally for holding temporary
4114         variables. 
4115         
4116         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4117         metadata for a cb
4118
4119         (EmitContext.TemporaryReturn): This method is typically called
4120         from the Emit phase, and its the only place where we allow the
4121         ReturnLabel to be defined other than the EmitMeta.  The reason is
4122         that otherwise we would have to duplicate a lot of logic in the
4123         Resolve phases of various methods that today is on the Emit
4124         phase. 
4125
4126         (EmitContext.NeedReturnLabel): This no longer creates the label,
4127         as the ILGenerator is not valid during the resolve phase.
4128
4129         (EmitContext.EmitThis): Extended the knowledge in this class to
4130         work in anonymous methods in addition to iterators. 
4131
4132         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4133         code is necessary on the stack to access the instance to a local
4134         variable (the variable will be accessed as a field).
4135
4136         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4137         EmitContext.EmitAddressOfParameter): Routines to support
4138         parameters (not completed at this point). 
4139         
4140         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4141         will also remove the parameters.
4142
4143         * convert.cs (Convert): Define a `ConstantEC' which points to a
4144         null.  This is just to prefity some code that uses
4145         ImplicitStandardConversion code and do not have an EmitContext
4146         handy.
4147
4148         The idea is to flag explicitly that at that point in time, it is
4149         known that the conversion will not trigger the delegate checking
4150         code in implicit conversions (which requires a valid
4151         EmitContext). 
4152
4153         Everywhere: pass new EmitContext parameter since
4154         ImplicitStandardConversionExists now requires it to check for
4155         anonymous method conversions. 
4156
4157         (Convert.ImplicitStandardConversionExists): If the type of an
4158         expression is the anonymous_method_type, and the type is a
4159         delegate, we invoke the AnonymousMethod.Compatible method to check
4160         whether an implicit conversion is possible. 
4161
4162         (Convert.ImplicitConversionStandard): Only do implicit method
4163         group conversions if the language level is not ISO_1.
4164
4165         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4166         MethodInfo for the Invoke method.  used by Delegate and
4167         AnonymousDelegate.
4168
4169         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4170         method conversions if the target type is a delegate.
4171
4172         Removed extra debugging nops.
4173
4174         (LocalVariableReference): Turn the `local_info' into a public
4175         field. 
4176
4177         Add `prepared' field, the same hack used for FieldExprs to cope
4178         with composed assignments, as Local variables do not necessarily
4179         operate purely on the stack as they used to: they can be captured
4180         fields. 
4181
4182         Add `temp' for a temporary result, like fields.
4183
4184         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4185
4186         It now copes with Local variables that are captured and emits the
4187         proper instance variable to load it from a field in the captured
4188         case. 
4189
4190         (ParameterReference.DoResolveBase): During the resolve phase,
4191         capture parameters if we are in an anonymous method.
4192
4193         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4194         anonymous method, use the EmitContext helper routines to emit the
4195         parameter reference.
4196
4197         * iterators.cs: Set RemapToProxy to true/false during the
4198         EmitDispose class.
4199
4200         * parameters.cs (GetParameterByName): New helper method. 
4201
4202         * typemanager.cs (anonymous_method_type) a new type that
4203         represents an anonyous method.  This is always an internal type,
4204         used as a fencepost to test against the anonymous-methodness of an
4205         expression. 
4206         
4207 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4208
4209         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4210         561 report.
4211         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4212
4213 2004-10-18  Martin Baulig  <martin@ximian.com>
4214
4215         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4216         `Type' directly, but call ResolveType() on it.
4217         (Catch.Resolve): Likewise.
4218         (Foreach.Resolve): Likewise.
4219
4220 2004-10-18  Martin Baulig  <martin@ximian.com>
4221
4222         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4223         `Type' directly, but call ResolveType() on it.
4224         (Probe.DoResolve): Likewise.
4225         (ArrayCreation.LookupType): Likewise.
4226         (TypeOf.DoResolve): Likewise.
4227         (SizeOf.DoResolve): Likewise.
4228
4229 2004-10-18  Martin Baulig  <martin@ximian.com>
4230
4231         * expression.cs (Invocation.BetterFunction): Put back
4232         TypeManager.TypeToCoreType().
4233
4234 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4235
4236         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4237         the ResolveType.
4238
4239 2004-10-18  Martin Baulig  <martin@ximian.com>
4240
4241         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4242         `Type' directly, but call ResolveType() on it.
4243
4244 2004-10-18  Martin Baulig  <martin@ximian.com>
4245
4246         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4247         `Type' directly, but call ResolveType() on it.
4248         (MemberBase.DoDefine): Likewise.
4249
4250         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4251         `Type' directly, but call ResolveType() on it.
4252         (ComposedCast.DoResolveAsTypeStep): Likewise.
4253
4254         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4255         `Type' directly, but call ResolveType() on it.
4256
4257 2004-10-17  John Luke  <john.luke@gmail.com>
4258
4259         * class.cs (Operator.GetSignatureForError): use CSharpName
4260
4261         * parameter.cs (Parameter.GetSignatureForError): Returns
4262         correct name even if was not defined.
4263
4264 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4265
4266         Fix #65816.
4267         * class.cs (TypeContainer.EmitContext): New property.
4268         (DefineNestedTypes): Create an emitcontext for each part.
4269         (MethodCore.DoDefineParameters): Use container's emitcontext.
4270         Pass type array to InternalParameters.
4271         (MemberBase.DoDefine): Use container's emitcontext.
4272         (FieldMember.Define): Likewise.
4273         (Event.Define): Likewise.
4274         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4275         Pass type array to InternalParameters.
4276         (SetIndexerMethod.GetParameterInfo): Likewise.
4277         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4278         * delegate.cs (Define): Pass emitcontext to
4279         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4280         array to InternalParameters.
4281         * expression.cs (ParameterReference.DoResolveBase): Pass
4282         emitcontext to GetParameterInfo.
4283         (ComposedCast.DoResolveAsTypeStep): Remove check on
4284         ec.ResolvingTypeTree.
4285         * parameter.cs (Parameter.Resolve): Change argument to
4286         EmitContext.  Use ResolveAsTypeTerminal.
4287         (Parameter.GetSignature): Change argument to EmitContext.
4288         (Parameters.ComputeSignature): Likewise.
4289         (Parameters.ComputeParameterTypes): Likewise.
4290         (Parameters.GetParameterInfo): Likewise.
4291         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4292         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4293         * support.cs (InternalParameters..ctor): Remove variant that takes
4294         a DeclSpace.
4295         * typemanager.cs (system_intptr_expr): New.
4296         (InitExpressionTypes): Initialize it.
4297
4298 2004-10-12  Chris Toshok  <toshok@ximian.com>
4299
4300         * cs-parser.jay: fix location for try_statement and catch_clause.
4301
4302 2004-10-11  Martin Baulig  <martin@ximian.com>
4303
4304         * report.cs: Don't make --fatal abort on warnings, we have
4305         -warnaserror for that.
4306
4307 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4308
4309         More DeclSpace.ResolveType avoidance.
4310         * decl.cs (MemberCore.InUnsafe): New property.
4311         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4312         with newly created EmitContext.
4313         (FieldMember.Define): Likewise.
4314         * delegate.cs (Delegate.Define): Likewise.
4315         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4316         only if normal name-lookup fails.
4317         (TypeExpr.DoResolve): Enable error-checking.
4318         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4319         (SizeOf.DoResolve): Likewise.
4320         (ComposedCast.DoResolveAsTypeStep): Likewise.
4321         (StackAlloc.DoResolve): Likewise.
4322         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4323         (Block.Unsafe): New property.
4324         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4325         (Unsafe): Set 'unsafe' flag of contained block.
4326         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4327         (Fixed.Resolve): Likewise.
4328         (Catch.Resolve): Likewise.
4329         (Using.ResolveLocalVariableDecls): Likewise.
4330         (Foreach.Resolve): Likewise.
4331
4332 2004-10-05  John Luke <john.luke@gmail.com>
4333
4334         * cs-parser.jay: add location to error CS0175
4335
4336 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4337
4338         * ecore.cs (Expression.Constantity): Add support for turning null
4339         into a constant.
4340
4341         * const.cs (Const.Define): Allow constants to be reference types
4342         as long as the value is Null.
4343
4344 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4345
4346         * namespace.cs (NamespaceEntry.Using): No matter which warning
4347         level is set, check if this namespace name has already been added.
4348
4349 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4350
4351         * expression.cs: reftype [!=]= null should always use br[true,false].
4352         # 67410
4353
4354 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4355
4356         Fix #67108
4357         * attribute.cs: Enum conversion moved to 
4358         GetAttributeArgumentExpression to be applied to the all
4359         expressions.
4360
4361 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4362
4363         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4364         * class.c (TypeContainer.DefineType): Flag error if
4365         base types aren't accessible due to access permissions.
4366         * decl.cs (DeclSpace.ResolveType): Move logic to
4367         Expression.ResolveAsTypeTerminal.
4368         (DeclSpace.ResolveTypeExpr): Thin layer over
4369         Expression.ResolveAsTypeTerminal.
4370         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4371         Refactor code into NestedAccess.  Use it.
4372         (DeclSpace.NestedAccess): New.
4373         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4374         argument to silence errors.  Check access permissions.
4375         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4376         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4377         (Cast.DoResolve): Likewise.
4378         (New.DoResolve): Likewise.
4379         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4380         (TypeOf.DoResolve): Likewise.
4381
4382         * expression.cs (Invocation.BetterConversion): Return the Type of
4383         the better conversion.  Implement section 14.4.2.3 more faithfully.
4384         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4385         section 14.4.2.2 explicit.
4386         (Invocation.OverloadResolve): Update.
4387         (Invocation): Remove is_base field.
4388         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4389         (Invocation.Emit): Likewise.
4390
4391 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4392
4393         * README: Update to changes.
4394
4395 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4396
4397         * cs-parser.jay: Reverted 642 warning fix.
4398
4399 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4400
4401         Fix bug #66615
4402         * decl.cs (FindMemberWithSameName): Indexer can have more than
4403         1 argument.
4404
4405 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4406
4407         * expression.cs (LocalVariableReference.DoResolveLValue):
4408         Do not report warning 219 for out values.
4409         (EmptyExpression.Null): New member to avoid extra allocations.
4410
4411 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4412
4413         * cs-parser.jay: Fix wrong warning 642 report.
4414
4415         * cs-tokenizer.cs (CheckNextToken): New helper;
4416         Inspect next character if is same as expected.
4417
4418 2004-09-23  Martin Baulig  <martin@ximian.com>
4419
4420         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4421         (Convert.ImplicitReferenceConversionExists): Likewise.
4422
4423 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4424
4425         * class.cs (Operator.Define): Add error 448 and 559 report.
4426
4427 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4428
4429         * class.cs (MemberBase.IsTypePermitted): New protected
4430         method for checking error CS0610.
4431
4432 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4433
4434         * class.cs (TypeContainer.HasExplicitLayout): New property
4435         Returns whether container has StructLayout attribute set Explicit.
4436         (FieldMember): New abstract class for consts and fields.
4437         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4438         (Field): Reuse FieldMember.
4439
4440         * const.cs (Const): Reuse FieldMember.
4441
4442         * rootcontext.cs: EmitConstants call moved to class.
4443
4444 2004-09-22  Martin Baulig  <martin@ximian.com>
4445
4446         Thanks to Peter Sestoft for this bug report.
4447
4448         * expression.cs (Conditional): If both the `trueExpr' and the
4449         `falseExpr' is a NullLiteral, return a NullLiteral.
4450
4451 2004-09-22  Martin Baulig  <martin@ximian.com>
4452
4453         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4454         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4455         for the "get_Current" call.
4456
4457 2004-09-22  Martin Baulig  <martin@ximian.com>
4458
4459         Marek and me just fixed one of our oldest bugs: #28562 :-)
4460
4461         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4462
4463         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4464         we're an EnumConstant, just return that.
4465         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4466         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4467         to get the value which'll actually be written into the attribute.
4468         However, we have to use GetValue() to access the attribute's value
4469         in the compiler.        
4470
4471 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4472
4473         * constant.cs (Constant.IsNegative): New abstract property
4474         IsNegative.
4475
4476         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4477         (StackAlloc.DoResolve): Reused IsNegative.
4478
4479 2004-09-21  Martin Baulig  <martin@ximian.com>
4480
4481         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4482         if we're used in an iterator, we may be called from different
4483         methods.
4484
4485         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4486         we actually have an exception block.
4487
4488 2004-09-20  John Luke <jluke@cfl.rr.com>
4489
4490         * class.cs, cs-parser.jay: Improve the error report for 1520:
4491         report the actual line where the error happens, not where the
4492         class was declared.
4493
4494         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4495         Pass location information that was available elsewhere.
4496
4497 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4498
4499         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4500         runtime to delay sign assemblies.
4501
4502 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4503
4504         * cs-parser.jay: Do not report the stack trace, this is barely
4505         used nowadays.
4506
4507 2004-08-22  John Luke  <john.luke@gmail.com>
4508  
4509         * driver.cs : check that a resource id is not already used
4510         before adding it, report CS1508 if it is, bug #63637
4511
4512 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4513
4514         * ecore.cs: Removed dead code.
4515
4516 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4517
4518         * class.cs: Do not report warning CS0067 on the interfaces.
4519
4520 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4521
4522         * cs-parser.jay: Add error 504 report.
4523
4524 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4525
4526         * rootcontext.cs: WarningLevel is 4 by default now.
4527
4528         * statement.cs (Fixed.Resolve): Do not null
4529         VariableInfo.
4530
4531 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4532
4533         Fixed bug #55780
4534         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4535         deep search when property is not virtual.
4536         (PropertyExpr.ResolveAccessors): Make one call for both
4537         accessors.
4538
4539 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4540
4541         Fixed bug #65766
4542         * statement.cs: Error 152 report constains also location.
4543
4544 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4545
4546         Fixed bug #65766
4547         * const.cs: Explicitly set constant as static.
4548
4549 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4550
4551         Fixed bug #64226
4552         * cs-parser.jay: Add error 1017 report.
4553
4554 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4555
4556         Fixed bug #59980, #64224
4557         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4558
4559         * typemanager.cs (IsSpecialMethod): Simplified
4560
4561 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4562
4563         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4564         condition with better params.
4565
4566 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4567
4568         Fixed bug #65238
4569         * attribute.cs (Resolve): Property has to have both
4570         accessors.
4571
4572 2004-09-14  Martin Baulig  <martin@ximian.com>
4573
4574         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4575
4576 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4577
4578         Fixed bug #61902
4579         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4580         called and is obsolete then this member suppress message
4581         when call is inside next [Obsolete] method or type.
4582
4583         * expression.cs: Use TestObsoleteMethodUsage member.
4584
4585 2004-09-14  Martin Baulig  <martin@ximian.com>
4586
4587         * cs-parser.jay: Sync a bit with the GMCS version.
4588
4589 2004-09-14  Martin Baulig  <martin@ximian.com>
4590
4591         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4592         (CSharpParser.yacc_verbose_flag): New public field.
4593
4594         * genericparser.cs: Removed.
4595
4596 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4597
4598         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4599
4600 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4601
4602         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4603
4604 2004-09-10  Martin Baulig  <martin@ximian.com>
4605
4606         Backported my MemberName changes from GMCS into MCS.
4607
4608         - we are now using a special `MemberName' class instead of using
4609         strings; in GMCS, the `MemberName' also contains the type
4610         arguments.
4611
4612         - changed the grammar rules a bit:
4613           * the old `member_name' is now a `namespace_or_type_name':
4614             The rule is that we use `namespace_or_type_name' everywhere
4615             where we expect either a "member name" (GetEnumerator) or a
4616             "member name" with an explicit interface name
4617             (IEnumerable.GetEnumerator).
4618             In GMCS, the explicit interface name may include type arguments
4619             (IEnumerable<T>.GetEnumerator).
4620           * we use `member_name' instead of just `IDENTIFIER' for
4621             "member names":
4622             The rule is that we use `member_name' wherever a member may
4623             have type parameters in GMCS.       
4624
4625         * decl.cs (MemberName): New public class.
4626         (MemberCore.MemberName): New public readonly field.
4627         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4628         (DeclSpace): Likewise.
4629
4630         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4631         * enum.cs (Enum.ctor): Likewise.
4632
4633         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4634         MemberName.     
4635         (AliasEntry.ctor): Take a MemberName, not an Expression.
4636         (AliasEntry.UsingAlias): Likewise.
4637
4638         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4639         (IMethodData.MemberName): Changed type from string to MemberName.
4640         (MemberBase.ExplicitInterfaceName): Likewise.
4641         (AbstractPropertyEventMethod.SetupName): Make this private.
4642         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4643         argument; compute the member name here.
4644         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4645         on the `member.MemberName' and the `prefix'.
4646
4647         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4648         not `type_name'.
4649         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4650         thus, we get a `MemberName' instead of a `string'.  These
4651         declarations may have type parameters in GMCS.
4652         (interface_method_declaration, delegate_declaration): Likewise.
4653         (class_declaration, interface_declaration): Likewise.
4654         (method_header): Use `namespace_or_type_name' instead of
4655         `member_name'.  We may be an explicit interface implementation.
4656         (property_declaration, event_declaration): Likewise.
4657         (member_name): This is now just an `IDENTIFIER', not a
4658         `namespace_or_type_name'.
4659         (type_name, interface_type): Removed.
4660         (namespace_or_type_name): Return a MemberName, not an Expression.
4661         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4662         call GetTypeExpression() on the MemberName to get an expression.
4663         (IndexerDeclaration.interface_type): Changed type from string to
4664         MemberName.
4665         (MakeName): Operate on MemberName's instead of string's.
4666
4667 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4668
4669         Fix bug #55770.
4670         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4671         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4672         lookup to avoid symbols introduced by 'using'.
4673         * rootcontext.cs (NamespaceLookup): Update.
4674
4675 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4676
4677         * class.cs (TypeContainer.DoDefineMembers): Do not call
4678         DefineDefaultConstructor for static classes.
4679
4680 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4681
4682         * attribute.cs (Attribute.Resolve): Add error 653 report.
4683
4684         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4685         report.
4686         (Method.ApplyAttributeBuilder): Add error 685 report.
4687         (Operator.Define): Add error 564 report.
4688
4689         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4690
4691         * expression.cs (Invocation.DoResolve): Add error
4692         245 and 250 report.
4693
4694         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4695         error 674 report.
4696
4697 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4698
4699         * class.cs (ConstructorInitializer.Resolve):
4700         Wrong error number (515->516).
4701
4702 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4703
4704         * class.cs (Indexer.Define): Add error 631 report.
4705
4706 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4707
4708         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4709
4710 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4711
4712         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4713
4714 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4715
4716         * cs-parser.jay: Added error CS0241 report.
4717
4718 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4719
4720         * cs-parser.jay (fixed_statement): Introduce a scope for the
4721         declaration in the 'fixed' statement.
4722
4723 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4724
4725         * cs-parser.jay: Added CS0230 error report.
4726
4727 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4728
4729         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4730
4731 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4732
4733         * expression.cs (Argument.Resolve): Added error CS0192 and
4734         CS0199 report.
4735
4736 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4737
4738         C# 2.0 #pragma warning feature
4739
4740         * cs-tokenizer.cs (PreProcessPragma): New method; 
4741         Handles #pragma directive.
4742
4743         * report.cs (WarningRegions): New class; Support
4744         class for #pragma warning directive. It tests whether
4745         warning is enabled for a given line.
4746
4747 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4748
4749         * const.cs: Add more descriptive error report, tahnks to
4750         Sebastien. 
4751
4752 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4753
4754         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4755
4756 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4757
4758         * expression.cs: Apply patch from Ben: Remove dead code from
4759         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4760         as that code just threw an exception anwyays.
4761
4762         * const.cs: Remove the call to the turnintoconstant, for details
4763         see bug: #63144
4764         
4765         * literal.cs: The type of the null-literal is the null type;  So
4766         we use a placeholder type (literal.cs:System.Null, defined here)
4767         for it.
4768
4769         * expression.cs (Conditional.DoResolve): Remove some old code that
4770         is no longer needed, conversions have been fixed.
4771
4772         (ArrayCreationExpression.DoResolve): Return false if we fail to
4773         resolve the inner expression.
4774
4775 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4776
4777         Fix test-290.cs.
4778         * cs-parser.jay (delegate_declaration): Record a delegate
4779         declaration as a type declaration.
4780         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4781
4782 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4783
4784         * parameter.cs: Do not crash if the type can not be resolved. 
4785
4786         * expression.cs: Report errors with unsafe pointers, fixes #64896
4787
4788 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4789
4790         * expression.cs: Pointer arith always needs to do a conv.i
4791         if the operand is a long. fix 65320
4792
4793 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4794
4795         Fixed cs0619-37.cs, cs0619-38.cs
4796
4797         * enum.cs (GetObsoleteAttribute): Removed.
4798
4799         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4800         on Enum member is double staged. The first is tested member
4801         and then enum.
4802
4803 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4804
4805         Fixed #56986, #63631, #65231
4806
4807         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4808         adds member to name container.
4809         (TypeContainer.AddToTypeContainer): New method, adds type to
4810         name container.
4811         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4812         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4813         AddOperator): Simplified by reusing AddToMemberContainer.
4814         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4815         instead of field.
4816         (Method.CheckForDuplications): Fixed implementation to test all
4817         possibilities.
4818         (MemberBase): Detection whether member is explicit interface
4819         implementation is now in constructor.
4820         (MemberBase.UpdateMemberName): Handles IndexerName.
4821         (Accessor): Changed to keep also location information.
4822         (AbstractPropertyEventMethod): Is derived from MemberCore.
4823         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4824         will be emited or not.
4825         (PropertyBase.AreAccessorsDuplicateImplementation):
4826         Tests whether accessors are not in collision with some method.
4827         (Operator): Is derived from MethodCore to simplify common
4828         operations.
4829
4830         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4831         must be performed.
4832         (DeclSpace.AddToContainer): Adds the member to defined_names
4833         table. It tests for duplications and enclosing name conflicts.
4834
4835         * enum.cs (EnumMember): Clean up to reuse the base structures
4836
4837 2004-09-03  Martin Baulig  <martin@ximian.com>
4838
4839         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4840         into TypeContainer, to make partial classes work again.
4841
4842 2004-09-03  Martin Baulig  <martin@ximian.com>
4843
4844         * rootcontext.cs (RootContext.V2): Removed.
4845
4846 2004-03-23  Martin Baulig  <martin@ximian.com>
4847
4848         * expression.cs (Invocation.OverloadResolve): Added `bool
4849         may_fail' argument and use it instead of the Location.IsNull() hack.
4850
4851 2004-09-03  Martin Baulig  <martin@ximian.com>
4852
4853         Merged latest changes into gmcs.  Please keep this comment in
4854         here, it makes it easier for me to see what changed in MCS since
4855         the last time I merged.
4856
4857 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4858
4859         Fix #61128.
4860         * expression.cs (BetterConversion): Don't allow either conversion 
4861         to be null.  Remove redundant implicit conversion test when 'q ==
4862         null' -- when this function is invoked, we already know that the
4863         implicit conversion exists.
4864         (BetterFunction): Assume that 'best' is non-null.  Remove
4865         redundant reimplementation of IsApplicable when 'best' is null.
4866         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4867         number of arguments.
4868         (IsAncestralType): Extract from OverloadResolve.
4869         (OverloadResolve): Make robust to the MethodGroupExpr being
4870         unsorted.  Implement all the logic of Section 14.5.5.1, and
4871         support overloading of methods from multiple applicable types.
4872         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4873
4874         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4875         (RealError, Warning): Append type of report to related symbol.
4876
4877 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4878
4879         * enum.cs: Fixed CLS-Compliance checks for enum members.
4880         Error tests cs3008-8.cs, cs3014-8.cs
4881
4882 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4883
4884         Fixed bug #62342, #63102
4885         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4886         like ImplementMethod.
4887
4888 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4889
4890         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4891         Fixed bug #65170.
4892
4893 2004-09-02  Martin Baulig  <martin@ximian.com>
4894
4895         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4896         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4897         on the MethodBase.
4898
4899 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4900
4901         C# 2.0 Static classes implemented
4902
4903         * class.cs (TypeContainer): instance_constructors,
4904         initialized_fields, initialized_static_fields,
4905         default_constructor, base_inteface_types are protected to be
4906         accessible from StaticClass.
4907         (TypeContainer.DefineDefaultConstructor): New virtual method
4908         for custom default constructor generating
4909         (StaticClass): New class to handle "Static classes" feature.
4910
4911         * cs-parser.jay: Handle static keyword on class like instance
4912         of StaticClass.
4913
4914         * driver.cs: Added "/langversion" command line switch with two
4915         options (iso-1, default).
4916
4917 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4918
4919         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4920
4921 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4922
4923         * delegate.cs: Style.
4924
4925 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4926
4927         * delegate.cs: Add seperate instance expr field for miguel.
4928
4929 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4930
4931         * PointerArithmetic (Resolve): make sure we are not doing
4932         pointer arith on void*. Also, make sure we are resolved
4933         by not setting eclass until resolve.
4934
4935         All callers: Make sure that PointerArithmetic gets resolved.
4936
4937 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4938
4939         * ArrayCreation (LookupType): If the type does not resolve 
4940         to an array, give an error.
4941
4942 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4943
4944         * statement.cs (Try.Resolve): Fixed bug #64222
4945
4946 2004-08-27  Martin Baulig  <martin@ximian.com>
4947
4948         * class.cs
4949         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4950         crash here.     
4951
4952 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4953
4954         * ecore.cs (Constantify): Get underlying type via
4955         System.Enum.GetUnderlyingType to avoid StackOverflow on the
4956         Windows in special cases.
4957
4958 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4959
4960         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
4961         for obtaining also private methods.
4962         (GetRemoveMethod): Used GetRemoveMethod (true)
4963         for obtaining also private methods.
4964
4965 2004-08-24  Martin Baulig  <martin@ximian.com>
4966
4967         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
4968         MethodAttributes.HideBySig for operators.
4969
4970 2004-08-23  Martin Baulig  <martin@ximian.com>
4971
4972         Back to the old error reporting system :-)
4973
4974         * report.cs (Message): Removed.
4975         (Report.MessageData, ErrorData, WarningData): Removed.
4976         (Report.Error, Warning): Back to the old system.
4977
4978 2004-08-23  Martin Baulig  <martin@ximian.com>
4979
4980         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
4981
4982         * class.cs (TypeContainer.ParentContainer): New public virtual
4983         method; replaces the explicit interface implementation.
4984         (ClassPart.ParentContainer): Override.
4985
4986 2004-08-23  Martin Baulig  <martin@ximian.com>
4987
4988         * statement.cs (Switch): Added support for constant switches; see
4989         #59428 or test-285.cs.
4990
4991 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4992
4993         Fixed bug #62740.
4994         * statement.cs (GetEnumeratorFilter): Removed useless
4995         logic because C# specs is strict. GetEnumerator must be
4996         public.
4997
4998 2004-08-22  Martin Baulig  <martin@ximian.com>
4999
5000         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5001         a switch and may break, reset the barrier.  Fixes #59867.
5002
5003 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5004
5005         CLS-Compliance speed up (~5% for corlib)
5006
5007         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5008         New method. Tests container for CLS-Compliant names
5009
5010         * class.cs (TypeContainer.VerifyClsName): New method.
5011         Checks whether container name is CLS Compliant.
5012         (Constructor): Implements IMethodData.
5013
5014         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5015         low-case table for CLS Compliance test.
5016         (MemberCache.VerifyClsParameterConflict): New method.
5017         Checks method parameters for CS3006 error.
5018
5019         * enum.cs (EnumMember): Is derived from MemberCore.
5020         (Enum.VerifyClsName): Optimized for better performance.
5021
5022 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5023
5024         * report.cs: Renamed Error_T to Error and changed all
5025         references.
5026
5027 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5028
5029         * class.cs (TypeContainer.IndexerArrayList): New inner class
5030         container for indexers.
5031         (TypeContainer.DefaultIndexerName): New constant for default
5032         indexer name. Replaced all "Item" with this constant.
5033         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5034
5035         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5036         DefaultMemberAttribute constructor.
5037
5038 2004-08-05  Martin Baulig  <martin@ximian.com>
5039
5040         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5041         Fix bug #59429.
5042
5043 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5044
5045         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5046         multi platforms problem.
5047
5048         * compiler.csproj: Included shared files.
5049
5050 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5051
5052         Fix bug 60333, 55971 in the more general way
5053         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5054         Added arg_type argument for constant conversion.
5055         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5056
5057 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5058
5059         Fix bug #59760
5060         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5061         OperatorArrayList, MethodCoreArrayList for typecontainer
5062         containers. Changed class member types to these new types.
5063         (MethodArrayList.DefineMembers): Added test for CS0659.
5064
5065 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5066
5067         * cfold.cs: Synchronize the folding with the code in expression.cs
5068         Binary.DoNumericPromotions for uint operands.
5069
5070         * attribute.cs: Revert patch from Raja, it introduced a regression
5071         while building Blam-1.2.1 (hard to isolate a test case).
5072
5073 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5074
5075         Fix for #55382
5076         * class.cs:
5077         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5078         name collision.
5079         (MethodCore.parent_method): New member. The method we're overriding
5080         if this is an override method.
5081         (MethodCore.CheckBase): Moved from Method class and made common.
5082         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5083         private.
5084         (MethodCore.CheckForDuplications): New abstract method. For custom
5085         member duplication search in a container
5086         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5087         method and its return type.
5088         (Event.conflict_symbol): New member. Symbol with same name in the
5089         parent class.
5090
5091         * decl.cs:
5092         (MemberCache.FindMemberWithSameName): New method. The method
5093         is looking for conflict with inherited symbols.
5094
5095 2004-08-04  Martin Baulig  <martin@ximian.com>
5096
5097         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5098
5099         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5100
5101 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5102
5103         * report.cs (Message): New enum for better error, warning reference in
5104         the code.
5105         (MessageData): New inner abstract class. It generally handles printing of
5106         error and warning messages.
5107         Removed unused Error, Warning, Message methods.
5108
5109 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5110
5111         Fix for cs0592-8.cs test
5112         * attribute.cs
5113         (Attributable.ValidAttributeTargets): Made public.
5114         (Attribute.ExplicitTarget): New member for explicit target value.
5115         (Attribute.CheckTargets): Now we translate explicit attribute
5116         target to Target here.
5117
5118 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5119
5120         * ecore.cs (MethodGroupExpr): new IsBase property.
5121
5122         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5123
5124         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5125         rather than an instance expr.
5126
5127         (DelegateCreation.Emit): Use the method group rather than
5128         the instance expression. Also, if you have base.Foo as the
5129         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5130
5131         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5132
5133         (NewDelegate.DoResolve): Only check for the existance of Invoke
5134         if the method is going to be needed. Use MethodGroupExpr.
5135
5136         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5137
5138         * expression.cs: For pointer arith., make sure to use
5139         the size of the type, not the size of the pointer to
5140         the type.
5141
5142 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5143
5144         Fix for #60722
5145         * class.cs (Class): Added error CS0502 test.
5146
5147 2004-08-03  John Luke  <jluke@cfl.rr.com>
5148             Raja R Harinath  <rharinath@novell.com>
5149
5150         Fix for #60997.
5151         * attribute.cs (Attribute.complained_before): New flag.
5152         (Attribute.ResolveType, Attribute.Resolve),
5153         (Attribute.DefinePInvokeMethod): Set it.
5154         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5155         
5156 2004-08-03  Martin Baulig  <martin@ximian.com>
5157
5158         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5159         use a user-defined operator; we still need to do numeric
5160         promotions in case one argument is a builtin type and the other
5161         one has an implicit conversion to that type.  Fixes #62322.
5162
5163 2004-08-02  Martin Baulig  <martin@ximian.com>
5164
5165         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5166         (LocalInfo.IsThis): New public property.
5167         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5168
5169 2004-08-01  Martin Baulig  <martin@ximian.com>
5170
5171         * class.cs (TypeContainer.GetClassBases): Don't set the default
5172         here since we may get called from GetPartialBases().
5173         (TypeContainer.DefineType): If GetClassBases() didn't return a
5174         parent, use the default one.
5175
5176 2004-07-30  Duncan Mak  <duncan@ximian.com>
5177
5178         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5179
5180 2004-07-30  Martin Baulig  <martin@ximian.com>
5181
5182         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5183
5184         * class.cs (SourceMethod): New public class, derive from the
5185         symbol writer's ISourceMethod.
5186         (Method): Use the new symbol writer API.
5187
5188         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5189         as argument and use the new symbol writer.
5190
5191         * location.cs
5192         (SourceFile): Implement the symbol writer's ISourceFile.
5193         (Location.SymbolDocument): Removed.
5194         (Location.SourceFile): New public property.
5195
5196         * symbolwriter.cs: Use the new symbol writer API.
5197
5198 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5199
5200         * Makefile (install-local): Remove.  Functionality moved to
5201         executable.make.
5202
5203 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5204
5205         * Makefile: Install mcs.exe.config file together with mcs.exe.
5206         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5207         correct runtime version.
5208         
5209 2004-07-25  Martin Baulig  <martin@ximian.com>
5210
5211         * class.cs
5212         (TypeContainer.RegisterOrder): Removed, this was unused.
5213         (TypeContainer, interface_order): Removed.
5214         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5215         TypeContainer as argument since we can also be called with a
5216         `PartialContainer' for a partial class/struct/interface.
5217         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5218         of checking whether we're an `Interface' - we could be a
5219         `PartialContainer'.
5220         (PartialContainer.Register): Override; call
5221         AddClass()/AddStruct()/AddInterface() on our parent.
5222
5223         * cs-parser.jay (interface_member_declaration): Add things to the
5224         `current_container', not the `current_class'.
5225
5226         * rootcontext.cs (RegisterOrder): The overloaded version which
5227         takes an `Interface' was unused, removed.
5228
5229         * typemanager.cs (TypeManager.LookupInterface): Return a
5230         `TypeContainer', not an `Interface'.
5231         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5232         contain a `PartialContainer' for an interface, so check it's
5233         `Kind' to figure out what it is.
5234
5235 2004-07-25  Martin Baulig  <martin@ximian.com>
5236
5237         * class.cs (Class.DefaultTypeAttributes): New public constant.
5238         (Struct.DefaultTypeAttributes): Likewise.
5239         (Interface.DefaultTypeAttributes): Likewise.
5240         (PartialContainer.TypeAttr): Override this and add the
5241         DefaultTypeAttributes.
5242
5243 2004-07-25  Martin Baulig  <martin@ximian.com>
5244
5245         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5246         we can just use the `Parent' field instead.
5247
5248 2004-07-25  Martin Baulig  <martin@ximian.com>
5249
5250         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5251
5252 2004-07-25  Martin Baulig  <martin@ximian.com>
5253
5254         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5255         our parts before defining any methods.
5256         (TypeContainer.VerifyImplements): Make this virtual.
5257         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5258         on our PartialContainer.
5259
5260 2004-07-25  Martin Baulig  <martin@ximian.com>
5261
5262         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5263
5264         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5265         argument, we can just use the `Parent' field instead.
5266
5267         * class.cs
5268         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5269         (MemberBase.DoDefine): Likewise.
5270
5271 2004-07-24  Martin Baulig  <martin@ximian.com>
5272
5273         * decl.cs (MemberCore.Parent): New public field.
5274         (DeclSpace.Parent): Moved to MemberCore.
5275
5276         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5277         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5278         parent's .ctor.
5279         (FieldBase, Field, Operator): Likewise.
5280         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5281         (EventField, Event): Likewise.
5282
5283 2004-07-23  Martin Baulig  <martin@ximian.com>
5284
5285         * class.cs (PartialContainer): New public class.
5286         (ClassPart): New public class.
5287         (TypeContainer): Added support for partial classes.
5288         (TypeContainer.GetClassBases): Splitted some of the functionality
5289         out into GetNormalBases() and GetPartialBases().
5290
5291         * cs-tokenizer.cs (Token.PARTIAL): New token.
5292         (Tokenizer.consume_identifier): Added some hacks to recognize
5293         `partial', but only if it's immediately followed by `class',
5294         `struct' or `interface'.
5295
5296         * cs-parser.jay: Added support for partial clases.
5297
5298 2004-07-23  Martin Baulig  <martin@ximian.com>
5299
5300         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5301         a `DeclSpace' and also made it readonly.
5302         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5303         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5304         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5305
5306         * cs-parser.jay: Pass the `current_class', not the
5307         `current_container' (at the moment, this is still the same thing)
5308         to a new Method, Property, Event, Indexer or Constructor.
5309
5310 2004-07-23  Martin Baulig  <martin@ximian.com>
5311
5312         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5313         and removed the `current_interface' one.
5314         (struct_declaration, class_declaration, interface_declaration):
5315         Set `current_class' to the newly created class/struct/interface;
5316         set their `Bases' and call Register() before parsing their body.
5317
5318 2004-07-23  Martin Baulig  <martin@ximian.com>
5319
5320         * class.cs (Kind): New public enum.
5321         (TypeContainer): Made this class abstract.
5322         (TypeContainer.Kind): New public readonly field.
5323         (TypeContainer.CheckDef): New public method; moved here from
5324         cs-parser.jay.
5325         (TypeContainer.Register): New public abstract method.
5326         (TypeContainer.GetPendingImplementations): New public abstract
5327         method.
5328         (TypeContainer.GetClassBases): Removed the `is_class' and
5329         `is_iface' parameters.
5330         (TypeContainer.DefineNestedTypes): Formerly known as
5331         DoDefineType().
5332         (ClassOrStruct): Made this class abstract.
5333
5334         * tree.cs (RootTypes): New public type. 
5335
5336 2004-07-20  Martin Baulig  <martin@ximian.com>
5337
5338         * tree.cs (Tree.RecordNamespace): Removed.
5339         (Tree.Namespaces): Removed.
5340
5341         * rootcontext.cs (RootContext.IsNamespace): Removed.
5342
5343         * cs-parser.jay (namespace_declaration): Just create a new
5344         NamespaceEntry here.
5345
5346 2004-07-20  Martin Baulig  <martin@ximian.com>
5347
5348         * statement.cs (ExceptionStatement): New abstract class.  This is
5349         now used as a base class for everyone who's using `finally'.
5350         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5351         our local variables before using them.
5352
5353         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5354         virtual method.  This is used by Yield.Resolve() to "steal" an
5355         outer block's `finally' clauses.
5356         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5357         argument.
5358
5359         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5360         version which takes an ExceptionStatement.  This version must be
5361         used to create exception branchings.
5362
5363         * iterator.cs
5364         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5365         (Iterator.EmitMoveNext): Added exception support; protect the
5366         block with a `fault' clause, properly handle 'finally' clauses.
5367         (Iterator.EmitDispose): Run all the `finally' clauses here.
5368
5369 2004-07-20  Martin Baulig  <martin@ximian.com>
5370
5371         * iterator.cs: This is the first of a set of changes in the
5372         iterator code.  Match the spec more closely: if we're an
5373         IEnumerable, then GetEnumerator() must be called.  The first time
5374         GetEnumerator() is called, it returns the current instance; all
5375         subsequent invocations (if any) must create a copy.
5376
5377 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5378
5379         * expression.cs: Resolve the constant expression before returning
5380         it. 
5381
5382 2004-07-19  Martin Baulig  <martin@ximian.com>
5383
5384         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5385         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5386         the return type of the new EmitContext.
5387
5388 2004-07-18  Martin Baulig  <martin@ximian.com>
5389
5390         * class.cs (Property.Define): Fix iterators.
5391
5392         * iterators.cs (Iterator.Define): Moved the
5393         `container.AddInterator (this)' call here from the .ctor; only do
5394         it if we resolved successfully.
5395
5396 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5397
5398         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5399         `true' for preprocessing directives that we parse.  The return
5400         value indicates whether we should return to regular tokenizing or
5401         not, not whether it was parsed successfully.
5402
5403         In the past if we were in: #if false ... #line #endif, we would
5404         resume parsing after `#line'.  See bug 61604.
5405
5406         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5407         building: IsEnumType should return true only for enums, not for
5408         enums or System.Enum itself.  This fixes #61593.
5409
5410         Likely what happened is that corlib was wrong: mcs depended on
5411         this bug in some places.  The bug got fixed, we had to add the
5412         hack, which caused bug 61593.
5413
5414         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5415         that was a workaround for the older conditions.
5416
5417 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5418
5419         * assign.cs: IAssignMethod has a new interface, as documented
5420         inline. All assignment code now uses this new api.
5421
5422         * ecore.cs, expression.cs: All classes which implement
5423         IAssignMethod now use the new interface.
5424
5425         * expression.cs (Invocation): add a hack to EmitCall so that
5426         IndexerAccess can be the target of a compound assignment without
5427         evaluating its arguments twice.
5428
5429         * statement.cs: Handle changes in Invocation api.
5430
5431 2004-07-16  Martin Baulig  <martin@ximian.com>
5432
5433         * iterators.cs: Rewrote this.  We're now using one single Proxy
5434         class for both the IEnumerable and the IEnumerator interface and
5435         `Iterator' derives from Class so we can use the high-level API.
5436
5437         * class.cs (TypeContainer.AddIterator): New method.
5438         (TypeContainer.DoDefineType): New protected virtual method, which
5439         is called from DefineType().
5440         (TypeContainer.DoDefineMembers): Call DefineType() and
5441         DefineMembers() on all our iterators.
5442         (TypeContainer.Emit): Call Emit() on all our iterators.
5443         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5444
5445         * codegen.cs (EmitContext.CurrentIterator): New public field.
5446
5447 2004-07-15  Martin Baulig  <martin@ximian.com>
5448
5449         * typemanager.cs
5450         (TypeManager.not_supported_exception_type): New type.   
5451
5452 2004-07-14  Martin Baulig  <martin@ximian.com>
5453
5454         * iterators.cs: Use real error numbers.
5455
5456 2004-07-14  Martin Baulig  <martin@ximian.com>
5457
5458         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5459         requires this to be a System.Collection.IEnumerable and not a
5460         class implementing that interface.
5461         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5462
5463 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5464
5465         * class.cs: Fixed previous fix, it broke some error tests.
5466
5467 2004-07-12  Martin Baulig  <martin@ximian.com>
5468
5469         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5470         Fixes #61293.
5471
5472 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5473
5474         * assign.cs (LocalTemporary): Add new argument: is_address,If
5475         `is_address' is true, then the value that we store is the address
5476         to the real value, and not the value itself.
5477         
5478         * ecore.cs (PropertyExpr): use the new local temporary
5479         stuff to allow us to handle X.Y += z (where X is a struct)
5480
5481 2004-07-08  Martin Baulig  <martin@ximian.com>
5482
5483         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5484         not always return, just like we're doing in Using.Resolve().
5485
5486 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5487
5488         * cs-parser.jay (fixed_statement): flag this as Pinned.
5489
5490 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5491
5492         * typemanager.cs (TypeManager): Removed MakePinned method, this
5493         mechanism is replaced with the .NET 2.x compatible mechanism of
5494         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5495
5496         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5497         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5498         `IsFixed' property which has a different meaning.
5499
5500 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5501
5502         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5503         visible from inside a nested class, not just the names of the
5504         immediately enclosing class.
5505         Fix for bug #60730.
5506
5507 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5508
5509         * expression.cs (BetterConversion): Remove buggy special-case
5510         handling of "implicit constant expression conversions".  At this
5511         point, we already know that the conversion is possible -- we're
5512         only checking to see which is better.
5513
5514 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5515
5516         * cs-parser.jay: Added error CS0210 test.
5517
5518 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5519
5520         * cs-parser.jay: Added error CS0134 test.
5521
5522 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5523
5524         Fix bug #52507
5525         * cs-parser.jay: Added error CS0145 test.
5526
5527 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5528
5529         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5530
5531 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5532         
5533         * expression.cs (StackAlloc.Resolve): The argument may not
5534         be a constant; deal with this case.
5535         
5536 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5537
5538         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5539         GetIndexerAttributeValue.
5540         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5541
5542         * class.cs (Indexer.Define): Added error tests for CS0415,
5543         CS0609.
5544
5545 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5546
5547         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5548         property code.
5549
5550 2004-06-23  Martin Baulig  <martin@ximian.com>
5551
5552         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5553         neither return nor throw, reset the barrier as well.  Fixes #60457.
5554
5555 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5556
5557         * class.cs : EventAttributes is now set to None by default.
5558           This fixes bug #60459.
5559
5560 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5561
5562         Fix bug #60219
5563         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5564         Don't throw exception but return null (it's sufficient now).
5565
5566 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5567
5568         * typemanager.cs (GetArgumentTypes): Faster implementation.
5569
5570 2004-06-18  Martin Baulig  <martin@ximian.com>
5571
5572         * attribute.cs (Attribute.Resolve): Check whether we're an
5573         EmptyCast which a Constant child.  Fixes #60333.
5574
5575 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5576
5577         * statement.cs (EmitCollectionForeach): Account for the fact that
5578         not all valuetypes are in areas which we can take the address of.
5579         For these variables, we store to a temporary variable. Also, make
5580         sure that we dont emit a `callvirt' on a valuetype method.
5581
5582 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5583
5584         * expression.cs (StackAlloc.DoReSolve): Added test for
5585         negative parameter (CS0247).
5586
5587 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5588
5589         Fix bug #59792
5590         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5591
5592 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5593
5594         Fix bug #59781
5595         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5596         ulong.
5597
5598 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5599
5600         Fix bug #58254 & cs1555.cs, cs1556.cs
5601         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5602
5603 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5604
5605         * cs-parser.jay: Added error CS1669 test for indexers.
5606
5607 2004-06-11  Martin Baulig  <martin@ximian.com>
5608
5609         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5610         call this twice: for params and varargs methods.
5611
5612 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5613
5614         * class.cs:
5615         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5616
5617 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5618
5619         * attribute.cs (Attribute.GetValidTargets): Made public.
5620
5621         * class.cs: 
5622         (AbstractPropertyEventMethod): New class for better code sharing.
5623         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5624         CS1667 report.
5625         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5626
5627 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5628
5629         Fix bug #59477.
5630         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5631         that the call to Resolve is part of a MemberAccess.
5632         (Expression.Resolve): Use it for SimpleName resolution.
5633         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5634         Add 'intermediate' boolean argument.
5635         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5636         error message when the SimpleName can be resolved ambiguously
5637         between an expression and a type.
5638         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5639         public.
5640         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5641         call on the left-side.
5642
5643 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5644
5645         * class.cs:
5646         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5647
5648 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5649
5650         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5651
5652 2004-06-11  Martin Baulig  <martin@ximian.com>
5653
5654         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5655         varargs methods if applicable.
5656
5657 2004-06-11  Martin Baulig  <martin@ximian.com>
5658
5659         * expression.cs (Invocation.EmitCall): Don't use
5660         `method.CallingConvention == CallingConventions.VarArgs' since the
5661         method could also have `CallingConventions.HasThis'.
5662
5663 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5664
5665         * class.cs (Event.GetSignatureForError): Implemented.
5666         Fixed crash in error test cs3010.cs
5667
5668 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5669
5670         * cs-tokenizer.cs: Change the way we track __arglist to be
5671         consistent with the other keywords.
5672
5673 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5674
5675         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5676         tomorrow.
5677
5678 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5679
5680         * codegen.cs: Check that all referenced assemblies have a strongname
5681         before strongnaming the compiled assembly. If not report error CS1577.
5682         Fix bug #56563. Patch by Jackson Harper.
5683         * typemanager.cs: Added a method to return all referenced assemblies.
5684         Fix bug #56563. Patch by Jackson Harper.
5685
5686 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5687
5688         * class.cs:
5689         (Method.ApplyAttributeBuilder): Moved and added conditional
5690         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5691
5692         * delegate.cs:
5693         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5694
5695 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5696
5697         Fixed #59640
5698         * class.cs: (EventField.attribute_targets): Changed default target.
5699
5700 2004-06-08  Martin Baulig  <martin@ximian.com>
5701
5702         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5703
5704 2004-06-08  Martin Baulig  <martin@ximian.com>
5705
5706         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5707
5708 2004-06-07  Martin Baulig  <martin@ximian.com>
5709
5710         Added support for varargs methods.
5711
5712         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5713         keyword.
5714
5715         * cs-parser.jay: Added support for `__arglist'.
5716
5717         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5718
5719         * expression.cs (Argument.AType): Added `ArgList'.
5720         (Invocation): Added support for varargs methods.
5721         (ArglistAccess): New public class.
5722         (Arglist): New public class.
5723
5724         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5725
5726         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5727         a method's top-level block if the method has varargs.
5728
5729         * support.cs (ReflectionParameters, InternalParameters): Added
5730         support for varargs methods.    
5731
5732 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5733
5734         * class.cs: Provide location in indexer error report.
5735
5736         * driver.cs: Use standard names.
5737
5738         * namespace.cs: Catch the use of using after a namespace has been
5739         declared also on using aliases.
5740
5741 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5742
5743         Bug #50820.
5744         * typemanager.cs (closure_private_ok, closure_invocation_type)
5745         (closure_qualifier_type, closure_invocation_assembly)
5746         (FilterWithClosure): Move to ...
5747         (Closure): New internal nested class.
5748         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5749         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5750         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5751         (MemberLookup, MemberLookupFailed): Use it.
5752         * expression.cs (New.DoResolve): Treat the lookup for the
5753         constructor as being qualified by the 'new'ed type.
5754         (Indexers.GetIndexersForTypeOrInterface): Update.
5755
5756 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5757
5758         * attribute.cs
5759         (GetConditionalAttributeValue): New method. Returns
5760         condition of ConditionalAttribute.
5761         (SearchMulti): New method.  Returns all attributes of type 't'.
5762         Use it when attribute is AllowMultiple = true.
5763         (IsConditionalMethodExcluded): New method.
5764
5765         * class.cs
5766         (Method.IsExcluded): Implemented. Returns true if method has conditional
5767         attribute and the conditions is not defined (method is excluded).
5768         (IMethodData): Extended interface for ConditionalAttribute support.
5769         (PropertyMethod.IsExcluded): Implemented.
5770
5771         * decl.cs
5772         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5773
5774         * expression.cs
5775         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5776         on the method.
5777
5778 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5779
5780         * expression.cs (ArrayCreationExpression): Make this just an
5781         `expression'. It can't be a statement, so the code here was
5782         dead.
5783
5784 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5785
5786         Fixed #59072
5787         * typemanager.cs (GetFullNameSignature): New method for
5788         MethodBase types.
5789
5790 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5791
5792         Fixed #56452
5793         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5794         Use this method when MethodBuilder is null.
5795         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5796         Added test for error CS0626 (MONO reports error for this situation).
5797         (IMethodData.GetSignatureForError): Extended interface.
5798
5799 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5800
5801         * attribute.cs
5802         (AttributeTester.GetObsoleteAttribute): Returns instance of
5803         ObsoleteAttribute when type is obsolete.
5804
5805         * class.cs
5806         (TypeContainer.VerifyObsoleteAttribute): Override.
5807         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5808         (MethodCode.VerifyObsoleteAttribute): Override.
5809         (MemberBase.VerifyObsoleteAttribute): Override.
5810
5811         * decl.cs
5812         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5813         and report proper error.
5814
5815         *delegate.cs
5816         Delegate.VerifyObsoleteAttribute): Override.
5817
5818         * ecore.cs
5819         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5820         and report proper error.
5821         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5822
5823         * enum.cs
5824         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5825         and enum member.
5826
5827         * expression.cs
5828         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5829         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5830         Added test for ObsoleteAttribute.
5831
5832         * statement.cs
5833         (Catch): Derived from Statement.
5834
5835 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5836  
5837         Fixed bug #59071 & cs0160.cs
5838  
5839         * statement.cs (Try.Resolve): Check here whether order of catch
5840         clauses matches their dependencies.
5841
5842 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
5843
5844         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
5845         caused a regression: #59343.  Referencing nested classes from an
5846         assembly stopped working.
5847
5848 2004-05-31  Martin Baulig  <martin@ximian.com>
5849
5850         MCS is now frozen for beta 2.
5851
5852 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5853
5854         * convert.cs: add a trivial cache for overload operator resolution.
5855
5856 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5857
5858         * decl.cs: If possible, use lookuptypedirect here. We can only do
5859         this if there is no `.' after the namespace. Avoids using
5860         LookupType, which does lots of slow processing.
5861         (FindNestedType) New method, does what it says :-).
5862         * namespace.cs: use LookupTypeDirect.
5863         * rootcontext.cs: use membercache, if possible.
5864         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5865
5866 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5867
5868         * expression.cs:
5869         According to the spec, 
5870
5871         In a member access of the form E.I, if E is a single identifier,
5872         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5873         field, property, localvariable, or parameter with the same type as
5874         the meaning of E as a type-name (§3.8), then both possible
5875         meanings of E are permitted.
5876
5877         We did not check that E as a simple-name had the same type as E as
5878         a type name.
5879
5880         This trivial check gives us 5-7% on bootstrap time.
5881
5882 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5883
5884         * expression.cs (Invocation.OverloadResolve): Avoid the
5885         use of hashtables and boxing here by allocating on demand.
5886
5887 2004-05-30  Martin Baulig  <martin@ximian.com>
5888
5889         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5890         we're doing a silent lookup.  Don't try to lookup nested types in
5891         TypeManager.object_type (thanks to Ben Maurer).
5892
5893 2004-05-30  Martin Baulig  <martin@ximian.com>
5894
5895         Committing a patch from Ben Maurer.
5896
5897         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5898
5899 2004-05-29  Martin Baulig  <martin@ximian.com>
5900
5901         * class.cs (IMethodData.ShouldIgnore): New method.
5902
5903         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5904         `Location' argument, we don't need it anywhere.  Use
5905         `IMethodData.ShouldIgnore ()' instead of
5906         `MethodData.GetMethodFlags ()'.
5907         (TypeManager.AddMethod): Removed.
5908         (TypeManager.AddMethod2): Renamed to AddMethod.
5909
5910 2004-05-29  Martin Baulig  <martin@ximian.com>
5911
5912         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5913
5914         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5915         converting from a class type S to an interface type and we already
5916         have an object on the stack, don't box it again.  Fixes #52578.
5917
5918 2004-05-29  Martin Baulig  <martin@ximian.com>
5919
5920         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5921         Added support for `params' parameters.  Fixes #59267.
5922
5923 2004-05-29  Martin Baulig  <martin@ximian.com>
5924
5925         * literal.cs (NullPointer): Provide a private .ctor which sets
5926         `type' to TypeManager.object_type.  Fixes #59048.
5927
5928 2004-05-29  Martin Baulig  <martin@ximian.com>
5929
5930         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5931         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5932
5933         * ecore.cs (EventExpr.instance_expr): Make the field private.
5934
5935 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5936
5937         Fixed bug #50080 & cs0214-2.cs
5938         * expression.cs (Cast.DoResolve): Check unsafe context here.
5939         
5940         * statement.cs (Resolve.DoResolve): Likewise.
5941
5942 2004-05-26  Martin Baulig  <martin@ximian.com>
5943
5944         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5945
5946         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5947         (RootContext.LookupType): Pass down the `silent' flag.
5948
5949 2004-05-25  Martin Baulig  <martin@ximian.com>
5950
5951         * expression.cs
5952         (MethodGroupExpr.IdenticalTypeName): New public property.
5953         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
5954         expression actually refers to a type.
5955
5956 2004-05-25  Martin Baulig  <martin@ximian.com>
5957
5958         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
5959         for #56176 and made it actually work.
5960
5961 2004-05-25  Martin Baulig  <martin@ximian.com>
5962
5963         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
5964         (FieldExpr, PropertyExpr): Override and implement
5965         CacheTemporaries.  Fixes #52279.
5966
5967 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
5968
5969         * location.cs: In the new compiler listing a file twice is a
5970         warning, not an error.
5971
5972 2004-05-24  Martin Baulig  <martin@ximian.com>
5973
5974         * enum.cs (Enum.DefineType): For the `BaseType' to be a
5975         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
5976
5977 2004-05-24  Martin Baulig  <martin@ximian.com>
5978
5979         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
5980         walking the `using' list.  Fixes #53921.
5981
5982 2004-05-24  Martin Baulig  <martin@ximian.com>
5983
5984         * const.cs (Const.LookupConstantValue): Added support for
5985         EmptyCast's; fixes #55251.
5986
5987 2004-05-24  Martin Baulig  <martin@ximian.com>
5988
5989         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
5990         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
5991         which does the CS0135 check.  The reason is that we first need to
5992         check whether the variable actually exists.
5993
5994 2004-05-24  Martin Baulig  <martin@ximian.com>
5995
5996         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
5997         than RootContext.LookupType() to find the explicit interface
5998         type.  Fixes #58584.
5999
6000 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6001
6002         * Makefile: Simplify.  Use executable.make.
6003         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6004
6005 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6006
6007         * decl.cs:
6008         * enum.cs:
6009         Use the invariant culture when doing String.Compare for CLS case
6010         sensitivity.
6011         
6012 2004-05-23  Martin Baulig  <martin@ximian.com>
6013
6014         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6015         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6016
6017         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6018         
6019 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6020
6021         * class.cs (MemberBase.Define): Reuse MemberType member for 
6022         resolved type. Other methods can use it too.
6023
6024 2004-05-23  Martin Baulig  <martin@ximian.com>
6025
6026         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6027         the variable also exists in the current block (otherwise, we need
6028         to report a CS0103).  Fixes #58670.
6029
6030 2004-05-23  Martin Baulig  <martin@ximian.com>
6031
6032         * flowanalysis.cs (Reachability.Reachable): Compute this
6033         on-the-fly rather than storing it as a field.
6034
6035 2004-05-23  Martin Baulig  <martin@ximian.com>
6036
6037         * flowanalysis.cs (Reachability.And): Manually compute the
6038         resulting `barrier' from the reachability.      
6039        
6040 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6041
6042         Fix bug #57835
6043         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6044         instance of ObsoleteAttribute when symbol is obsolete.
6045
6046         * class.cs
6047         (IMethodData): Extended interface for ObsoleteAttribute support.
6048
6049 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6050
6051         * attribute.cs: Fix bug #55970
6052
6053 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6054
6055         Fix bug #52705
6056         * attribute.cs
6057         (GetObsoleteAttribute): New method. Creates the instance of
6058         ObsoleteAttribute.
6059         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6060         ObsoleteAttribute when member is obsolete.
6061         (AttributeTester.Report_ObsoleteMessage): Common method for
6062         Obsolete error/warning reporting.
6063
6064         * class.cs
6065         (TypeContainer.base_classs_type): New member for storing parent type.
6066
6067         * decl.cs
6068         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6069         for this MemberCore.
6070
6071 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6072
6073         * attribute.cs, const.cs: Fix bug #58590
6074
6075 2004-05-21  Martin Baulig  <martin@ximian.com>
6076
6077         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6078         out parameters if the end of the method is unreachable.  Fixes
6079         #58098. 
6080
6081 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6082
6083         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6084         Hari was right, why extra method.
6085
6086 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6087
6088         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6089
6090 2004-05-20  Martin Baulig  <martin@ximian.com>
6091
6092         Merged this back from gmcs to keep the differences to a minumum.
6093
6094         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6095         instead of a Declspace.
6096         (Attribute.ResolveType): Likewise.
6097         (Attributes.Search): Likewise.
6098         (Attributes.Contains): Likewise.
6099         (Attributes.GetClsCompliantAttribute): Likewise.
6100
6101         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6102         argument.
6103         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6104         DeclSpace.
6105
6106 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6107
6108         Fix bug #58688 (MCS does not report error when the same attribute
6109         is assigned twice)
6110
6111         * attribute.cs (Attribute.Emit): Distinction between null and default.
6112
6113 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6114
6115         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6116         of a top-level attribute without an attribute target.
6117         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6118         Make non-static.
6119         (Attribute.Conditional_GetConditionName), 
6120         (Attribute.Obsolete_GetObsoleteMessage): Update.
6121         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6122         part of ScanForIndexerName.
6123         (Attribute.CanIgnoreInvalidAttribute): New function.
6124         (Attribute.ScanForIndexerName): Move to ...
6125         (Attributes.ScanForIndexerName): ... here.
6126         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6127         (Attributes.Search): New internal variant that can choose not to
6128         complain if types aren't resolved.  The original signature now
6129         complains.
6130         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6131         complaints suppressed.
6132         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6133         only if it not useful.
6134         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6135         top-level for attributes that are shared between the assembly
6136         and a top-level class.
6137         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6138         * class.cs: Update to reflect changes.
6139         (DefineIndexers): Fuse loops.
6140         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6141         a couple more variants of attribute names.
6142
6143 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6144
6145         Fix bug #52585 (Implemented explicit attribute declaration)
6146
6147         * attribute.cs:
6148         (Attributable.ValidAttributeTargets): New abstract method. It gets
6149         list of valid attribute targets for explicit target declaration.
6150         (Attribute.Target): It holds target itself.
6151         (AttributeSection): Removed.
6152         (Attribute.CheckTargets): New method. It checks whether attribute
6153         target is valid for the current element.
6154
6155         * class.cs:
6156         (EventProperty): New class. For events that are declared like
6157         property (with add and remove accessors).
6158         (EventField): New class. For events that are declared like field.
6159         class.cs
6160
6161         * cs-parser.jay: Implemented explicit attribute target declaration.
6162
6163         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6164         Override ValidAttributeTargets.
6165
6166         * parameter.cs:
6167         (ReturnParameter): Class for applying custom attributes on 
6168         the return type.
6169         (ParameterAtribute): New class. Class for applying custom
6170         attributes on the parameter type.
6171
6172 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6173
6174         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6175         definitions. 
6176
6177         (Method): Allow UNSAFE here.
6178
6179         * modifiers.cs: Support unsafe reporting.
6180
6181 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6182
6183         * decl.cs: Fix bug #58478.
6184
6185 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6186
6187         * statement.cs: When checking for unreachable code on an EmptyStatement,
6188         set the location. Fixes bug #58488.
6189
6190 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6191
6192         * driver.cs: Add -pkg handling.
6193
6194         From Gonzalo: UseShelLExecute=false
6195
6196 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6197
6198         * attribute.cs:
6199         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6200         for attribute.
6201         (Attribute.IsClsCompliaceRequired): Moved to base for better
6202         accesibility.
6203         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6204         when attribute is AttributeUsageAttribute.
6205         (Attribute.GetValidTargets): Simplified.
6206         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6207         attribute for this type.
6208         (Attribute.ApplyAttributes): Method renamed to Emit and make
6209         non-static.
6210         (GlobalAttributeSection): New class for special handling of global
6211         attributes (assembly, module).
6212         (AttributeSection.Emit): New method.
6213
6214         * class.cs: Implemented Attributable abstract methods.
6215         (MethodCore.LabelParameters): Moved to Parameter class.
6216         (Accessor): Is back simple class.
6217         (PropertyMethod): Implemented Attributable abstract class.
6218         (DelegateMethod): Implemented Attributable abstract class.
6219         (Event): New constructor for disctintion between normal Event
6220         and Event with accessors.
6221
6222         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6223
6224         * codegen.cs, const.cs, decl.cs, delegate.cs:
6225         (CommonAssemblyModulClass): Implemented Attributable abstract class
6226         and simplified.
6227
6228         * enum.cs: Implement IAttributeSupport interface.
6229         (EnumMember): New class for emum members. Implemented Attributable
6230         abstract class
6231
6232         * parameter.cs:
6233         (ParameterBase): Is abstract.
6234         (ReturnParameter): New class for easier [return:] attribute handling.
6235
6236         * typemanager.cs: Removed builder_to_attr.
6237
6238 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6239
6240         Fix bug #57151.
6241         * attribute.cs (Attribute.GetPositionalValue): New function.
6242         * class.cs (TypeContainer.VerifyMembers): New function.
6243         (TypeContainer.Emit): Use it.
6244         (ClassOrStruct): New base class for Class and Struct.
6245         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6246         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6247         class.
6248         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6249         then each non-static field should have a FieldOffset attribute.
6250         Otherwise, none of the fields should have a FieldOffset attribute.
6251         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6252         and FieldOffset attributes.
6253         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6254         (TypeManager.field_offset_attribute_type): New core types.
6255         (TypeManager.InitCoreTypes): Initialize them.
6256
6257 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6258
6259         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6260         Return correct type.
6261         From bug #58270.
6262
6263 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6264
6265         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6266         be implicitly converted to ulong.
6267         
6268         * expression.cs: The logic for allowing operator &, | and ^ worked
6269         was wrong, it worked before because we did not report an error in
6270         an else branch.  Fixes 57895.
6271
6272         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6273         allow volatile fields to be reference types.
6274
6275 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6276
6277         * driver.cs: Add support for /debug-
6278
6279 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6280
6281         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6282         Add a 'complain' parameter to silence errors.
6283         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6284         silently overlooked type-resolutions.
6285         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6286         to reflect changes.
6287         (Attributes.Search): New function.
6288         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6289         (Attributes.GetAttributeFullName): Remove hack.
6290         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6291         Update to reflect changes.
6292         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6293         Use Attributes.Search instead of nested loops.
6294
6295 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6296
6297         * decl.cs:
6298         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6299         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6300         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6301
6302         * report.cs: (Report.Warning): Renamed to Warning_T because of
6303         parameter collision.
6304
6305 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6306
6307         * expression.cs (MemberAccess.ResolveMemberAccess):
6308         Exit with non-zero status after Report.Error.
6309         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6310         Likewise.
6311         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6312
6313 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6314
6315         * support.cs: Don't hang when the file is empty.
6316
6317 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6318
6319         * support.cs: In SeekableStreamReader, compute the preamble size of the
6320           underlying stream. Position changes should take into account that initial
6321           count of bytes.
6322
6323 2004-05-03  Todd Berman  <tberman@sevenl.net>
6324
6325         * driver.cs: remove unused GetSysVersion function.
6326
6327 2004-05-03  Todd Berman  <tberman@sevenl.net>
6328
6329         * driver.cs: Remove the hack from saturday, as well as the hack
6330         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6331         link_paths to get that bit proper.
6332
6333 2004-05-01  Todd Berman  <tberman@sevenl.net>
6334
6335         * driver.cs: Try a LoadFrom before a Load, this checks the current
6336         path. This is currently a bug in mono that is be fixed, however, this
6337         provides a workaround for now. This will be removed when the bug
6338         is fixed.
6339
6340 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6341
6342         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6343         incomplete key pairs (#57941).
6344
6345 2004-05-01  Todd Berman  <tberman@sevenl.net>
6346
6347         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6348         from the GAC
6349
6350 2004-04-30  Jackson Harper  <jackson@ximian.com>
6351
6352         * codegen.cs: Open keys readonly.
6353         
6354 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6355
6356         * typemanager.cs: don't report cyclic struct layout when a struct
6357         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6358         which has 2 Pango.Rectangle fields.
6359
6360 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6361
6362         * expression.cs: Handle IntPtr comparisons with IL code
6363         rather than a method call.
6364
6365 2004-04-29  Martin Baulig  <martin@ximian.com>
6366
6367         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6368         the list of PropertyInfo's in class hierarchy and find the
6369         accessor.  Fixes #56013.
6370
6371 2004-04-29  Martin Baulig  <martin@ximian.com>
6372
6373         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6374
6375 2004-04-29  Martin Baulig  <martin@ximian.com>
6376
6377         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6378
6379         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6380
6381 2004-04-29  Martin Baulig  <martin@ximian.com>
6382
6383         * class.cs (ConstructorInitializer.Resolve): Check whether the
6384         parent .ctor is accessible.  Fixes #52146.
6385
6386 2004-04-29  Martin Baulig  <martin@ximian.com>
6387
6388         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6389
6390         * statement.cs (Using.EmitLocalVariableDecls): Use
6391         TypeManager.idisposable_type, not typeof (IDisposable).
6392         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6393
6394 2004-04-29  Martin Baulig  <martin@ximian.com>
6395
6396         * class.cs (Event.Define): Don't emit the field and don't set
6397         RTSpecialName and SpecialName for events on interfaces.  Fixes
6398         #57703. 
6399
6400 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6401
6402         Refactor Attribute.ApplyAttributes.
6403         * attribute.cs (Attributable): New base class for objects that can
6404         have Attributes applied on them.
6405         (Attribute): Make AttributeUsage fields public.
6406         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6407         (Attribute.IsInternalCall): New property.
6408         (Attribute.UsageAttr): Convert to a public read-only property.
6409         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6410         (Attribute.ResolveType, Attribute.Resolve)
6411         (Attribute.ScanForIndexerName): Update to reflect changes.
6412         (Attribute.CheckAttributeTarget): Re-format.
6413         (Attribute.ApplyAttributes): Refactor, to various
6414         Attributable.ApplyAttributeBuilder methods.
6415         * decl.cs (MemberCore): Make Attributable.
6416         * class.cs (Accessor): Make Attributable.
6417         (MethodData.ApplyAttributes): Use proper attribute types, not
6418         attribute names.
6419         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6420         (TypeContainer.ApplyAttributeBuilder)
6421         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6422         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6423         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6424         (Operator.ApplyAttributeBuilder): New factored-out methods.
6425         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6426         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6427         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6428         * parameter.cs (ParameterBase): New Attributable base class
6429         that can also represent Return types.
6430         (Parameter): Update to the changes.
6431
6432 2004-04-29  Jackson Harper  <jackson@ximian.com>
6433
6434         * driver.cs: Prefer the corlib system version when looking for
6435         assemblies in the GAC. This is still a hack, but its a better hack
6436         now.
6437         
6438 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6439
6440         * decl.cs, enum.cs: Improved error 3005 reporting.
6441   
6442         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6443         (related_symbols): New private member for list of symbols
6444         related to reported error/warning.
6445         
6446         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6447
6448 2004-04-29  Martin Baulig  <martin@ximian.com>
6449
6450         * ecore.cs (Expression.Constantify): If we're an enum and
6451         TypeManager.TypeToCoreType() doesn't give us another type, use
6452         t.UnderlyingSystemType.  Fixes #56178.  
6453
6454 2004-04-29  Martin Baulig  <martin@ximian.com>
6455
6456         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6457         interfaces and for each interface, only add members directly
6458         declared in that interface.  Fixes #53255.
6459
6460 2004-04-28  Martin Baulig  <martin@ximian.com>
6461
6462         * expression.cs (ConditionalLogicalOperator): Use a temporary
6463         variable for `left' to avoid that we evaluate it more than once;
6464         bug #52588.
6465
6466 2004-04-28  Martin Baulig  <martin@ximian.com>
6467
6468         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6469         `void[]' (CS1547).
6470
6471 2004-04-28  Martin Baulig  <martin@ximian.com>
6472
6473         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6474         void (CS1547).
6475
6476         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6477         whether the type is not void (CS1547).
6478
6479 2004-04-28  Martin Baulig  <martin@ximian.com>
6480
6481         * expression.cs (Unary.DoResolveLValue): Override this and report
6482         CS0131 for anything but Operator.Indirection.
6483
6484 2004-04-28  Martin Baulig  <martin@ximian.com>
6485
6486         Committing a patch from Ben Maurer; see bug #50820.
6487
6488         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6489         check for classes.
6490
6491         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6492         classes.        
6493
6494 2004-04-28  Martin Baulig  <martin@ximian.com>
6495
6496         Committing a patch from Ben Maurer; see bug #50820.
6497
6498         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6499         check for classes.
6500
6501         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6502         classes.        
6503
6504 2004-04-28  Martin Baulig  <martin@ximian.com>
6505
6506         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6507         (Block.AddLabel): Call DoLookupLabel() to only search in the
6508         current block.
6509
6510 2004-04-28  Martin Baulig  <martin@ximian.com>
6511
6512         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6513         comparing StringConstants and NullLiterals in Equality and Inequality.
6514
6515 2004-04-28  Jackson Harper  <jackson@ximian.com>
6516
6517         * driver.cs: Attempt to load referenced assemblies from the
6518         GAC. This is the quick and dirty version of this method that
6519         doesnt take into account versions and just takes the first
6520         canidate found. Will be good enough for now as we will not have more
6521         then one version installed into the GAC until I update this method.
6522
6523 2004-04-28  Martin Baulig  <martin@ximian.com>
6524
6525         * typemanager.cs (TypeManager.CheckStructCycles): New public
6526         static method to check for cycles in the struct layout.
6527
6528         * rootcontext.cs (RootContext.PopulateTypes): Call
6529         TypeManager.CheckStructCycles() for each TypeContainer.
6530         [Note: We only need to visit each type once.]
6531
6532 2004-04-28  Martin Baulig  <martin@ximian.com>
6533
6534         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6535
6536         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6537         success and added `out object value'.  Use a `bool resolved' field
6538         to check whether we've already been called rather than
6539         `ConstantValue != null' since this breaks for NullLiterals.
6540
6541 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6542
6543         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6544         setting of this flag, since the 'set' method may be non-public.
6545
6546 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6547
6548         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6549         check on current_vector.Block.
6550
6551 2004-04-27  Martin Baulig  <martin@ximian.com>
6552
6553         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6554         a field initializer.  Fixes #56459.
6555
6556 2004-04-27  Martin Baulig  <martin@ximian.com>
6557
6558         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6559         we're not attempting to use an indexer.  Fixes #52154.
6560
6561 2004-04-27  Martin Baulig  <martin@ximian.com>
6562
6563         * statement.cs (Return): Don't create a return label if we don't
6564         need it; reverts my change from January 20th.  Thanks to Ben
6565         Maurer for this.
6566
6567 2004-04-27  Martin Baulig  <martin@ximian.com>
6568
6569         According to the spec, `goto' can only leave a nested scope, but
6570         never enter it.
6571
6572         * statement.cs (Block.LookupLabel): Only lookup in the current
6573         block, don't recurse into parent or child blocks.
6574         (Block.AddLabel): Check in parent and child blocks, report
6575         CS0140/CS0158 if we find a duplicate.
6576         (Block): Removed this indexer for label lookups.
6577         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6578         this already does the error reporting for us.
6579
6580         * flowanalysis.cs
6581         (FlowBranching.UsageVector.Block): New public variable; may be null.
6582         (FlowBranching.CreateSibling): Added `Block' argument.
6583         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6584         label for the target of a `goto' and check whether we're not
6585         leaving a `finally'.
6586
6587 2004-04-27  Martin Baulig  <martin@ximian.com>
6588
6589         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6590         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6591         just for returns).
6592
6593 2004-04-27  Martin Baulig  <martin@ximian.com>
6594
6595         * statement.cs (Block.AddLabel): Also check for implicit blocks
6596         and added a CS0158 check.
6597
6598 2004-04-27  Martin Baulig  <martin@ximian.com>
6599
6600         * flowanalysis.cs (FlowBranchingLoop): New class.
6601         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6602         UsageVector's instead of an ArrayList.
6603         (FlowBranching.Label): Likewise.
6604         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6605         (FlowBranching.AddBreakVector): New method.
6606
6607 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6608
6609         * attribute.cs: Small regression fix: only convert the type if we
6610         the type is different, fixes System.Drawing build.
6611
6612 2004-04-27  Martin Baulig  <martin@ximian.com>
6613
6614         * attribute.cs (Attribute.Resolve): If we have a constant value
6615         for a named field or property, implicity convert it to the correct
6616         type.
6617
6618 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6619
6620         * statement.cs (Block.Block): Implicit blocks share
6621         'child_variable_names' fields with parent blocks.
6622         (Block.AddChildVariableNames): Remove.
6623         (Block.AddVariable): Mark variable as "used by a child block" in
6624         every surrounding block.
6625         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6626         been used in a child block, complain about violation of "Invariant
6627         meaning in blocks" rule.
6628         * cs-parser.jay (declare_local_variables): Don't use
6629         AddChildVariableNames.
6630         (foreach_statement): Don't create an implicit block: 'foreach'
6631         introduces a scope.
6632
6633 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6634
6635         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6636         converting from 0L to ulong.  Fixes 57522.
6637
6638 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6639
6640         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6641         derived class hides via 'new' keyword field from base class (test-242.cs).
6642         TODO: Handle this in the more general way.
6643         
6644         * class.cs (CheckBase): Ditto.
6645
6646 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6647
6648         * decl.cs (caching_flags): New member for storing cached values
6649         as bit flags.
6650         (MemberCore.Flags): New enum where bit flags for caching_flags
6651         are defined.
6652         (MemberCore.cls_compliance): Moved to caching_flags.
6653         (DeclSpace.Created): Moved to caching_flags.
6654
6655         * class.cs: Use caching_flags instead of DeclSpace.Created
6656         
6657 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6658
6659         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6660         if we are only a derived class, not a nested class.
6661
6662         * typemanager.cs: Same as above, but do this at the MemberLookup
6663         level (used by field and methods, properties are handled in
6664         PropertyExpr).   Allow for the qualified access if we are a nested
6665         method. 
6666
6667 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6668
6669         * class.cs: Refactoring.
6670         (IMethodData): New inteface; Holds links to parent members
6671         to avoid member duplication (reduced memory allocation).
6672         (Method): Implemented IMethodData interface.
6673         (PropertyBase): New inner classes for get/set methods.
6674         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6675         (Event): New inner classes for add/remove methods.
6676         (Event.DelegateMethod): Implemented IMethodData interface.
6677
6678         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6679         EmitContext (related to class.cs refactoring).
6680
6681 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6682
6683         * delegate.cs (Delegate.VerifyApplicability): If the number of
6684         arguments are the same as the number of parameters, first try to
6685         verify applicability ignoring  any 'params' modifier on the last
6686         parameter.
6687         Fixes #56442.
6688
6689 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6690
6691         * class.cs (TypeContainer.AddIndexer): Use
6692         'ExplicitInterfaceName' to determine if interface name was
6693         explicitly specified.  'InterfaceType' is not initialized at this time.
6694         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6695         Indexers array is already in the required order.  Initialize
6696         'IndexerName' only if there are normal indexers.
6697         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6698         (TypeContainer.Emit): Emit DefaultMember attribute only if
6699         IndexerName is initialized.
6700         Fixes #56300.
6701
6702 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6703
6704         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6705         Fixes #57007
6706
6707 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6708
6709         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6710         attributes.
6711         Fix for #56456.
6712
6713         * attribute.cs (Attribute.Resolve): Check for duplicate named
6714         attributes.
6715         Fix for #56463.
6716
6717 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6718
6719         * iterators.cs (MarkYield): track whether we are in an exception,
6720         and generate code accordingly.  Use a temporary value to store the
6721         result for our state.
6722
6723         I had ignored a bit the interaction of try/catch with iterators
6724         since their behavior was not entirely obvious, but now it is
6725         possible to verify that our behavior is the same as MS .NET 2.0
6726
6727         Fixes 54814
6728
6729 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6730
6731         * iterators.cs: Avoid creating temporaries if there is no work to
6732         do. 
6733
6734         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6735         Enumerations, use TypeManager.EnumToUnderlying and call
6736         recursively. 
6737
6738         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6739         bug #57013
6740
6741         (This.Emit): Use EmitContext.EmitThis to emit our
6742         instance variable.
6743
6744         (This.EmitAssign): Ditto.
6745
6746         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6747         codepaths, we will move all the functionality into
6748         Mono.CSharp.This 
6749
6750         (FieldExpr.EmitAssign): Ditto.
6751
6752         This fixes several hidden bugs that I uncovered while doing a code
6753         review of this today.
6754
6755         * codegen.cs (EmitThis): reworked so the semantics are more clear
6756         and also support value types "this" instances.
6757
6758         * iterators.cs: Changed so that for iterators in value types, we
6759         do not pass the value type as a parameter.  
6760
6761         Initialization of the enumerator helpers is now done in the caller
6762         instead of passing the parameters to the constructors and having
6763         the constructor set the fields.
6764
6765         The fields have now `assembly' visibility instead of private.
6766
6767 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6768
6769         * expression.cs (Argument.Resolve): Check if fields passed as ref
6770         or out are contained in a MarshalByRefObject.
6771
6772         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6773         another compiler type.
6774
6775 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6776
6777         * class.cs (Indexer.Define): use the new name checking method.
6778         Also, return false on an error.
6779         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6780         (is_identifier_[start/part]_character): make static.
6781
6782 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6783
6784         * expression.cs (Binary.ResolveOperator): Do no append strings
6785         twice: since we can be invoked more than once (array evaluation)
6786         on the same concatenation, take care of this here.  Based on a fix
6787         from Ben (bug #56454)
6788
6789 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6790
6791         * codegen.cs: Fix another case where CS1548 must be reported (when 
6792         delay-sign isn't specified and no private is available #56564). Fix
6793         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6794         error when MCS is used on the MS runtime and we need to delay-sign 
6795         (which seems unsupported by AssemblyBuilder - see #56621).
6796
6797 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6798
6799         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6800         (TypeManager.ComputeNamespaces): Faster implementation for
6801         Microsoft runtime.
6802
6803         * compiler.csproj: Updated AssemblyName to mcs.
6804
6805 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6806
6807         * rootcontext.cs: Add new types to the boot resolution.
6808
6809         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6810         MulticastDelegate is not allowed.
6811
6812         * typemanager.cs: Add new types to lookup: System.TypedReference
6813         and ArgIterator.
6814
6815         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6816         check for TypedReference or ArgIterator, they are not allowed. 
6817
6818         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6819         makes us properly catch 1510 in some conditions (see bug 56016 for
6820         details). 
6821
6822 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6823
6824         * CryptoConvert.cs: update from corlib version
6825         with endian fixes.
6826
6827 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6828
6829         * class.cs (Indexer.Define): Check indexername declaration
6830
6831 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6832
6833         * attribute.cs (IsClsCompliant): Fixed problem with handling
6834         all three states (compliant, not-compliant, undetected).
6835
6836 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6837
6838         * attribute.cs (Attribute): Location is now public.
6839         (Resolve): Store resolved arguments (pos_values) in attribute class.
6840         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6841         (GetClsCompliantAttributeValue): New method that gets
6842         CLSCompliantAttribute value.
6843         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6844         if exists else null.
6845         (AttributeTester): New class for CLS-Compliant verification routines.
6846
6847         * class.cs (Emit): Add CLS-Compliant verification.
6848         (Method.GetSignatureForError): Implemented.
6849         (Constructor.GetSignatureForError): Implemented
6850         (Constructor.HasCompliantArgs): Returns if constructor has
6851         CLS-Compliant arguments.
6852         (Constructor.Emit): Override.
6853         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6854         is needed to test only parameters.
6855         (FieldBase.GetSignatureForError): Implemented.
6856         (TypeContainer): New member for storing base interfaces.
6857         (TypeContainer.FindMembers): Search in base interfaces too.
6858
6859         * codegen.cs (GetClsComplianceAttribute): New method that gets
6860         assembly or module CLSCompliantAttribute value.
6861         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
6862         for assembly.
6863         (ModuleClass.Emit): Add error 3012 test.
6864
6865         * const.cs (Emit): Override and call base for CLS-Compliant tests.
6866
6867         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
6868         state for all decl types.
6869         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
6870         if CLS-Compliant tests are required.
6871         (IsClsCompliaceRequired): New method. Analyze whether code
6872         must be CLS-Compliant.
6873         (IsExposedFromAssembly): New method. Returns true when MemberCore
6874         is exposed from assembly.
6875         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
6876         value or gets cached value.
6877         (HasClsCompliantAttribute): New method. Returns true if MemberCore
6878         is explicitly marked with CLSCompliantAttribute.
6879         (IsIdentifierClsCompliant): New abstract method. This method is
6880         used to testing error 3005.
6881         (IsIdentifierAndParamClsCompliant): New method. Common helper method
6882         for identifier and parameters CLS-Compliant testing.
6883         (VerifyClsCompliance): New method. The main virtual method for
6884         CLS-Compliant verifications.
6885         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6886         null. I don't know why is null (too many public members !).
6887         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6888         and get value of first CLSCompliantAttribute that found.
6889
6890         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6891         (VerifyClsCompliance): Override and add extra tests.
6892
6893         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6894         clscheck- disable CLS-Compliant verification event if assembly is has
6895         CLSCompliantAttribute(true).
6896
6897         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6898         ApllyAttribute is now called in emit section as in the other cases.
6899         Possible future Emit integration.
6900         (IsIdentifierClsCompliant): New override.
6901         (VerifyClsCompliance): New override.
6902         (GetEnumeratorName): Returns full enum name.
6903
6904         * parameter.cs (GetSignatureForError): Implemented.
6905
6906         * report.cs (WarningData): New struct for Warning message information.
6907         (LocationOfPreviousError): New method.
6908         (Warning): New method. Reports warning based on the warning table.
6909         (Error_T): New method. Reports error based on the error table.
6910
6911         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
6912         verifications are done here.
6913
6914         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
6915
6916         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
6917         CLSCompliantAttribute.
6918         (all_imported_types): New member holds all imported types from other
6919         assemblies.
6920         (LoadAllImportedTypes): New method fills static table with exported types
6921         from all referenced assemblies.
6922         (Modules): New property returns all assembly modules.
6923
6924 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
6925
6926         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
6927         throwing a parser error.
6928
6929         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
6930         which removes the hardcoded get_/set_ prefixes for properties, as
6931         IL allows for the properties to be named something else.  
6932
6933         Bug #56013
6934
6935         * expression.cs: Do not override operand before we know if it is
6936         non-null.  Fix 56207
6937
6938 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6939
6940         * typemanager.cs: support for pinned variables.
6941
6942 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6943
6944         * decl.cs, typemanager.cs: Avoid using an arraylist
6945         as a buffer if there is only one result set.
6946
6947 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6948
6949         * expression.cs: Make sure you cant call a static method
6950         with an instance expression, bug #56174.
6951
6952 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
6953
6954         * class.cs (IsDuplicateImplementation): Improve error reporting to
6955         flag 663 (method only differs in parameter modifier).
6956
6957         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
6958         in preprocessor directives.
6959
6960         * location.cs (LookupFile): Allow for the empty path.
6961
6962         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
6963         better approach for some of that patch, but its failing with the
6964         CharSet enumeration.  For now try/catch will do.
6965
6966         * typemanager.cs: Do not crash if a struct does not have fields.
6967         Fixes 56150.
6968
6969 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6970
6971         * expression.cs: cs0213, cant fix a fixed expression.
6972         fixes 50231.
6973
6974 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6975
6976         * cs-parser.jay: detect invalid embeded statements gracefully.
6977         bug #51113.
6978
6979 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6980
6981         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
6982         As a regex:
6983         s/
6984         the invocation type may not be a subclass of the tye of the item/
6985         The type of the item must be a subclass of the invocation item.
6986         /g
6987
6988         Fixes bug #50820.
6989
6990 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
6991
6992         * attribute.cs: Added methods to get a string and a bool from an
6993         attribute. Required to information from AssemblyKeyFileAttribute,
6994         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
6995         * codegen.cs: Modified AssemblyName creation to include support for
6996         strongnames. Catch additional exceptions to report them as CS1548.
6997         * compiler.csproj: Updated include CryptoConvert.cs.
6998         * compiler.csproj.user: Removed file - user specific configuration.
6999         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7000         Mono.Security assembly. The original class is maintained and tested in
7001         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7002         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7003         like CSC 8.0 (C# v2) supports.
7004         * Makefile: Added CryptoConvert.cs to mcs sources.
7005         * rootcontext.cs: Added new options for strongnames.
7006
7007 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7008
7009         * driver.cs: For --expect-error, report error code `2'
7010         if the program compiled with no errors, error code `1' if
7011         it compiled with an error other than the one expected.
7012
7013 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7014
7015         * compiler.csproj: Updated for Visual Studio .NET 2003.
7016         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7017         * compiler.sln: Updated for Visual Studio .NET 2003.
7018
7019 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7020
7021         * expression.cs: Fix bug #47234. We basically need to apply the
7022         rule that we prefer the conversion of null to a reference type
7023         when faced with a conversion to 'object' (csc behaviour).
7024
7025 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7026
7027         * statement.cs: Shorter form for foreach, eliminates
7028         a local variable. r=Martin.
7029
7030 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7031
7032         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7033         checks if we can use brtrue/brfalse to test for 0.
7034         * expression.cs: use the above in the test for using brtrue/brfalse.
7035         cleanup code a bit.
7036
7037 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7038
7039         * expression.cs: Rewrite string concat stuff. Benefits:
7040
7041         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7042         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7043         rather than a concat chain.
7044
7045         * typemanager.cs: Add lookups for more concat overloads.
7046
7047 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7048
7049         * expression.cs: Emit shorter il code for array init.
7050
7051         newarr
7052         dup
7053         // set 1
7054
7055         // set 2
7056
7057         newarr
7058         stloc.x
7059
7060         ldloc.x
7061         // set 1
7062
7063         ldloc.x
7064         // set 2
7065
7066 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7067
7068         * statement.cs: Before, two switch blocks would be merged if the
7069         total size of the blocks (end_item - begin_item + 1) was less than
7070         two times the combined sizes of the blocks.
7071
7072         Now, it will only merge if after the merge at least half of the
7073         slots are filled.
7074
7075         fixes 55885.
7076
7077 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7078
7079         * class.cs : csc build fix for GetMethods(). See bug #52503.
7080
7081 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7082
7083         * expression.cs: Make sure fp comparisons work with NaN.
7084         This fixes bug #54303. Mig approved this patch a long
7085         time ago, but we were not able to test b/c the runtime
7086         had a related bug.
7087
7088 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7089
7090         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7091
7092 2004-03-19  Martin Baulig  <martin@ximian.com>
7093
7094         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7095         error here and not in our caller.
7096
7097 2004-03-19  Martin Baulig  <martin@ximian.com>
7098
7099         * interface.cs: Completely killed this file.
7100         (Interface): We're now a TypeContainer and live in class.cs.
7101
7102         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7103         argument; we're now also called for interfaces.
7104         (TypeContainer.DefineMembers): Allow this method being called
7105         multiple times.
7106         (TypeContainer.GetMethods): New public method; formerly known as
7107         Interface.GetMethod().  This is used by PendingImplementation.
7108         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7109         it's now private and non-static.
7110         (Interface): Moved this here; it's now implemented similar to
7111         Class and Struct.
7112         (Method, Property, Event, Indexer): Added `bool is_interface'
7113         argument to their .ctor's.
7114         (MemberBase.IsInterface): New public field.
7115
7116         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7117         instances instead of InterfaceMethod, InterfaceProperty, etc.
7118         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7119         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7120
7121 2004-03-19  Martin Baulig  <martin@ximian.com>
7122
7123         * class.cs (MethodCore.IsDuplicateImplementation): New private
7124         method which does the CS0111 checking.
7125         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7126         Use IsDuplicateImplementation().
7127
7128 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7129
7130         * decl.cs (FindMemberToOverride): New method to find the correct
7131         method or property to override in the base class.
7132         * class.cs
7133             - Make Method/Property use the above method to find the
7134               version in the base class.
7135             - Remove the InheritableMemberSignatureCompare as it is now
7136               dead code.
7137
7138         This patch makes large code bases much faster to compile, as it is
7139         O(n) rather than O(n^2) to do this validation.
7140
7141         Also, it fixes bug 52458 which is that nested classes are not
7142         taken into account when finding the base class member.
7143
7144         Reviewed/Approved by Martin.
7145
7146 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7147
7148         * interface.cs: In all interface classes removed redundant
7149         member initialization.
7150
7151 2004-03-16  Martin Baulig  <martin@ximian.com>
7152
7153         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7154
7155 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7156
7157         * decl.cs (DefineTypeAndParents): New helper method to define a
7158         type's containers before the type itself is defined;  This is a
7159         bug exposed by the recent changes to Windows.Forms when an
7160         implemented interface was defined inside a class that had not been
7161         built yet.   
7162
7163         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7164
7165         (Check): Loop correctly to report errors modifiers
7166         (UNSAFE was not in the loop, since it was the same as TOP).
7167
7168         * interface.cs: Every interface member now takes a ModFlags,
7169         instead of a "is_new" bool, which we set on the base MemberCore. 
7170
7171         Every place where we called "UnsafeOk" in the interface, now we
7172         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7173         the unsafe settings from the member declaration instead of the
7174         container interface. 
7175
7176         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7177
7178         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7179         `set_indexer_name' to the pending bits (one per type).
7180
7181         We fixed a bug today that was picking the wrong method to
7182         override, since for properties the existing InterfaceMethod code
7183         basically ignored the method name.  Now we make sure that the
7184         method name is one of the valid indexer names.
7185
7186 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7187  
7188         * support.cs (SeekableStreamReader): Keep track of stream byte
7189         positions and don't mix them with character offsets to the buffer.
7190
7191         Patch from Gustavo Giráldez
7192
7193 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7194
7195         * interface.cs (InterfaceSetGetBase): Removed double member
7196         initialization, base class does it as well.
7197
7198 2004-03-13  Martin Baulig  <martin@ximian.com>
7199
7200         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7201         when compiling corlib.
7202
7203 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7204
7205         * convert.cs (ExplicitConversion): We were reporting an error on
7206         certain conversions (object_type source to a value type, when the
7207         expression was `null') before we had a chance to pass it through
7208         the user defined conversions.
7209
7210         * driver.cs: Replace / and \ in resource specifications to dots.
7211         Fixes 50752
7212
7213         * class.cs: Add check for duplicate operators.  Fixes 52477
7214
7215 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7216
7217         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7218         that are in the middle of the statements, not only at the end.
7219         Fixes #54987
7220
7221         * class.cs (TypeContainer.AddField): No longer set the
7222         `HaveStaticConstructor' flag, now we call it
7223         `UserDefineStaticConstructor' to diferentiate the slightly
7224         semantic difference.
7225
7226         The situation is that we were not adding BeforeFieldInit (from
7227         Modifiers.TypeAttr) to classes that could have it.
7228         BeforeFieldInit should be set to classes that have no static
7229         constructor. 
7230
7231         See:
7232
7233         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7234
7235         And most importantly Zoltan's comment:
7236
7237         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7238
7239         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7240          before its static fields are used', i.e. initialization does not need
7241          to be triggered by the first access to the type. Setting this flag
7242          helps the JIT to compile better code, since it can run the static
7243          constructor at JIT time, and does not need to generate code to call it
7244          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7245          this flag for lots of classes like String. 
7246          
7247          csc sets this flag if the type does not have an explicit static 
7248          constructor. The reasoning seems to be that if there are only static
7249          initalizers for a type, and no static constructor, then the programmer
7250          does not care when this initialization happens, so beforefieldinit
7251          can be used.
7252          
7253          This bug prevents the AOT compiler from being usable, since it 
7254          generates so many calls to mono_runtime_class_init that the AOT code
7255          is much slower than the JITted code. The JITted code is faster, 
7256          because it does not generate these calls if the vtable is type is
7257          already initialized, which is true in the majority of cases. But the
7258          AOT compiler can't do this."
7259
7260 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7261
7262         * class.cs (MethodData.Emit): Refactor the code so symbolic
7263         information is generated for destructors;  For some reasons we
7264         were taking a code path that did not generate symbolic information
7265         before. 
7266
7267 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7268
7269         * class.cs: Create a Constructor.CheckBase method that
7270         takes care of all validation type code. The method
7271         contains some code that was moved from Define.
7272
7273         It also includes new code that checks for duplicate ctors.
7274         This fixes bug #55148.
7275
7276 2004-03-09  Joshua Tauberer <tauberer@for.net>
7277
7278         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7279         a { ... }-style array creation invokes EmitStaticInitializers
7280         which is not good for reference-type arrays.  String, decimal
7281         and now null constants (NullCast) are not counted toward
7282         static initializers.
7283
7284 2004-03-05  Martin Baulig  <martin@ximian.com>
7285
7286         * location.cs (SourceFile.HasLineDirective): New public field;
7287         specifies whether the file contains or is referenced by a "#line"
7288         directive.
7289         (Location.DefineSymbolDocuments): Ignore source files which
7290         either contain or are referenced by a "#line" directive.        
7291
7292 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7293
7294         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7295         direct access to our parent, so check the method inline there.
7296
7297 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7298
7299         * expression.cs (Invocation.EmitCall): Miguel's last commit
7300         caused a regression. If you had:
7301
7302             T t = null;
7303             t.Foo ();
7304
7305         In Foo the implict this would be null.
7306
7307 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7308
7309         * expression.cs (Invocation.EmitCall): If the method is not
7310         virtual, do not emit a CallVirt to it, use Call.
7311
7312         * typemanager.cs (GetFullNameSignature): Improve the method to
7313         cope with ".ctor" and replace it with the type name.
7314
7315         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7316         as an argument the ConstructorBuilder where it is being defined,
7317         to catch the recursive constructor invocations.
7318
7319 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7320
7321         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7322         routines to check if a type is an enumerable/enumerator allow
7323         classes that implement the IEnumerable or IEnumerator interfaces.
7324
7325         * class.cs (Property, Operator): Implement IIteratorContainer, and
7326         implement SetYields.
7327
7328         (Property.Define): Do the block swapping for get_methods in the
7329         context of iterators.   We need to check if Properties also
7330         include indexers or not.
7331
7332         (Operator): Assign the Block before invoking the
7333         OperatorMethod.Define, so we can trigger the Iterator code
7334         replacement. 
7335
7336         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7337         Property and Operator classes are not created when we parse the
7338         declarator but until we have the block completed, so we use a
7339         singleton SimpleIteratorContainer.Simple to flag whether the
7340         SetYields has been invoked.
7341
7342         We propagate this setting then to the Property or the Operator to
7343         allow the `yield' to function.
7344
7345 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7346
7347         * codegen.cs: Implemented attribute support for modules.
7348         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7349         Assembly/Module functionality.
7350
7351         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7352         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7353         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7354
7355 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7356
7357         * interface.cs (FindMembers): The operation is performed on all base
7358         interfaces and not only on the first. It is required for future CLS Compliance patch.
7359
7360 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7361
7362         * statement.cs, codegen.cs:
7363         This patch deals with patterns such as:
7364
7365         public class List : IEnumerable {
7366
7367                 public MyEnumerator GetEnumerator () {
7368                         return new MyEnumerator(this);
7369                 }
7370
7371                 IEnumerator IEnumerable.GetEnumerator () {
7372                         ...
7373                 }
7374                 
7375                 public struct MyEnumerator : IEnumerator {
7376                         ...
7377                 }
7378         }
7379
7380         Before, there were a few things we did wrong:
7381         1) we would emit callvirt on a struct, which is illegal
7382         2) we emited ldarg when we needed to emit ldarga
7383         3) we would mistakenly call the interface methods on an enumerator
7384         type that derived from IEnumerator and was in another assembly. For example:
7385
7386         public class MyEnumerator : IEnumerator
7387
7388         Would have the interface methods called, even if there were public impls of the
7389         method. In a struct, this lead to invalid IL code.
7390
7391 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7392
7393         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7394           renamed to Emit.
7395
7396         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7397
7398 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7399
7400         * cs-parser.jay: Fix small regression: we were not testing V2
7401         compiler features correctly.
7402
7403         * interface.cs: If the emit context is null, then create one
7404
7405 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7406
7407         * decl.cs (GetSignatureForError): New virtual method to get full name
7408           for error messages.
7409
7410         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7411           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7412
7413         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7414           Duplicated members and code in these classes has been removed.
7415           Better encapsulation in these classes.
7416
7417 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7418
7419         * assign.cs (Assign.DoResolve): When dealing with compound
7420         assignments, there is a new rule in ECMA C# 2.4 (might have been
7421         there before, but it is documented here) that states that in:
7422
7423         a op= b;
7424
7425         If b is of type int, and the `op' is a shift-operator, then the
7426         above is evaluated as:
7427
7428         a = (int) a op b 
7429
7430         * expression.cs (Binary.ResolveOperator): Instead of testing for
7431         int/uint/long/ulong, try to implicitly convert to any of those
7432         types and use that in pointer arithmetic.
7433
7434         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7435         method to print information for from the type, not from the
7436         null-method we were given.
7437
7438 2004-02-01  Duncan Mak  <duncan@ximian.com>
7439
7440         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7441         parsing for cmd, fixes bug #53694.
7442
7443 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7444
7445         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7446         in the member name duplication tests. Property and operator name duplication
7447         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7448
7449 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7450
7451         * interface.cs (PopulateMethod): Fixed crash when interface method
7452         returns not existing type (error test cs0246-3.cs).
7453
7454 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7455
7456         * cs-parser.jay (interface_accessors): Re-write actions to also
7457         store attributes attached to get and set methods. Fix spelling
7458         while at it.
7459
7460         (inteface_property_declaration): Modify accordingly.
7461
7462         (InterfaceAccessorInfo): New helper class to store information to pass
7463         around between rules that use interface_accessors.
7464
7465         * interface.cs (Emit): Apply attributes on the get and set
7466         accessors of properties and indexers too.
7467
7468         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7469         right MethodBuilder when applying attributes to the get and set accessors.
7470
7471 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7472
7473         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7474
7475 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7476
7477         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7478
7479 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7480
7481         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7482         changes that treat `yield' specially when present before `break'
7483         or `return' tokens.
7484
7485         * cs-tokenizer.cs: yield is no longer a keyword.
7486
7487 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7488
7489         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7490         setting for default constructors.
7491         For default constructors are almost every time set wrong Modifier. The
7492         generated IL code has been alright. But inside mcs this values was
7493         wrong and this was reason why several of my CLS Compliance tests
7494         failed.
7495
7496 2004-01-22  Martin Baulig  <martin@ximian.com>
7497
7498         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7499         not a QualifiedIdentifier.  This is what `type_name_expression'
7500         was previously doing.
7501         (type_name_expression): Removed; the code is now in
7502         `namespace_or_type_name'.
7503         (qualified_identifier): Removed, use `namespace_or_type_name'
7504         instead.
7505         (QualifiedIdentifier): Removed this class.      
7506
7507 2004-01-22  Martin Baulig  <martin@ximian.com>
7508
7509         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7510         not a string as alias name.
7511
7512 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7513
7514         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7515         #52730 bug, and instead compute correctly the need to use a
7516         temporary variable when requesting an address based on the
7517         static/instace modified of the field and the constructor.
7518  
7519 2004-01-21  Martin Baulig  <martin@ximian.com>
7520
7521         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7522         class and namespace before looking up aliases.  Fixes #52517.
7523
7524 2004-01-21  Martin Baulig  <martin@ximian.com>
7525
7526         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7527         assinged in a 'try'; fixes exception4.cs.
7528
7529 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7530         * class.cs : Implemented parameter-less constructor for TypeContainer
7531
7532         * decl.cs: Attributes are now stored here. New property OptAttributes
7533
7534         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7535
7536         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7537
7538 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7539
7540         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7541           (CSharpSignature): New method for indexer and property signature.
7542
7543 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7544
7545         * pending.cs (IsVirtualFilter): Faster implementation.
7546
7547 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7548
7549         * typemanager.cs: Avoid inclusion of same assembly more than once.
7550
7551 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7552
7553         * cs-parser.jay: Fixed problem where the last assembly attribute
7554           has been applied also to following declaration (class, struct, etc.)
7555           
7556 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7557
7558         * class.cs: Added error CS0538, CS0539 reporting.
7559         Fixed crash on Microsoft runtime when field type is void.
7560
7561         * cs-parser.jay: Added error CS0537 reporting.
7562
7563         * pending.cs: Added error CS0535 reporting.
7564         Improved error report for errors CS0536, CS0534.
7565
7566 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7567
7568         Merge a few bits from the Anonymous Method MCS tree.
7569
7570         * statement.cs (ToplevelBlock): New class for toplevel methods,
7571         will hold anonymous methods, lifted variables.
7572
7573         * cs-parser.jay: Create toplevel blocks for delegates and for
7574         regular blocks of code. 
7575
7576 2004-01-20  Martin Baulig  <martin@ximian.com>
7577
7578         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7579         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7580         and `NeedExplicitReturn'; added `IsLastStatement'.
7581         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7582         have a `ReturnLabel' or we're not unreachable.
7583
7584         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7585         child's reachability; don't just override ours with it.  Fixes
7586         #58058 (lluis's example).
7587         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7588         InFinally(), InLoop(), InSwitch() and
7589         BreakCrossesTryCatchBoundary() methods.
7590
7591         * statement.cs (Return): Do all error checking in Resolve().
7592         Unless we are the last statement in a top-level block, always
7593         create a return label and jump to it.
7594         (Break, Continue): Do all error checking in Resolve(); also make
7595         sure we aren't leaving a `finally'.
7596         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7597         statement in a top-level block.
7598         (Block.Flags): Added `IsDestructor'.
7599         (Block.IsDestructor): New public property.
7600
7601 2004-01-20  Martin Baulig  <martin@ximian.com>
7602
7603         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7604
7605 2004-01-20  Martin Baulig  <martin@ximian.com>
7606
7607         * statement.cs (Statement.ResolveUnreachable): New public method.
7608         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7609         (Block.Resolve): Resolve unreachable statements.
7610
7611 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7612
7613         * expression.cs: We need to fix the case where we do
7614         not have a temp variable here.
7615
7616         * assign.cs: Only expression compound assignments need
7617         temporary variables.
7618
7619 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7620
7621         * flowanalysis.cs: Reduce memory allocation in a few ways:
7622           - A block with no variables should not allocate a bit
7623             vector for itself.
7624           - A method with no out parameters does not need any tracking
7625             for assignment of the parameters, so we need not allocate
7626             any data for it.
7627           - The arrays:
7628                 public readonly Type[] VariableTypes;
7629                 public readonly string[] VariableNames;
7630             Are redundant. The data is already stored in the variable
7631             map, so we need not allocate another array for it.
7632           - We need to add alot of checks for if (params | locals) == null
7633             due to the first two changes.
7634
7635 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7636
7637         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7638         implement IMemoryLocation, we store a copy on a local variable and
7639         take the address of it.  Patch from Benjamin Jemlich
7640
7641         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7642         to use a special "type_name_expression" rule which reduces the
7643         number of "QualifiedIdentifier" classes created, and instead
7644         directly creates MemberAccess expressions.
7645
7646 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7647
7648         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7649         that fixes #52853.  Null literal assignment to ValueType
7650
7651         * class.cs (MethodData.Emit): Instead of checking the name of the
7652         method to determine if its a destructor, create a new derived
7653         class from Method called Destructor, and test for that.  
7654
7655         * cs-parser.jay: Create a Destructor object instead of a Method.  
7656
7657         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7658
7659         Fixes: 52933
7660
7661 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7662
7663         * expression.cs (Binary.ResolveOperator): Perform an implicit
7664         conversion from MethodGroups to their delegate types on the
7665         Addition operation.
7666
7667         * delegate.cs: Introduce a new class DelegateCreation that is the
7668         base class for `NewDelegate' and `ImplicitDelegateCreation',
7669         factor some code in here.
7670
7671         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7672         conversion from MethodGroups to compatible delegate types. 
7673
7674         * ecore.cs (Expression.Resolve): Do not flag error 654
7675         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7676         we allow conversions from MethodGroups to delegate types now.
7677
7678         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7679         assignments in v2 either.
7680
7681 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7682
7683         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7684         static read-only fields in ctors.
7685
7686         Applied patch from Benjamin Jemlich 
7687
7688         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7689
7690 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7691
7692         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7693         here to return true, as they can be used like this:
7694
7695                 (XXX) int.MEMBER ()
7696
7697         Fixed 49836 and all the other dups
7698
7699 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7700
7701         * driver.cs: Implement /win32res and /win32icon.
7702
7703 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7704
7705         * cs-parser.jay: Add a rule to improve error handling for the
7706         common mistake of placing modifiers after the type.
7707
7708 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7709
7710         * cs-parser.jay (interface_event_declaration): Catch
7711         initialization of events on interfaces, and report cs0068
7712
7713         * cs-parser.jay (interface_event_declaration): Catch
7714         initialization of events. 
7715
7716         * ecore.cs: Better report missing constructors.
7717
7718         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7719         the error reporting done in the wrong place.  Fix.
7720
7721         * expression.cs (Binary.ResolveOperator): Catch the 
7722         operator + (E x, E y) error earlier, and later allow for implicit
7723         conversions in operator +/- (E e, U x) from U to the underlying
7724         type of E.
7725
7726         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7727         52596, if the container class is abstract, the default constructor
7728         is protected otherwise its public (before, we were always public).
7729
7730         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7731         fixed statement.
7732
7733         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7734         Jemlich that fixes bug #52597, MCS was generating invalid code for
7735         idisposable structs.   Thanks to Ben for following up with this
7736         bug as well.
7737
7738 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7739
7740         * driver.cs: Allow assemblies without code to be generated, fixes
7741         52230.
7742
7743 2004-01-07  Nick Drochak <ndrochak@gol.com>
7744
7745         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7746
7747 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7748
7749         * cs-parser.jay: Add rules to improve error reporting if fields or
7750         methods are declared at the namespace level (error 116)
7751
7752         * Add rules to catch event add/remove
7753
7754 2004-01-04  David Sheldon <dave-mono@earth.li>
7755
7756   * expression.cs: Added matching ")" to error message for 
7757   CS0077
7758
7759 2004-01-03 Todd Berman <tberman@gentoo.org>
7760
7761         * ecore.cs, attribute.cs:
7762         Applying fix from #52429.
7763
7764 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7765
7766         * ecore.cs, expression.cs, statement.cs:
7767         Total rewrite of how we handle branching. We
7768         now handle complex boolean expressions with fewer
7769         jumps. As well if (x == 0) no longer emits a ceq.
7770
7771         if (x is Foo) is much faster now, because we generate
7772         better code.
7773
7774         Overall, we get a pretty big improvement on our benchmark
7775         tests. The code we generate is smaller and more readable.
7776
7777         I did a full two-stage bootstrap. The patch was reviewed
7778         by Martin and Miguel.
7779
7780 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7781
7782         * cs-parser.jay: Make primary_expression not take a QI.
7783         we dont need this because the member_access rule covers
7784         us here. So we replace the rule with just IDENTIFIER.
7785
7786         This has two good effects. First, we remove a s/r conflict.
7787         Second, we allocate many fewer QualifiedIdentifier objects.
7788
7789 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7790
7791         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7792         set the correct information via SRE. This prevents
7793         hanging on the MS runtime. Fixes #29374.
7794
7795 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7796
7797         * convert.cs: correctly handle conversions to value types
7798         from Enum and ValueType as unboxing conversions.
7799
7800         Fixes bug #52569. Patch by Benjamin Jemlich.
7801
7802 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7803
7804         * expression.cs (BetterConversion): Prefer int -> uint
7805         over int -> ulong (csc's behaviour). This fixed bug #52046.
7806
7807 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7808
7809         * decl.cs (MemberCache.FindMembers): now returns a
7810         MemberInfo [].
7811
7812         * typemanager.cs: In general, go with with ^^.
7813         (CopyNewMethods): take an IList.
7814         (RealMemberLookup): Only allocate an arraylist
7815         if we copy from two sets of methods.
7816
7817         This change basically does two things:
7818         1) Fewer array lists allocated due to CopyNewMethods.
7819         2) the explicit cast in MemberList costed ALOT.
7820
7821 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7822
7823         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7824         a hashtable to avoid needless string allocations when an identifier is
7825         used more than once (the common case).
7826
7827 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7828
7829         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7830         is broken, it will not return anything. So, we
7831         have to use the information we have in mcs to
7832         do the task.
7833
7834         * typemanager.cs: Add a cache for GetInterfaces,
7835         since this will now be used more often (due to ^^)
7836
7837         (GetExplicitInterfaces) New method that gets the
7838         declared, not effective, interfaces on a type
7839         builder (eg, if you have interface IFoo, interface
7840         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
7841         { IBar }.
7842
7843         This patch makes MCS able to bootstrap itself on
7844         Windows again.
7845
7846 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7847
7848         * expression.cs: Remove the Nop's that Miguel put
7849         in by mistake.
7850
7851 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7852
7853         * report.cs, codegen.cs: Give the real stack trace to
7854         the error when an exception is thrown.
7855
7856 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7857
7858         * decl.cs: only allocate hashtables for ifaces if 
7859         it is an iface!
7860
7861 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7862
7863         * expression.cs: fix the error from cs0121-2.cs
7864         (a parent interface has two child interfaces that
7865         have a function with the same name and 0 params
7866         and the function is called through the parent).
7867
7868 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7869
7870         * class.cs, rootcontext.cs, typmanager.cs: do not
7871         leak pointers.
7872
7873 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7874
7875         * codegen.cs: remove stack for the ec flow branching.
7876         It is already a linked list, so no need.
7877
7878 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7879
7880         * Makefile: Allow custom profiler here.
7881
7882 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7883
7884         * typemanager.cs (LookupType):
7885           - Use a static char [], because split takes
7886             a param array for args, so it was allocating
7887             every time.
7888           - Do not store true in a hashtable, it boxes.
7889
7890 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7891
7892         * flowanalysis.cs: bytify common enums.
7893
7894 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7895
7896         * modifiers.cs: Add a new set of flags for the
7897         flags allowed on explicit interface impls.
7898         * cs-parser.jay: catch the use of modifiers in
7899         interfaces correctly.
7900         * class.cs: catch private void IFoo.Blah ().
7901
7902         All related to bug #50572.
7903
7904 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7905
7906         * decl.cs: Rewrite the consistant accessability checking.
7907         Accessability is not linear, it must be implemented in
7908         a tableish way. Fixes #49704.
7909
7910 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7911
7912         * expression.cs: Handle negation in a checked context.
7913         We must use subtraction from zero. Fixes #38674.
7914
7915 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7916
7917         * class.cs: Ignore static void main in DLLs.
7918         * rootcontext.cs: Handle the target type here,
7919         since we are have to access it from class.cs
7920         * driver.cs: account for the above.
7921
7922 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7923
7924         * report.cs: Give line numbers and files if available.
7925
7926 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
7927
7928         * driver.cs: Implement /addmodule.
7929
7930         * typemanager.cs:  Change 'modules' field so it now contains Modules not
7931         ModuleBuilders.
7932
7933 2003-12-20  Martin Baulig  <martin@ximian.com>
7934
7935         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
7936         (FieldBase.IsAssigned): Removed this field.
7937         (FieldBase.SetAssigned): New public method.
7938         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
7939
7940 2003-12-20  Martin Baulig  <martin@ximian.com>
7941
7942         * expression.cs (LocalVariableReference.DoResolve): Don't set
7943         `vi.Used' if we're called from DoResolveLValue().
7944
7945         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
7946         returns the usage vector it just merged into the current one -
7947         pass this one to UsageWarning().
7948         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
7949         of the `EmitContext', don't call this recursively on our children.
7950
7951 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
7952
7953         * driver.cs: Implement /target:module.
7954
7955 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
7956
7957         * support.cs (CharArrayHashtable): New helper class.
7958
7959         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
7960         char arrays, not strings, so we can avoid creating a string in
7961         consume_identifier if the identifier is a keyword.
7962
7963 2003-12-16  Martin Baulig  <martin@ximian.com>
7964
7965         * statement.cs (LocalInfo.Assigned): Removed this property.
7966         (LocalInfo.Flags): Removed `Assigned'.
7967         (LocalInfo.IsAssigned): New public method; takes the EmitContext
7968         and uses flow analysis.
7969         (Block.UsageWarning): Made this method private.
7970         (Block.Resolve): Call UsageWarning() if appropriate.
7971
7972         * expression.cs (LocalVariableReference.DoResolve): Always set
7973         LocalInfo.Used here.
7974
7975 2003-12-13  Martin Baulig  <martin@ximian.com>
7976
7977         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
7978         any value here; we're now using flow analysis to figure out
7979         whether a statement/block returns a value.
7980
7981 2003-12-13  Martin Baulig  <martin@ximian.com>
7982
7983         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
7984         working again.
7985         (FlowBranching.MergeFinally): Don't call
7986         `branching.CheckOutParameters()' here, this is called in
7987         MergeTopBlock().
7988         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
7989         when adding the `finally' vector.       
7990
7991 2003-12-13  Martin Baulig  <martin@ximian.com>
7992
7993         * flowanalysis.cs
7994         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
7995         actually work and also fix #48962.
7996
7997 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7998
7999         * decl.cs: Do not check System.Object for nested types,
8000         since we know it does not have any. Big bang for buck:
8001
8002         BEFORE:
8003            Run 1:   8.35 seconds
8004            Run 2:   8.32 seconds
8005            corlib:  17.99 seconds
8006         AFTER:
8007            Run 1:   8.17 seconds
8008            Run 2:   8.17 seconds
8009            corlib:  17.39 seconds
8010
8011 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8012
8013         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8014         time we are returning 0 members, so we save alot here.
8015
8016 2003-12-11  Martin Baulig  <martin@ximian.com>
8017
8018         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8019         `MergeChild()', also just take the `FlowBranching' as argument;
8020         call Merge() on it and return the result.
8021         (FlowBranching.Merge): We don't need to do anything if we just
8022         have one sibling.
8023
8024 2003-12-11  Martin Baulig  <martin@ximian.com>
8025
8026         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8027         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8028         Maurer for this idea.
8029
8030 2003-12-11  Martin Baulig  <martin@ximian.com>
8031
8032         * flowanalysis.cs (MergeResult): This class is now gone; we now
8033         use the `UsageVector' for this.  The reason for this is that if a
8034         branching just has one sibling, we don't need to "merge" them at
8035         all - that's the next step to do.
8036         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8037         `MergeResult'.
8038
8039 2003-12-11  Martin Baulig  <martin@ximian.com>
8040
8041         Reworked flow analyis and made it more precise and bug-free.  The
8042         most important change is that we're now using a special `Reachability'
8043         class instead of having "magic" meanings of `FlowReturns'.  I'll
8044         do some more cleanups and optimizations and also add some more
8045         documentation this week.
8046
8047         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8048         largely reworked this class.
8049         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8050         the new `Reachability' class instead of having "magic" values here.
8051         (FlowBranching): We're now using an instance of `Reachability'
8052         instead of having separate `Returns', `Breaks' etc. fields.
8053
8054         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8055         based on flow analysis; ignore the return value of block.Emit ().
8056
8057 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8058
8059         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8060         if they are private.
8061
8062 2003-12-09  Martin Baulig  <martin@ximian.com>
8063
8064         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8065         call them directly on the UsageVector.
8066
8067 2003-12-09  Martin Baulig  <martin@ximian.com>
8068
8069         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8070         Changed return type from `FlowReturns' to `Reachability'.
8071
8072 2003-12-09  Martin Baulig  <martin@ximian.com>
8073
8074         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8075         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8076         `Reachable' fields with a single `Reachability' one.
8077
8078 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8079
8080         * class.cs (FindMembers): Remove foreach's.
8081
8082         Bootstrap times:
8083
8084         BEFORE
8085                 Run 1:   8.74 seconds
8086                 Run 2:   8.71 seconds
8087
8088         AFTER
8089                 Run 1:   8.64 seconds
8090                 Run 2:   8.58 seconds
8091
8092
8093 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8094
8095         * cs-parser.jay:
8096         * gen-treedump.cs:
8097         * statement.cs:
8098         This patch does a few things:
8099                 1. EmptyStatement is now a singleton, so it is never reallocated.
8100                 2. All blah is EmptyStatement constructs have been changed to
8101                    blah == EmptyStatement.Value, which is much faster and valid
8102                    now that EmptyStatement is a singleton.
8103                 3. When resolving a block, rather than allocating a new array for
8104                    the non-empty statements, empty statements are replaced with
8105                    EmptyStatement.Value
8106                 4. Some recursive functions have been made non-recursive.
8107         Mainly the performance impact is from (3), however (1) and (2) are needed for
8108         this to work. (4) does not make a big difference in normal situations, however
8109         it makes the profile look saner.
8110
8111         Bootstrap times:
8112
8113         BEFORE
8114         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8115         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8116         Total memory allocated: 56397 KB
8117
8118         AFTER
8119         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8120         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8121         Total memory allocated: 55666 KB
8122
8123 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8124
8125         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8126         than the hashtable in a hashtable version
8127
8128         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8129         we always end up concating a string. This results in a huge perf
8130         loss, because many strings have to be tracked by the GC. In this
8131         patch, we first use a hashtable that works with two keys, so that
8132         the strings do not need to be concat'ed.
8133
8134         Bootstrap times:
8135         BEFORE
8136                 Run 1:   8.74 seconds
8137                 Run 2:   8.71 seconds
8138
8139         AFTER
8140                 Run 1:   8.65 seconds
8141                 Run 2:   8.56 seconds
8142
8143 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8144
8145         * Makefile: Add a new target `do-time' that does a quick and simple
8146         profile, leaving easy to parse output.
8147
8148 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8149
8150         * codegen.cs (Init): Create the dynamic assembly with 
8151         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8152
8153 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8154
8155         * support.cs: Make the PtrHashtable use only one
8156         instance of its comparer.
8157
8158 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8159
8160         * typemanager.cs: Fix lookup of GetNamespaces.
8161
8162 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8163
8164         * expression.cs: Removed redundant line.
8165
8166         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8167         ArrayLists, use for loops with bounds.  
8168
8169         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8170         arraylist.
8171
8172         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8173         arraylists, use for loop with bounds.
8174
8175         The above three changes give us a 0.071 second performance
8176         improvement out of 3.294 seconds down to 3.223.  On my machine
8177         the above changes reduced the memory usage by 1,387 KB during
8178         compiler bootstrap.
8179
8180         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8181         QualifiedIdentifiers.  Before we created a new string through
8182         concatenation, and mostly later on, the result would be
8183         manipulated by DecomposeQI through string manipulation.
8184
8185         This reduced the compiler memory usage for bootstrapping from
8186         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8187         compile times in 0.05 seconds.
8188
8189 2003-11-28  Dick Porter  <dick@ximian.com>
8190
8191         * support.cs: Do string compares with the Invariant culture.
8192
8193         * rootcontext.cs: 
8194         * gen-treedump.cs: 
8195         * expression.cs: 
8196         * driver.cs: 
8197         * decl.cs: 
8198         * codegen.cs: 
8199         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8200         the comparison is done with the Invariant culture.
8201
8202 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8203
8204         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8205         GetEnumerator method.
8206
8207         (ProbeCollectionType): Iterate starting at the most specific type
8208         upwards looking for a GetEnumerator
8209
8210         * expression.cs: Shift count can be up to 31 for int/uint and 63
8211         for long/ulong.
8212
8213 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8214
8215         * statement.cs (Block.LookupLabel): Also look for the label on the
8216         children blocks.  Use a hash table to keep track of visited
8217         nodes. 
8218
8219         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8220         we actually did transform the other operand, otherwise fall back
8221         to the common codepath that casts to long.
8222
8223         * cs-tokenizer.cs: Use the same code pattern as the int case.
8224         Maybe I should do the parsing myself, and avoid depending on the
8225         Parse routines to get this done.
8226
8227 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8228
8229         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8230         which fixes bug 51347.  This time test it.
8231
8232         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8233         attributes for example can not tell the difference between these.
8234         The difference was only a syntax feature of the language. 
8235
8236         * attribute.cs: Apply attributes to delegates.
8237
8238         * delegate.cs: Call the apply attributes method.
8239
8240 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8241
8242         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8243         comparing 0 vs Byte.MinValue, not the value
8244
8245         (ImplicitConversionRequired): When reporting a conversion error,
8246         use error 31 to print out the constant error instead of the
8247         simpler 29.
8248
8249         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8250         which fixes bug 51347.
8251
8252 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8253
8254         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8255         which fixes the -warnaserror command line option.
8256
8257 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8258
8259         * cfold.cs (DoNumericPromotions): During constant folding of
8260         additions on UIntConstant, special case intconstants with
8261         IntConstants like we do on the expression binary operator. 
8262
8263 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8264
8265         * convert.cs (ImplicitReferenceConversion): We were missing a case
8266         (System.Enum are not value types or class types, so we need to
8267         classify them separatedly).
8268
8269         * driver.cs: We do not support error 2007.
8270
8271 2003-11-12 Jackson Harper <jackson@ximian.com>
8272
8273         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8274         system directory. Also use the full file name so users can
8275         libraries names mscorlib-o-tron.dll in a non system dir.
8276
8277 2003-11-10  Martin Baulig  <martin@ximian.com>
8278
8279         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8280         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8281         calling `ResolveType()' on them, directly assign their `Type'.
8282
8283 2003-11-08  Martin Baulig  <martin@ximian.com>
8284
8285         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8286         return value and the `out parent' parameter.
8287         (TypeContainer.DefineType): Moved the CS0644 check into
8288         GetClassBases().  Don't pass the interface types to the
8289         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8290         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8291
8292         * ecore.cs (TypeExpr.IsAttribute): New property.
8293         (TypeExpr.GetInterfaces): New method.
8294
8295         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8296         TypeExpr instead of a Type.
8297         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8298         (Interface.DefineType): Don't pass the interface types to the
8299         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8300         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8301
8302         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8303         instead of a `Type[]'.
8304         (TypeManager.RegisterBuilder): Likewise.
8305         (TypeManager.AddUserInterface): Likewise.
8306         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8307         `Type[]' and also return a `TypeExpr[]'.
8308         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8309
8310 2003-11-08  Martin Baulig  <martin@ximian.com>
8311
8312         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8313         Expression.     
8314
8315 2003-11-08  Martin Baulig  <martin@ximian.com>
8316
8317         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8318         TypeManager.ResolveExpressionTypes().
8319
8320         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8321         instead of an Expression.
8322         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8323         (TypeExpression): New public class; formerly known as `TypeExpr'.
8324
8325         * expression.cs (ComposedCast): Derive from TypeExpr.
8326
8327         * typemanager.cs (TypeManager.system_*_expr): These are now
8328         TypExpr's instead of Expression's.
8329         (TypeManager.ResolveExpressionTypes): New public static function;
8330         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8331         of them.        
8332
8333 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8334
8335         * expression.cs (New.DoResolve): Do not dereference value that
8336         might be a null return.
8337
8338         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8339         sure that the constant value has the right type.  Fixes an
8340         unreported bug, similar to 50425.
8341
8342         * const.cs (Const.LookupConstantValue): Call
8343         ImplicitStandardConversionExists before doing a conversion to
8344         avoid havng the TypeManager.ChangeType do conversions.
8345
8346         Reduced the number of casts used
8347
8348         (Const.ChangeType): New routine to enable reuse of the constant
8349         type changing code from statement.
8350
8351         * typemanager.cs (ChangeType): Move common initialization to
8352         static global variables.
8353
8354         Fixes #50425.
8355
8356         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8357         every value type to go through, even if it was void.  Fix that. 
8358
8359         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8360         character of the define, and the is_identifier_part_character for
8361         the rest of the string.
8362
8363 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8364
8365         * expression.cs (UnaryMutator.EmitCode): When I updated
8366         LocalVariableReference.DoResolve, I overdid it, and dropped an
8367         optimization done on local variable references.
8368
8369 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8370
8371         * ecore.cs: Convert the return from Ldlen into an int.
8372
8373 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8374
8375         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8376         the accessibility, this is a special case for toplevel non-public
8377         classes (internal for instance).
8378
8379 2003-10-20  Nick Drochak <ndrochak@gol.com>
8380
8381         * ecore.cs: Fix typo and build.  Needed another right paren.
8382
8383 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8384
8385         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8386         `internal' case regular and protected, but not allowing protected
8387         to be evaluated later.  Bug 49840
8388
8389 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8390
8391         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8392         to kb.Nlast, and not the kb.nFirst to isolate the switch
8393         statement.
8394
8395         Extract the underlying type, so enumerations of long/ulong are
8396         treated like long/ulong.
8397
8398 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8399
8400         * expression.cs (New): Overload the meaning of RequestedType to
8401         track the possible creation of the NewDelegate type, since
8402         DoResolve is invoked more than once for new constructors on field
8403         initialization.
8404
8405         See bugs: #48800 and #37014
8406
8407         * cs-parser.jay (declare_local_constants): Take an arraylist
8408         instead of a single constant.
8409
8410         (local_constant_declaration): It should take a
8411         constant_declarators, not a constant_declarator.  Fixes 49487
8412
8413         * convert.cs: Fix error report.
8414
8415 2003-10-13 Jackson Harper <jackson@ximian.com>
8416
8417         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8418         bug #49611
8419
8420 2003-10-09  Martin Baulig  <martin@ximian.com>
8421
8422         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8423         to the .ctor.
8424         (MethodCore.DoDefineParameters): Removed the TypeContainer
8425         argument; use the DeclSpace which was passed to the .ctor instead.
8426         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8427         TypeContainer; we only need a DeclSpace here.
8428
8429 2003-10-09  Martin Baulig  <martin@ximian.com>
8430
8431         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8432         to the .ctor.
8433         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8434         EmitContext's .ctor.    
8435
8436 2003-10-09  Martin Baulig  <martin@ximian.com>
8437
8438         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8439         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8440         AsAccessible(), moved them as well.
8441
8442         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8443
8444 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8445
8446         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8447
8448 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8449
8450         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8451         generation for >=, as spotted by Paolo, bug 48679.  
8452         Patch from David Waite.
8453
8454         * cs-tokenizer.cs: Add handling for #pragma.
8455
8456         * cs-parser.jay: Allow for both yield and yield return in the
8457         syntax.  The anti-cobolization of C# fight will go on!
8458
8459         * class.cs (TypeBuilder.DefineType): Catch error condition here
8460         (Parent.DefineType erroring out and returning null).
8461
8462         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8463         coping with enumerations variables, we were mistakenly processing
8464         them as a regular value type instead of built-in types.  Fixes the
8465         bug #48063
8466
8467         * typemanager.cs (IsBuiltinOrEnum): New method.
8468
8469 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8470
8471         * cs-parser.jay: Upgrade: yield now needs the return clause.
8472
8473 2003-09-19  Martin Baulig  <martin@ximian.com>
8474
8475         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8476         `MemberCache parent' argument.  Normally, an interface doesn't
8477         have a parent type except System.Object, but we use this in gmcs
8478         for generic type parameters.
8479
8480 2003-09-18  Martin Baulig  <martin@ximian.com>
8481
8482         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8483         on `type.IsInterface'; don't check whether the type has a parent
8484         to determine whether it's an interface.
8485
8486 2003-09-15  Martin Baulig  <martin@ximian.com>
8487
8488         * class.cs (TypeContainer.DefineType): Added an error flag to
8489         avoid reporting duplicate CS0146's ("class definition is
8490         circular.").
8491
8492         * driver.cs (Driver.MainDriver): Abort if
8493         RootContext.ResolveTree() reported any errors.
8494
8495 2003-09-07  Martin Baulig  <martin@ximian.com>
8496
8497         * report.cs (Error, Warning): Added overloaded versions which take
8498         a `params object[] args' and call String.Format().
8499
8500 2003-09-07  Martin Baulig  <martin@ximian.com>
8501
8502         * decl.cs (DeclSpace..ctor): Don't call
8503         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8504         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8505         (DeclSpace.RecordDecl): New method.
8506
8507         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8508
8509 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8510
8511         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8512         value attributes to be applied to ParameterBuilders.
8513
8514         * class.cs (MethodCore.LabelParameters): Make static and more
8515         generic so that it can be used from other places - like interface
8516         methods, for instance.
8517
8518         * interface.cs (Interface.Emit): Call LabelParameters before
8519         emitting attributes on the InterfaceMethod.
8520
8521 2003-08-26  Martin Baulig  <martin@ximian.com>
8522
8523         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8524         resolving aliases; fixes #47927.
8525
8526 2003-08-26  Martin Baulig  <martin@ximian.com>
8527
8528         * statement.cs (Using.DoResolve): This is internally emitting a
8529         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8530         do not always return.  Fixes #47681.
8531
8532 2003-08-26  Martin Baulig  <martin@ximian.com>
8533
8534         * decl.cs (MemberCore): Moved WarningNotHiding(),
8535         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8536         into MemberBase.
8537         (AdditionResult): Make this nested in DeclSpace.
8538         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8539         argument; call NamespaceEntry.Define() unless we're nested in a
8540         class or struct.
8541
8542         * namespace.cs (Namespace.DefineName): New public function.  This
8543         is called from DeclSpace's .ctor to add 
8544         (Namespace.Lookup): Include DeclSpaces in the lookup.
8545
8546         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8547
8548         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8549
8550 2003-08-25  Martin Baulig  <martin@ximian.com>
8551
8552         * convert.cs (Convert.ExplicitReferenceConversion): When
8553         converting from an interface type to a class, unbox if the target
8554         type is a struct type.  Fixes #47822.
8555
8556 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8557
8558         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8559         #47854.
8560
8561 2003-08-22  Martin Baulig  <martin@ximian.com>
8562
8563         * class.cs (TypeManager.DefineType): When defining a nested type,
8564         call DefineType() on our parent; fixes #47801.
8565
8566 2003-08-22  Martin Baulig  <martin@ximian.com>
8567
8568         * class.cs (MethodData.Define): While checking if a method is an
8569         interface implementation, improve the test a bit more to fix #47654.
8570
8571 2003-08-22  Martin Baulig  <martin@ximian.com>
8572
8573         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8574         correctly; fixes #47722.
8575
8576 2003-08-22  Martin Baulig  <martin@ximian.com>
8577
8578         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8579         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8580
8581         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8582
8583 2003-08-22  Martin Baulig  <martin@ximian.com>
8584
8585         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8586         can only be assigned in static constructors.  Fixes #47161.
8587
8588 2003-08-22  Martin Baulig  <martin@ximian.com>
8589
8590         Rewrote and improved the flow analysis code.
8591
8592         * flowbranching.cs (FlowBranching): Make this class abstract.
8593         (FlowBranching.CreateBranching): New static function to create a
8594         new flow branching.
8595         (FlowBranchingBlock, FlowBranchingException): New classes.
8596         (FlowBranching.UsageVector.Type): New public readonly field.
8597         (FlowBranching.UsageVector.Breaks): Removed the setter.
8598         (FlowBranching.UsageVector.Returns): Removed the setter.
8599         (FlowBranching.UsageVector): Added Break(), Return(),
8600         NeverReachable() and Throw() methods to modify the reachability.
8601         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8602         done by FlowBranching.Merge().
8603         (FlowBranching.UsageVector.MergeChild): New method; merges the
8604         merge result into the current vector.
8605         (FlowBranching.Merge): New abstract method to merge a branching.
8606
8607 2003-08-12  Martin Baulig  <martin@ximian.com>
8608
8609         * expression.cs (Indirection.CacheTemporaries): Create the
8610         LocalTemporary with the pointer type, not its element type.
8611
8612 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8613
8614         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8615         token was a keyword or not.
8616
8617         Add `error' options where an IDENTIFIER was expected;  Provide
8618         CheckToken and CheckIdentifierToken convenience error reporting
8619         functions. 
8620
8621         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8622
8623         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8624         NameSpaceEntry NameSpaceEntry.
8625
8626         (LookupInterfaceOrClass): Avoid creating a full qualified name
8627         from namespace and name: avoid doing lookups when we know the
8628         namespace is non-existant.   Use new Tree.LookupByNamespace which
8629         looks up DeclSpaces based on their namespace, name pair.
8630
8631         * driver.cs: Provide a new `parser verbose' to display the
8632         exception thrown during parsing.  This is turned off by default
8633         now, so the output of a failure from mcs is more graceful.
8634
8635         * namespace.cs: Track all the namespaces defined in a hashtable
8636         for quick lookup.
8637
8638         (IsNamespace): New method
8639
8640 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8641
8642         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8643         we know that we need to concatenate (full typename can never be
8644         null). 
8645
8646         * class.cs: ditto.
8647
8648         * statement.cs: Use a bitfield;  Do not initialize to null things
8649         which are done by the constructor by default.
8650
8651         * cs-parser.jay: bug fix, parameter was 4, not 3.
8652
8653         * expression.cs: Just use the property;
8654
8655         * statement.cs: No need for GetVariableInfo method.
8656
8657 2003-08-08  Martin Baulig  <martin@ximian.com>
8658
8659         * flowanalysis.cs (FlowReturns): This is now nested in the
8660         `FlowBranching' class.
8661         (MyBitVector): Moved this here from statement.cs.
8662         (FlowBranching.SiblingType): New enum type.
8663         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8664
8665 2003-08-07  Martin Baulig  <martin@ximian.com>
8666
8667         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8668         `FlowBranching' class and called `BranchingType'.
8669
8670 2003-08-07  Martin Baulig  <martin@ximian.com>
8671
8672         * flowanalysis.cs: Moved all the control flow analysis code into
8673         its own file.
8674
8675 2003-08-07  Martin Baulig  <martin@ximian.com>
8676
8677         * assign.cs (Assign.DoResolve): `target' must either be an
8678         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8679         #37319.
8680
8681 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8682
8683         * expression.cs (BinaryMethod): This kind of expression is created by the
8684         Binary class if it determines that the operator has to be handled
8685         by a method.
8686
8687         (BinaryDelegate): This kind of expression is created if we are
8688         dealing with a + or - operator on delegates.
8689
8690         (Binary): remove method, argumetns, and DelegateOperator: when
8691         dealing with methods, 
8692
8693         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8694
8695         * statement.cs (Block): use bitfields for the three extra booleans
8696         we had in use.   Remove unused topblock parameter.
8697
8698         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8699
8700         * assign.cs: Drop extra unneeded tests.
8701
8702 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8703
8704         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8705
8706         * statement.cs (Foreach): Use VariableStorage instead of
8707         LocalBuilders.   
8708
8709         * codegen.cs (VariableStorage): New class used by clients that
8710         require a variable stored: locals or fields for variables that
8711         need to live across yield.
8712
8713         Maybe provide a convenience api for EmitThis+EmitLoad?
8714
8715         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8716         these bad boys.
8717
8718 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8719
8720         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8721         RemapParameterLValue): New methods that are used to turn a
8722         precomputed FieldInfo into an expression like this:
8723
8724                 instance.FieldInfo
8725
8726         The idea is to use this instead of making LocalVariableReference
8727         have more than one meaning.
8728
8729         * cs-parser.jay: Add error production to BASE.
8730
8731         * ecore.cs: Deal with TypeManager.GetField returning null, which
8732         is now a valid return value.
8733
8734         (FieldExprNoAddress): New expression for Fields whose address can
8735         not be taken.
8736
8737         * expression.cs (LocalVariableReference): During the resolve
8738         phases, create new expressions if we are in a remapping context.
8739         Remove code that dealt with remapping here.
8740
8741         (ParameterReference): same.
8742
8743         (ProxyInstance): New expression, like the `This' expression, but
8744         it is born fully resolved.  We know what we are doing, so remove
8745         the errors that are targeted to user-provided uses of `this'.
8746
8747         * statement.cs (Foreach): our variable is now stored as an
8748         Expression;  During resolution, follow the protocol, dont just
8749         assume it will return this.
8750
8751 2003-08-06  Martin Baulig  <martin@ximian.com>
8752
8753         * support.cs (SeekableStreamReader.cs): New public class.
8754
8755         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8756         SeekableStreamReader instead of the normal StreamReader.
8757
8758 2003-08-04  Martin Baulig  <martin@ximian.com>
8759
8760         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8761         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8762         deambiguate casts and delegate invocations.
8763         (parenthesized_expression): Use the new tokens to ensure this is
8764         not a cast of method invocation.
8765
8766         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8767         when reading a `)' and Deambiguate_CloseParens () was previously
8768         called.
8769
8770         * expression.cs (ParenthesizedExpression): New class.  This is
8771         just used for the CS0075 test.
8772         (Binary.DoResolve): Check for CS0075.   
8773
8774 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8775
8776         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8777         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8778         reference comparison.
8779
8780         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8781         examine the ReturnType for equality - this is necessary in the
8782         cases of implicit and explicit operators whose signature also
8783         includes the return type.
8784
8785 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8786
8787         * namespace.cs: Cache the result of the namespace computation,
8788         instead of computing it every time.
8789
8790 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8791
8792         * decl.cs: Use a global arraylist that we reuse over invocations
8793         to avoid excesive memory consumption.  Reduces memory usage on an
8794         mcs compile by one meg (45 average).
8795
8796         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8797         private, work around that.
8798
8799 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8800
8801         * literal.cs (IntLiteral): Define Zero and One static literals. 
8802
8803         * cs-parser.jay (integer_literal): use static literals to reduce
8804         memory usage for the most used literals (0, 1 and -1).  211kb
8805         reduced in memory usage.
8806
8807         Replace all calls to `new ArrayList' with `new
8808         ArrayList(4)' which is a good average number for most allocations,
8809         and also requires only 16 bytes of memory for its buffer by
8810         default. 
8811
8812         This reduced MCS memory usage in seven megabytes for the RSS after
8813         bootstrapping.
8814
8815 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8816
8817         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8818         handle params methods the correct way by forming only one
8819         applicable set with params and normal methods in them. Earlier we
8820         were looking at params methods only if we found no normal methods
8821         which was not the correct thing to do.
8822
8823         (Invocation.BetterFunction): Take separate arguments indicating
8824         when candidate and the best method are params methods in their
8825         expanded form.
8826
8827         This fixes bugs #43367 and #46199.
8828
8829         * attribute.cs: Documentation updates.
8830
8831         (CheckAttribute): Rename to CheckAttributeTarget.
8832         (GetValidPlaces): Rename to GetValidTargets.
8833
8834         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8835         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8836
8837         Fixes bug #44468.
8838
8839 2003-07-28  Martin Baulig  <martin@ximian.com>
8840
8841         * class.cs (TypeContainer.DefineMembers): Use the base type's full
8842         name when looking up the base class of a nested class.  Fixes #46977.
8843
8844 2003-07-26  Martin Baulig  <martin@ximian.com>
8845
8846         * expression.cs (Indexers.Indexer): New nested struct; contains
8847         getter, setter and the indexer's type.
8848         (Indexers.Properties): This is now an ArrayList of
8849         Indexers.Indexer's.
8850         (IndexerAccess.DoResolveLValue): Correctly set the type if the
8851         indexer doesn't have any getters.
8852
8853         * assign.cs (Assign.DoResolve): Also do the implicit conversions
8854         for embedded property and indexer assignments.
8855
8856 2003-07-26  Martin Baulig  <martin@ximian.com>
8857
8858         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
8859         preprocessor directive is not the first non-whitespace character
8860         on a line.
8861
8862 2003-07-26  Martin Baulig  <martin@ximian.com>
8863
8864         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
8865         namespace parsing, follow the spec more closely.
8866
8867         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
8868         NamespaceEntry.Lookup().
8869
8870 2003-07-25  Martin Baulig  <martin@ximian.com>
8871
8872         * MethodCore.cs (OverridesSomething): New public field; it's set
8873         from TypeContainer.DefineMembers if this method overrides
8874         something (which doesn't need to be a method).  Fix #39462.
8875
8876 2003-07-25  Ravi Pratap  <ravi@ximian.com>
8877
8878         * typemanager.cs (GetMembers): Ensure that the list of members is
8879         reversed. This keeps things in sync.
8880
8881         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
8882         find an AttributeUsage attribute.
8883
8884         * expression.cs (Invocation.OverloadResolve): Perform the check
8885         which disallows Invoke to be directly called on a Delegate.
8886
8887         (Error_InvokeOnDelegate): Report error cs1533.
8888
8889 2003-07-25  Martin Baulig  <martin@ximian.com>
8890
8891         * expression.cs (Indexers.GetIndexersForType): Only look in the
8892         interface hierarchy if the requested type is already an
8893         interface.  Fixes #46788 while keeping #46502 fixed.
8894
8895 2003-07-25  Martin Baulig  <martin@ximian.com>
8896
8897         * class.cs (TypeContainer.DefineMembers): Check whether all
8898         readonly fields have been assigned and report warning CS0649 if
8899         not.
8900
8901         * statement.cs (LocalInfo.IsFixed): Always return true if this is
8902         a valuetype.
8903
8904 2003-07-24  Ravi Pratap  <ravi@ximian.com>
8905
8906         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
8907         returned from GetMethods to make things consistent with the
8908         assumptions MCS makes about ordering of methods.
8909
8910         This should comprehensively fix bug #45127 and it does :-)
8911
8912         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
8913         ordering is actually reverse.
8914
8915         * Clean up some debug messages I left lying around.
8916
8917         * interface.cs (Populate*): Get rid of code which emits attributes
8918         since the stage in which we emit attributes is the 'Emit' stage,
8919         not the define stage.
8920
8921         (Emit): Move attribute emission for interface members here.
8922
8923 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8924
8925         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8926         closely: we eliminate methods in base types when we have an
8927         applicable method in a top-level type.
8928
8929         Please see section 14.5.5.1 for an exact description of what goes
8930         on. 
8931
8932         This fixes bug #45127 and a host of other related to corlib compilation.
8933
8934         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8935         array is the method corresponding to the top-level type (this is
8936         because of the changes made to icall.c) so we change this
8937         accordingly.
8938
8939         (MethodGroupExpr.Name): This too.
8940
8941         * typemanager.cs (GetElementType): New method which does the right
8942         thing when compiling corlib. 
8943
8944         * everywhere: Make use of the above in the relevant places.
8945
8946 2003-07-22  Martin Baulig  <martin@ximian.com>
8947
8948         * cs-parser.jay (invocation_expression): Moved
8949         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8950         `cast_expression', but create a InvocationOrCast which later
8951         resolves to either an Invocation or a Cast.
8952
8953         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8954         method; call this before EmitStatement() to make sure that this
8955         expression can be used as a statement.
8956
8957         * expression.cs (InvocationOrCast): New class; resolves to either
8958         an Invocation or a Cast.
8959
8960         * statement.cs (StatementExpression): Call ResolveStatement() on
8961         the ExpressionStatement before emitting it.
8962
8963 2003-07-21  Martin Baulig  <martin@ximian.com>
8964
8965         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8966         `ref' and `out' attributes match; fixes #46220.
8967         (MemberAccess.ResolveMemberAccess): You can't reference a type
8968         through an expression; fixes #33180.
8969         (Indexers.GetIndexersForType): Don't return the indexers from
8970         interfaces the class implements; fixes #46502.
8971
8972 2003-07-21  Martin Baulig  <martin@ximian.com>
8973
8974         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8975         CS0661 checks; fixes bug #30442.
8976
8977 2003-07-21  Martin Baulig  <martin@ximian.com>
8978
8979         * decl.cs (AdditionResult): Added `Error'.
8980
8981         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8982
8983         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
8984         makes cs0031.cs actually work.
8985
8986 2003-07-20  Martin Baulig  <martin@ximian.com>
8987
8988         * namespace.cs: Fixed that bug which caused a crash when compiling
8989         the debugger's GUI.
8990
8991 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8992
8993         * typemanager.cs (LookupTypeReflection): Never expose types which
8994         are NotPublic, NestedPrivate, NestedAssembly, or
8995         NestedFamANDAssem.  We used to return these, and later do a check
8996         that would report a meaningful error, but the problem is that we
8997         would not get the real match, if there was a name override.
8998
8999 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9000
9001         * namespace.cs (Namespace, Name): Do not compute the namespace
9002         name dynamically, compute it in the constructor.  This reduced
9003         memory usage by 1697 KB.
9004
9005         * driver.cs: Use --pause to pause at the end.
9006
9007 2003-07-17  Peter Williams  <peter@newton.cx>
9008
9009         * Makefile: Change the name of the test target so that it doesn't
9010         conflict with the recursive test target.
9011
9012 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9013
9014         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9015         AddressOf): Do not use EmitThis, that was wrong, use the actual
9016         this pointer.
9017
9018 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9019
9020         * class.cs (MethodData.Define): While checking if a method is an
9021         interface implementation, improve the test: If we are not public
9022         (use new test here: use the computed MethodAttributes directly,
9023         instead of the parsed modifier flags) check if the `implementing'
9024         method comes from an interface or not.
9025
9026         * pending.cs (VerifyPendingMethods): Slightly better error
9027         message.
9028
9029         * makefile: add test target that does the mcs bootstrap.
9030
9031 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9032
9033         * interface.cs (Define): Do nothing here since there are no
9034         members to populate etc. Move the attribute emission out of here
9035         since this was just totally the wrong place to put it. Attribute
9036         application happens during the 'Emit' phase, not in the 'Define'
9037         phase.
9038
9039         (Emit): Add this method and move the attribute emission here
9040
9041         * rootcontext.cs (EmitCode): Call the Emit method on interface
9042         types too.
9043
9044 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9045
9046         * expression.cs (OverloadResolve): Report error only if Location
9047         is not 'Null' which means that there was a probe going on.
9048
9049 2003-07-14  Martin Baulig  <martin@ximian.com>
9050
9051         * expression.cs (ConditionalLogicalOperator): New public class to
9052         implement user defined conditional logical operators.
9053         This is section 14.11.2 in the spec and bug #40505.
9054
9055 2003-07-14  Martin Baulig  <martin@ximian.com>
9056
9057         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9058
9059 2003-07-14  Martin Baulig  <martin@ximian.com>
9060
9061         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9062
9063         * ecore.cs (IVariable.VerifyFixed): New interface method.
9064
9065         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9066         operator, check whether the variable is actually fixed.  Fixes bug
9067         #36055.  Set a variable definitely assigned when taking its
9068         address as required by the spec.
9069
9070         * statement.cs (LocalInfo.IsFixed): New field.
9071         (LocalInfo.MakePinned): Set `IsFixed' to true.
9072
9073 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9074
9075         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9076         for .ctors, ensure that we only ask for members declared in the
9077         attribute type (BindingFlags.DeclaredOnly).
9078
9079         Fixes bug #43632.
9080
9081         * expression.cs (Error_WrongNumArguments): Report error 1501
9082         correctly the way CSC does.
9083
9084 2003-07-13  Martin Baulig  <martin@ximian.com>
9085
9086         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9087         lookup on the fully qualified name, to make things like "X.X" work
9088         where "X.X" is a fully qualified type name, but we also have a
9089         namespace "X" in the using list.  Fixes #41975.
9090
9091 2003-07-13  Martin Baulig  <martin@ximian.com>
9092
9093         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9094         function. If we're a CompoundAssign, we need to create an embedded
9095         CompoundAssign, not an embedded Assign.
9096         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9097         Fixes #45854.
9098
9099 2003-07-13  Martin Baulig  <martin@ximian.com>
9100
9101         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9102         work to fix bug #46088.
9103
9104 2003-07-13  Ravi Pratap <ravi@ximian.com>
9105
9106         * class.cs (Operator.Emit): Do not emit attributes here - it is
9107         taken care of by the Method class that we delegate too. This takes
9108         care of bug #45876.
9109
9110 2003-07-10  Martin Baulig  <martin@ximian.com>
9111
9112         * expression.cs (TypeOfVoid): New class.
9113         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9114
9115 2003-07-10  Martin Baulig  <martin@ximian.com>
9116
9117         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9118         bug #35957.
9119
9120 2003-07-10  Martin Baulig  <martin@ximian.com>
9121
9122         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9123         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9124
9125         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9126
9127         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9128
9129 2003-07-10  Martin Baulig  <martin@ximian.com>
9130
9131         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9132         of decimal.  Fixes #42850.
9133
9134         NOTE: I also fixed the created byte blob, but this doesn't work on
9135         the MS runtime and csc never produces any byte blobs for decimal
9136         arrays.
9137
9138 2003-07-10  Martin Baulig  <martin@ximian.com>
9139
9140         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9141         structs; fixes #32068.
9142         (Block.AddChildVariableNames): Fixed #44302.
9143
9144 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9145
9146         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9147
9148 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9149
9150         * attribute.cs: And this test is onger needed.
9151
9152 2003-07-08  Martin Baulig  <martin@ximian.com>
9153
9154         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9155         inaccessible types.  Fixes #36313.
9156
9157         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9158
9159         * namespace.cs (NamespaceEntry): Create implicit entries for all
9160         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9161         implicit entries for N1.N2 and N1.
9162
9163 2003-07-08  Martin Baulig  <martin@ximian.com>
9164
9165         Rewrote the handling of namespaces to fix a lot of the issues
9166         wrt. `using' aliases etc.
9167
9168         * namespace.cs (Namespace): Splitted this class into a
9169         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9170
9171         * typemanager.cs (TypeManager.IsNamespace): Removed.
9172         (TypeManager.ComputeNamespaces): Only compute namespaces from
9173         loaded assemblies here, not the namespaces from the assembly we're
9174         currently compiling.
9175
9176 2003-07-08  Martin Baulig  <martin@ximian.com>
9177
9178         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9179
9180 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9181
9182         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9183         already fixed it.  
9184
9185         I thought about the memory savings here, but LookupTypeReflection
9186         is used under already very constrained scenarios.  Compiling
9187         corlib or mcs only exposes one hit, so it would not really reduce
9188         any memory consumption.
9189
9190 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9191
9192         * typemanager.cs: fixes bug #45889 by only adding public types from
9193         other assemblies to the list of known types.
9194
9195 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9196
9197         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9198         on the type we resolved.
9199
9200 2003-07-05  Martin Baulig  <martin@ximian.com>
9201
9202         * pending.cs (PendingImplementation.ParentImplements): Don't
9203         create the proxy if the parent is abstract.
9204
9205         * class.cs (TypeContainer.DefineIndexers): Process explicit
9206         interface implementations first.  Fixes #37714.
9207
9208 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9209
9210         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9211         defined recursively;  but since we modify the input parameters
9212         (left is set to `this' temporarily), we reset this value if the
9213         left_is_explicit is false, which gives the original semantics to
9214         the code.  
9215
9216         * literal.cs (NullPointer): new class used to represent a null
9217         literal in a pointer context.
9218
9219         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9220         type is a pointer, use a NullPointer object instead of a
9221         NullLiteral.   Closes 43687
9222
9223         (ExplicitConversion): Convert pointer values using
9224         the conv opcode to the proper type.
9225
9226         * ecore.cs (New): change ValueTypeVariable property into a method,
9227         that returns whether the valuetype is suitable for being used.
9228
9229         * expression.cs (Binary.DoNumericPromotions): Only return if we
9230         the int constant was a valid uint, and we can return both left and
9231         right as uints.  If not, we continue processing, to trigger the
9232         type conversion.  This fixes 39018.
9233
9234         * statement.cs (Block.EmitMeta): During constant resolution, set
9235         the CurrentBlock property on the emitcontext, so that we resolve
9236         constants propertly.
9237
9238 2003-07-02  Martin Baulig  <martin@ximian.com>
9239
9240         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9241         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9242
9243         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9244         than emitting it here.
9245
9246         * statement.cs: Fixed some more flow analysis bugs.
9247
9248 2003-07-02  Martin Baulig  <martin@ximian.com>
9249
9250         * class.cs (MethodData.Define): When implementing interface
9251         methods, set Final unless we're Virtual.
9252
9253         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9254         check work for interface methods.
9255
9256 2003-07-01  Martin Baulig  <martin@ximian.com>
9257
9258         * ecore.cs (EmitContext.This): Replaced this property with a
9259         GetThis() method which takes a Location argument.  This ensures
9260         that we get the correct error location for a CS0188.
9261
9262 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9263
9264         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9265         ImplicitStandardConversion.
9266
9267         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9268
9269 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9270
9271         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9272         optimization.
9273
9274 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9275
9276         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9277         constructors.
9278
9279         (MethodData.Define): Turn off initlocals for unsafe methods.
9280
9281 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9282
9283         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9284         complete;  Fixes #37521.
9285
9286         * delegate.cs: Use Modifiers.TypeAttr to compute the
9287         TypeAttributes, instead of rolling our own.  This makes the flags
9288         correct for the delegates.
9289
9290 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9291
9292         * class.cs (Constructor.Define): Set the private flag for static
9293         constructors as well.
9294
9295         * cs-parser.jay (statement_expression): Set the return value to
9296         null, to avoid a crash when we catch an error.
9297
9298 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9299
9300         * cs-parser.jay: Applied patch from Jackson that adds support for
9301         extern and unsafe modifiers to destructor declarations.
9302
9303         * expression.cs: Report error 21 if the user is trying to index a
9304         System.Array.
9305
9306         * driver.cs: Add an error message, suggested by the bug report.
9307
9308         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9309         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9310
9311 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9312
9313         * namespace.cs: Add some information to reduce FAQs.
9314
9315 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9316
9317         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9318         underlying enumeration types.  Fixes #43915.
9319
9320         * expression.cs: Treat ushort/short as legal values to be used in
9321         bitwise operations.
9322
9323 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9324
9325         * delegate.cs: transfer custom attributes for paramenters from
9326         the delegate declaration to Invoke and BeginInvoke.
9327
9328 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9329
9330         * attribute.cs: handle custom marshalers and emit marshal info
9331         for fields, too.
9332
9333 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9334
9335         * makefile.gnu: Added anonymous.cs to the compiler sources.
9336
9337 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9338
9339         * iterators.cs: Change the name of the proxy class to include two
9340         underscores.
9341
9342         * cs-parser.jay: Update grammar to include anonymous methods.
9343
9344         * anonymous.cs: new file.
9345
9346 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9347
9348         * class.cs (Field.Define): Add missing test for pointers and
9349         safety. 
9350
9351 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9352
9353         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9354         we use the stobj opcode.
9355
9356         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9357         since it wasn't the correct fix. 
9358
9359         It still is puzzling that we are required to use stobj for IntPtr
9360         which seems to be a ValueType.
9361
9362 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9363
9364         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9365         during regular simple name resolution.   Now, the trick is that
9366         instead of returning for processing the simplename, we do a
9367         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9368         contextual lookup type).   If a match is found, return that, if
9369         not, return for further composition.
9370
9371         This fixes long-standing 30485.
9372
9373         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9374         using the address to initialize an object, do an Stobj instead of
9375         using the regular Stelem.
9376
9377         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9378         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9379         Because if we are a BaseIndexerAccess that value will be true.
9380         Fixes 43643.
9381
9382         * statement.cs (GotoCase.Resolve): Return after reporting an
9383         error, do not attempt to continue. 
9384
9385         * expression.cs (PointerArithmetic.Emit): If our operand is a
9386         long, convert our constants to match the operand before
9387         multiplying.  Convert to I type before adding.   Fixes 43670.
9388
9389 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9390
9391         * enum.cs (ImplicitConversionExists) : Rename to
9392         ImplicitEnumConversionExists to remove ambiguity. 
9393
9394         * ecore.cs (NullCast): New type of cast expression class which
9395         basically is very similar to EmptyCast with the difference being
9396         it still is a constant since it is used only to cast a null to
9397         something else
9398         (eg. (string) null)
9399
9400         * convert.cs (ImplicitReferenceConversion): When casting a null
9401         literal, we return a NullCast.
9402
9403         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9404         should be around anymore.
9405
9406         The renaming (reported was slightly wrong). Corrections:
9407
9408         ConvertImplicitStandard -> ImplicitConversionStandard
9409         ConvertExplicitStandard -> ExplicitConversionStandard
9410
9411         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9412         before passing them in !
9413
9414         * convert.cs (ImplicitConversionStandard): When comparing for
9415         equal expr and target types, ensure that expr is not a
9416         NullLiteral.
9417
9418         In general, we must not be checking (expr_type ==
9419         target_type) in the top level conversion methods
9420         (ImplicitConversion, ExplicitConversion etc). This checking is
9421         done in the methods that they delegate to.
9422
9423 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9424
9425         * convert.cs: Move Error_CannotConvertType,
9426         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9427         ImplicitNumericConversion, ImplicitConversionExists,
9428         ImplicitUserConversionExists, StandardConversionExists,
9429         FindMostEncompassedType, FindMostSpecificSource,
9430         FindMostSpecificTarget, ImplicitUserConversion,
9431         ExplicitUserConversion, GetConversionOperators,
9432         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9433         TryImplicitIntConversion, Error_CannotConvertImplicit,
9434         ConvertImplicitRequired, ConvertNumericExplicit,
9435         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9436         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9437         its own file.
9438
9439         Perform the following renames:
9440
9441         StandardConversionExists -> ImplicitStandardConversionExists
9442         ConvertImplicit -> ImplicitConversion
9443         ConvertImplicitStandard -> ImplicitStandardConversion
9444         TryImplicitIntConversion -> ImplicitIntConversion
9445         ConvertImplicitRequired -> ImplicitConversionRequired
9446         ConvertNumericExplicit -> ExplicitNumericConversion
9447         ConvertReferenceExplicit -> ExplicitReferenceConversion
9448         ConvertExplicit -> ExplicitConversion
9449         ConvertExplicitStandard -> ExplicitStandardConversion
9450
9451 2003-05-19  Martin Baulig  <martin@ximian.com>
9452
9453         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9454         (TypeInfo): Added support for structs having structs as fields.
9455
9456         * ecore.cs (FieldExpr): Implement IVariable.
9457         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9458         VariableInfo for the field.
9459
9460 2003-05-18  Martin Baulig  <martin@ximian.com>
9461
9462         * expression.cs (This.DoResolve): Report a CS0027 if we're
9463         emitting a field initializer.
9464
9465 2003-05-18  Martin Baulig  <martin@ximian.com>
9466
9467         * expression.cs (This.ResolveBase): New public function.
9468         (This.DoResolve): Check for CS0188.
9469
9470         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9471         This.Resolve().
9472
9473         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9474         `instance_expression' to null if we don't have any non-static
9475         methods.
9476
9477 2003-05-18  Martin Baulig  <martin@ximian.com>
9478
9479         Reworked the way how local variables and parameters are handled by
9480         the flow analysis code.
9481
9482         * statement.cs (TypeInfo, VariableMap): New public classes.
9483         (VariableInfo): New public class.  This is now responsible for
9484         checking whether a variable has been assigned.  It is used for
9485         parameters and local variables.
9486         (Block.EmitMeta): Take the InternalParameters as argument; compute
9487         the layout of the flow vectors here.
9488         (Block.LocalMap, Block.ParameterMap): New public properties.
9489         (FlowBranching): The .ctor doesn't get the InternalParameters
9490         anymore since Block.EmitMeta() now computes the layout of the flow
9491         vector.
9492         (MyStructInfo): This class is now known as `StructInfo' and nested
9493         in `TypeInfo'; we don't access this directly anymore.
9494
9495         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9496         property and removed IsAssigned(), IsFieldAssigned(),
9497         SetAssigned() and SetFieldAssigned(); we now call them on the
9498         VariableInfo so we don't need to duplicate this code everywhere.
9499
9500         * expression.cs (ParameterReference): Added `Block block' argument
9501         to the .ctor.
9502         (LocalVariableReference, ParameterReference, This): The new
9503         VariableInfo class is now responsible for all the definite
9504         assignment stuff.
9505
9506         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9507         IsParameterAssigned, SetParameterAssigned): Removed.
9508
9509 2003-05-18  Martin Baulig  <martin@ximian.com>
9510
9511         * typemanager.cs (InitCoreTypes): Try calling
9512         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9513         the 3-args-version.  Corlib now also needs our `void_type'.
9514         (GetMethod): Added overloaded version which takes an optional
9515         `bool report_errors' to allow lookups of optional methods.
9516
9517 2003-05-12  Martin Baulig  <martin@ximian.com>
9518
9519         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9520         only used for locals and not for parameters.
9521
9522 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9523
9524         * support.cs (InternalParameters.ParameterType): Return the
9525         ExternalType of the parameter.
9526
9527         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9528         they were unused.
9529
9530 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9531
9532         * class.cs (MethodData.Define): Do not set the `newslot' on
9533         interface members, if they are also flagged as "override".
9534
9535         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9536         better code for ++i and i++.  This only works for static fields
9537         and local variables.
9538
9539         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9540         want to pull the DeclSpace out of the builder_to_declspace instead
9541         of the TypeBuilder (like in TypeContainer.FindMembers).
9542
9543         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9544         instead of LookupTypeContainer.  Fixes the crash on .NET for
9545         looking up interface members.
9546
9547         * const.cs: Create our own emit context during the Definition
9548         stage, so that constants are evaluated in the proper context, when
9549         a recursive definition happens.
9550
9551 2003-05-11  Martin Baulig  <martin@ximian.com>
9552
9553         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9554         new block for a switch section.
9555         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9556         the adding/lookup in the switch block.  Fixes #39828.
9557
9558 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9559
9560         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9561         functionality: I needed to convert the data after I had performed
9562         the add/sub operation into the operands type size.
9563
9564         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9565         pass the type for the box operation, otherwise the resulting
9566         object would have been of type object.
9567
9568         (BoxedCast): Add constructor to specify the type to box as.
9569
9570 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9571
9572         * iterators.cs: I was reusing the `count' variable inadvertently,
9573         take steps to not allow this to happen.
9574
9575 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9576
9577         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9578         by creating an array at the point where the params starts and
9579         putting all those arguments there, then adjusting the size of the
9580         array.
9581
9582 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9583
9584         * expression.cs (New.AddressOf): Implement interface
9585         IMemoryLocation.  This is used when the `new' operator is used in
9586         the context of an invocation to a method on a value type.
9587
9588         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9589         example. 
9590
9591         * namespace.cs: Also check the using aliases here.
9592
9593         * driver.cs: Move the test for using validity after the types have
9594         been entered, so we do a single pass that also includes the using
9595         aliases. 
9596
9597         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9598         in the regular case.   CreateSiblingForFinally is doing extra
9599         error checking.
9600
9601         * attribute.cs (GetAttributeArgumentExpression): Store the result
9602         on an out value, and use the return value to indicate failure
9603         instead of using null (which is a valid return for Constant.GetValue).
9604
9605         * statement.cs: Perform the analysis flow for the increment
9606         portion after the statement, because this will be the real flow of
9607         execution.  Fixes #42385
9608
9609         * codegen.cs (EmitContext.EmitArgument,
9610         EmitContext.EmitStoreArgument): New helper functions when the
9611         RemapToProxy flag is set.
9612
9613         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9614         function.
9615
9616         Add support for remapping parameters. 
9617
9618         * iterators.cs: Propagate parameter values;  Store parameter
9619         values in the proxy classes.
9620
9621 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9622
9623         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9624         need a proxy reference;  I do not know what I was thinking
9625
9626         * cs-parser.jay (constructor_initializer): catch another error,
9627         and display nice message.
9628
9629         (field_declaration): catch void field declaration
9630         to flag a better error. 
9631
9632         * class.cs (MemberBase.CheckBase): Report an error instead of a
9633         warning if a new protected member is declared in a struct. 
9634         (Field.Define): catch the error of readonly/volatile.
9635
9636         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9637
9638         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9639         volatile variable is taken
9640
9641 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9642
9643         * statement.cs (Fixed.Resolve): Report an error if we are not in
9644         an unsafe context.
9645
9646 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9647
9648         * typemanager.cs: reuse the code that handles type clashes for
9649         delegates and enumerations.
9650
9651         * class.cs (Report28): Always report.
9652
9653         * expression.cs (EncodeAsAttribute): Allow nulls here.
9654
9655 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9656
9657         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9658         the functionality for testing whether an expression is valid for
9659         an attribute here.  Also handle the case of arrays of elements
9660         being stored. 
9661
9662         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9663         encoding a linear array into an array of objects that are suitable
9664         to be passed to an CustomAttributeBuilder.
9665
9666         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9667
9668         * ecore.cs: (FieldExpr): Handle field remapping here.
9669
9670         * iteratators.cs: Pass the instance variable (if the method is an
9671         instance method) to the constructors, so we can access the field
9672         variables on the class.
9673
9674         TODO: Test this with structs.  I think the THIS variable on
9675         structs might have to be a pointer, and not a refenrece
9676
9677 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9678
9679         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9680         local variables to fields in a proxy class.
9681
9682         * iterators.cs (PopulateProxy): Rename our internal fields to
9683         <XXX>.  
9684         Create a <THIS> field if we are an instance method, so we can
9685         reference our parent container variables.
9686         (MapVariable): Called back from the EmitContext code to enter a
9687         new variable to field mapping into the proxy class (we just create
9688         a FieldBuilder).
9689
9690         * expression.cs
9691         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9692         for using the remapped locals to fields.
9693
9694         I placed the code here, because that gives the same semantics to
9695         local variables, and only changes the Emit code.
9696
9697         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9698         statements inside iterators.
9699         (VariableInfo): Add a FieldBuilder for the cases when we are
9700         remapping local variables to fields in a proxy class
9701
9702         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9703         current_block != null.
9704
9705         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9706         not cope with strings, as it has been moved to the
9707         TableSwitchEmit.  Fixed bug in switch generation.
9708
9709         * expression.cs (New.DoResolve): Provide more context for the user
9710         when reporting an error.
9711
9712         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9713         pointers. 
9714
9715         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9716         check the permissions for it.  Note than in a type-resolution
9717         context the check was already present in DeclSpace.ResolveType,
9718         but was missing from the MemberAccess.
9719
9720         (ArrayCreation.CheckIndices): warn if the user has
9721         more nested levels of expressions, but there are no more
9722         dimensions specified.  Avoids crash on bug 41906.
9723
9724 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9725
9726         * statement.cs (Block): replace Implicit bool, for a generic
9727         flags.   
9728         New flag: `Unchecked'.  This is used during the EmitMeta phase
9729         (which is out-of-line with the regular Resolve/Emit process for a
9730         statement, as this is done ahead of time, but still gets a chance
9731         to call constant resolve).
9732
9733         (Block.Flags): new enum for adding a new flag.
9734
9735         (Block.EmitMeta): track the state of unchecked.
9736
9737         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9738         to enable constant resolution to work there as well.
9739
9740 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9741
9742         * typemanager.cs (ienumerable_type): Also look up
9743         System.Collections.IEnumerable. 
9744
9745 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9746
9747         TODO: Test more than one conditional per method.
9748
9749         * class.cs (Indexer.Define): Report the location where the user is
9750         referencing the unsupported feature.
9751
9752         (MethodData): Overload the use of `conditionals' to
9753         minimize the creation of needless ArrayLists.   This saves roughly
9754         212kb on my machine.
9755
9756         (Method): Implement the new IIteratorContainer interface.
9757         (Method.SetYields): Implement the method by setting the ModFlags
9758         to contain METHOD_YIELDS.
9759
9760         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9761         which just got set to null.
9762
9763         * iterators.cs: New file.
9764
9765         (Yield, YieldBreak): New statements.
9766
9767         * statement.cs (Return.Resolve): Flag an error if we are used in
9768         an iterator method.
9769
9770         * codegen.cs (InIterator): New flag set if the code is being
9771         compiled in an iterator method.
9772
9773         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9774         internal modifier, and we just use it to avoid adding extra
9775         fields, as this is seldom used.  
9776
9777         * cs-parser.jay: Add yield_statement (yield and yield break).
9778
9779         * driver.cs: New flag -v2 to turn on version 2 features. 
9780
9781         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9782         hashtable when v2 is enabled.
9783
9784 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9785
9786         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9787         there is already a namespace defined with this name.
9788
9789         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9790         people upgraded their corlibs.
9791
9792         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9793         always use fully qualified types, no need to use the compiler
9794         front end.
9795
9796         (TypeManager.IsNamespace): Use binarysearch.
9797
9798         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9799         AddDelegate): I did not quite use the new IsValid API properly: I
9800         have to pass the short-name and the fullname.  I was passing only
9801         the basename instead of the fullname sometimes. 
9802
9803         (TypeContainer.DefineType): call NamespaceClash.
9804
9805         * interface.cs (Interface.DefineType): use NamespaceClash before
9806         defining the type.
9807
9808         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9809         defining the type.
9810
9811         * enum.cs: (Enum.DefineType): use NamespaceClash before
9812         defining the type.
9813
9814         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9815         speed increase.  First, use the negative_hits cache when we get a
9816         negative.  Second, add the type with its full original name
9817         instead of the new . and + encoded name (reflection uses + to
9818         separate type from a nested type).  Use LookupTypeReflection
9819         directly which bypasses the type->name hashtable (that we already
9820         know does not contain the type.
9821
9822         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9823         location/container type. 
9824
9825         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9826
9827 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9830
9831         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9832         method is being referenced in the method group from a static
9833         context, and report error 120 if so.
9834
9835         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9836         Error118. 
9837
9838         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9839         is created, we create the A namespace).
9840
9841         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9842         Fixes #41591
9843
9844 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9845
9846         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9847         invocation to ModuleBuilder.GetType with the same values will
9848         return a new type instance, so we need to cache its return
9849         values. 
9850
9851         * expression.cs (Binary.ResolveOperator): Only allow the compare
9852         operators on enums if they are of the same type.
9853
9854         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9855         types of ValueType on their own case.  Before we were giving them
9856         the same treatment as objects.
9857
9858         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9859         fullname.  Short name is used to compare against container name.
9860         Fullname is used to check against defined namespace names.
9861
9862         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9863         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9864
9865         (Method.CheckBase): Call parent.
9866         (MemberBase.CheckBase): Check for protected members on sealed
9867         classes.
9868         (PropertyBase.CheckBase): Call parent.
9869         (Field.Define): Call parent.
9870
9871         * report.cs: Negative error codes are now mapped to 8000 - code,
9872         so that the display is render more nicely.
9873
9874         * typemanager.cs: Do not use try/catch, instead report a regular
9875         error. 
9876
9877         (GetPointerType, GetReferenceType): These methods provide
9878         mechanisms to obtain the T* and T& from a T.  We had the code
9879         previously scattered around the code base, and it also used
9880         TypeManager.LookupType that would go through plenty of caches.
9881         This one goes directly to the type source.
9882
9883         In some places we did the Type.GetType followed by
9884         ModuleBuilder.GetType, but not in others, so this unifies the
9885         processing as well.
9886
9887         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9888         statements now that we have namespace information.
9889
9890         * typemanager.cs (IsNamespace): New method, returns whether the
9891         string presented is a namespace or not.
9892
9893         (ComputeNamespaces): New public entry point, computes the list of
9894         available namespaces, using the GetNamespaces API call in Mono, or
9895         the slower version in MS.NET.   
9896
9897         Now before we start the semantic analysis phase, we have a
9898         complete list of namespaces including everything that the user has
9899         provided.
9900
9901         Deleted old code to cache namespaces in .nsc files.
9902
9903 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9904
9905         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9906         class/struct location definition Location for the implicit
9907         constructor location.
9908
9909         (Operator.Define): Use the location of the operator for the
9910         implicit Method definition.
9911
9912         (Constructor.Emit): use the constructor location for the implicit
9913         base initializer constructor.
9914
9915         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9916         and the Expression class now contains two new methods:
9917
9918         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9919         isolate type lookup from the rest of the resolution process.
9920
9921         Since we use Expressions to hold type definitions due to the way
9922         we parse the input we have historically overloaded Resolve to
9923         perform the Type lookups if a special flag is passed.  Now this is
9924         eliminated and two methods take their place. 
9925
9926         The differences in the two methods between xStep and xTerminal is
9927         that xStep is involved in our current lookup system that uses
9928         SimpleNames to compose a name, while xTerminal is used just to
9929         catch the case where the simplename lookup failed.
9930
9931 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9932
9933         * expression.cs (ResolveMemberAccess): Remove redundant code.
9934         TypeExpr expressions are always born fully resolved.
9935
9936         * interface.cs (PopulateMethod): Do not lookup the types twice.
9937         We were doing it once during SemanticAnalysis and once during
9938         PopulateMethod.
9939
9940         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9941         in local variable type definitions, were being returned as a
9942         SimpleName (we decomposed everything into a string), that is
9943         because primary_expression was being used instead of a type in the
9944         grammar (reduce/reduce conflicts).
9945
9946         The part that was wrong is that we converted the expression into a
9947         string (an oversimplification in one hand, compounded with primary
9948         expressions doing string concatenation).
9949
9950         So things like:
9951
9952         A.B.C [] x;
9953
9954         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9955         using clauses from working on this particular context.  And a type
9956         was being matched directly against "A.B.C[]".
9957
9958         We now use the correct approach, and allow for ComposedCast to be
9959         part of the unary expression.  So the "A.B.C []" become a composed
9960         cast of "A.B.C" (as a nested group of MemberAccess with a
9961         SimpleName at the end) plus the rank composition "[]". 
9962
9963         Also fixes 35567
9964
9965 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9966
9967         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9968         for the access level checking.
9969
9970         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9971         `TypeContainer container', because I kept getting confused when I
9972         was debugging this code.
9973
9974         * expression.cs (Indexers): Instead of tracking getters/setters,
9975         we now track them in parallel.  We create one arraylist less, but
9976         most importantly it is possible now for the LValue code to find a
9977         matching get for a set.
9978
9979         (IndexerAccess.DoResolveLValue): Update the code.
9980         GetIndexersForType has been modified already to extract all the
9981         indexers from a type.  The code assumed it did not.
9982
9983         Also make the code set the correct return type for the indexer.
9984         This was fixed a long time ago for properties, but was missing for
9985         indexers.  It used to be void_type.
9986
9987         (Binary.Emit): Test first for doubles instead of
9988         floats, as they are more common.
9989
9990         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9991         when dealing with floats and the <=, >= operators.  This fixes bug
9992         #39314 
9993
9994         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9995         to load the array value by emitting a load on the foreach variable
9996         type.  This was incorrect.  
9997
9998         We now emit the code to load an element using the the array
9999         variable type, and then we emit the conversion operator.
10000
10001         Fixed #40176
10002
10003 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10004
10005         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10006
10007 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10008
10009         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10010         test for protection before we test for signatures. 
10011
10012         (MethodSignature.ToString): implement.
10013
10014         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10015         to the case where we reduced into a LongConstant.
10016
10017         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10018         depend on whether the information is acurrate, because the
10019         Microsoft runtime will always claim that the array type is public,
10020         regardless of the real state.
10021
10022         If the type is a pointer, another problem happens: the type is
10023         reported as non-public in Microsoft.  
10024
10025         In both cases we have to call CheckAccessLevel recursively with
10026         the underlying type as the argument to be tested.
10027
10028 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10029
10030         * assign.cs (Assign.Emit): If we are dealing with a compound
10031         assignment expression, we should use the code path that stores the
10032         intermediate result in a temporary value.  This fixes #40903.
10033
10034         *expression.cs (Indirection.ToString): Provide ToString method for
10035         debugging. 
10036
10037 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10038
10039         * class.cs: Null out fields holding references to Block objects so
10040         they can be garbage collected.
10041
10042         * expression.cs (OverloadResolve): Remove unused local.
10043
10044 2003-04-07  Martin Baulig  <martin@ximian.com>
10045
10046         * codegen.cs (EmitContext.CurrentFile): New public field.
10047         (EmitContext.Mark): Use the CurrentFile to check whether the
10048         location is in the correct file.
10049         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10050
10051 2003-04-07  Martin Baulig  <martin@ximian.com>
10052
10053         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10054
10055         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10056         location.  [FIXME: The location argument which gets passed to this
10057         method is sometimes wrong!]
10058
10059 2003-04-07  Nick Drochak <ndrochak@gol.com>
10060
10061         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10062
10063 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10064
10065         * expression.cs (Indirection.EmitAssign): We were using the
10066         temporary, but returning immediately instead of continuing the
10067         EmitAssing flow.
10068
10069 2003-04-06  Martin Baulig  <martin@ximian.com>
10070
10071         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10072         if it's a nested child, but also deriving from the outer class.
10073         See test 190.cs.
10074
10075         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10076         nested child, but also deriving from the outer class.  See
10077         test-190.cs.
10078         (FilterWithClosure): We may access private members of the outer
10079         class if we're a nested child and deriving from the outer class.
10080         (RealMemberLookup): Only set `closure_private_ok' if the
10081         `original_bf' contained BindingFlags.NonPublic.
10082
10083 2003-04-05  Martin Baulig  <martin@ximian.com>
10084
10085         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10086
10087 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10088
10089         * class.cs (Event.Define): Do not allow abstract events to have
10090         initializers. 
10091
10092 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10093
10094         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10095         block in event declarations.
10096
10097         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10098         value type, get its address.
10099
10100         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10101         leaving a class on the stack instead of a boolean value (int
10102         0/1).  Change the code so we compare against null, and then the
10103         result against zero.
10104
10105         * class.cs (TypeContainer.GetClassBases): We were checking for the
10106         parent class being sealed too late.
10107
10108         * expression.cs (Binary.Emit): For <= and >= when dealing with
10109         floating point values, use cgt.un and clt.un instead of cgt and
10110         clt alone.
10111
10112 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10113
10114         * statement.cs: Apply the same optimization as MS: skip the 
10115         GetEnumerator returning an IEnumerator, and use the one returning a 
10116         CharEnumerator instead. This allows us to avoid the try-finally block 
10117         and the boxing.
10118
10119 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10120
10121         * cs-parser.jay: Attributes cannot be applied to
10122                          namespaces. Fixes #40473
10123
10124 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10125
10126         * class.cs:
10127         (Add*): check if the name is valid using the full name for constants,
10128         fields, properties and events.
10129
10130 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10131
10132         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10133         char constants to be part of the enumeration.
10134
10135         * expression.cs (Conditional.DoResolve): Add support for operator
10136         true. Implements the missing functionality from 14.12
10137
10138         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10139         operator true/false as required by the spec.
10140
10141         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10142         implicit conversion to boolean.
10143
10144         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10145         also one where the type implements `operator true'. 
10146
10147         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10148         get an expression that will invoke operator true based on an
10149         expression.  
10150
10151         (GetConversionOperators): Removed the hack that called op_True
10152         here.  
10153
10154         (Expression.ResolveBoolean): Move this from Statement.
10155
10156 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10157
10158         * ecore.cs (FieldExpr): do not allow initialization of initonly
10159         fields on derived classes
10160
10161 2003-03-13  Martin Baulig  <martin@ximian.com>
10162
10163         * statement.cs (Block.Emit): Call ig.BeginScope() and
10164         ig.EndScope() when compiling with debugging info; call
10165         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10166
10167 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10168
10169         * expression.cs (Indexers): Do not construct immediately, allow
10170         for new members to be appended as we go.  Fixes 38143
10171
10172 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10173
10174         * expression.cs: save/restore context when resolving an unchecked
10175         expression.
10176
10177 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10178
10179         * cfold.cs: Catch division by zero in modulus operator during
10180         constant folding.
10181
10182 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10183
10184         * interface.cs (Interface.DefineMembers): Avoid defining members
10185         twice. 
10186
10187 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10188
10189         * driver.cs: handle the +/- options for -noconfig
10190
10191         * statement.cs (Unckeched.Resolve): Also track the state of
10192         unchecked in the Resolve phase.
10193
10194 2003-02-27  Martin Baulig  <martin@ximian.com>
10195
10196         * ecore.cs (Expression.MemberLookup): Don't create a
10197         MethodGroupExpr for something which is not a method.  Fixes #38291.
10198
10199 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10200
10201         * class.cs (MemberBase.CheckParameters): Also check that the type
10202         is unmanaged if it is a pointer.
10203
10204         * expression.cs (SizeOf.Resolve): Add location information.
10205
10206         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10207         a managed type is declared.
10208
10209         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10210         parameter modifiers as well.  Fixes bug 38606
10211
10212         * class.cs: Very sad.  Am backing out the speed up changes
10213         introduced by the ArrayList -> Array in the TypeContainer, as they
10214         were not actually that much faster, and introduced a bug (no error
10215         reports on duplicated methods).
10216
10217         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10218         source first, this will guarantee that we have a valid expression
10219         before calling in lower levels functions that will require a
10220         resolved object.  Then use this original_source in the
10221         target.ResolveLValue instead of the original source that was
10222         passed to us.
10223
10224         Another change.  Use target.Resolve instead of LValueResolve.
10225         Although we are resolving for LValues, we will let the Assign code
10226         take care of that (it will be called again from Resolve).  This
10227         basically allows code like this:
10228
10229         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10230         class Y { void A (X x) { x [0] += o; }
10231
10232         The problem was that the indexer was trying to resolve for
10233         set_Item (idx, object o) and never finding one.  The real set_Item
10234         was set_Item (idx, X).  By delaying the process we get the right
10235         semantics. 
10236
10237         Fixes bug 36505
10238
10239 2003-02-23  Martin Baulig  <martin@ximian.com>
10240
10241         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10242         while calling DoEmit ().
10243
10244         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10245         source files; if you use the #line directive inside a method, the
10246         compiler stops emitting line numbers for the debugger until it
10247         reaches the end of the method or another #line directive which
10248         restores the original file.
10249
10250 2003-02-23  Martin Baulig  <martin@ximian.com>
10251
10252         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10253
10254 2003-02-23  Martin Baulig  <martin@ximian.com>
10255
10256         * statement.cs (Block.AddChildVariableNames): We need to call this
10257         recursively, not just for our immediate children.
10258
10259 2003-02-23  Martin Baulig  <martin@ximian.com>
10260
10261         * class.cs (Event.Define): Always make the field private, like csc does.
10262
10263         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10264         actually work, fixes bug #37521.
10265
10266 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10267
10268         * delegate.cs: When creating the various temporary "Parameters"
10269         classes, make sure that we call the ComputeAndDefineParameterTypes
10270         on those new parameters (just like we do with the formal ones), to
10271         allow them to be resolved in the context of the DeclSpace.
10272
10273         This fixes the bug that Dick observed in Bugzilla #38530.
10274
10275 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10276
10277         * expression.cs (ResolveMemberAccess): When resolving a constant,
10278         do not attempt to pull a constant if the value was not able to
10279         generate a valid constant.
10280
10281         * const.cs (LookupConstantValue): Do not report more errors than required.
10282
10283 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10284
10285         * expression.cs: fixes bug #38328.
10286
10287 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10288
10289         * class.cs: Changed all the various members that can be part of a
10290         class from being an ArrayList to be an Array of the right type.
10291         During the DefineType type_list, interface_list, delegate_list and
10292         enum_list are turned into types, interfaces, delegates and enums
10293         arrays.  
10294
10295         And during the member population, indexer_list, event_list,
10296         constant_list, field_list, instance_constructor_list, method_list,
10297         operator_list and property_list are turned into their real arrays.
10298
10299         Although we could probably perform this operation earlier, for
10300         good error reporting we need to keep the lists and remove the
10301         lists for longer than required.
10302
10303         This optimization was triggered by Paolo profiling the compiler
10304         speed on the output of `gen-sample-program.pl' perl script. 
10305
10306         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10307         not crash in methods like MemberLookupFailed that use this field.  
10308
10309         This problem arises when the compiler fails to resolve a type
10310         during interface type definition for example.
10311
10312 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10315         inherit from System.Object, so we have to stop at null, not only
10316         when reaching System.Object.
10317
10318 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10319
10320         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10321         DeclaredOnly because the parent indexer might have had a different
10322         name, but did not loop until the top of the hierarchy was reached.
10323
10324         The problem this one fixes is 35492: when a class implemented an
10325         indexer from an interface, we were getting the interface method
10326         (which was abstract) and we were flagging an error (can not invoke
10327         abstract method).
10328
10329         This also keeps bug 33089 functioning, and test-148 functioning.
10330
10331         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10332         out if a method is special is to see if it is declared in a
10333         property or event, or whether it is one of the predefined operator
10334         names.   This should fix correctly #36804.
10335
10336 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10337
10338         The goal here is to remove the dependency on EmptyCast.Peel ().
10339         Killing it completely.
10340
10341         The problem is that currently in a number of places where
10342         constants are expected, we have to "probe" for an EmptyCast, and
10343         Peel, which is not the correct thing to do, as this will be
10344         repetitive and will likely lead to errors. 
10345
10346         The idea is to remove any EmptyCasts that are used in casts that
10347         can be reduced to constants, so we only have to cope with
10348         constants. 
10349
10350         This bug hunt was triggered by Bug 37363 and the desire to remove
10351         the duplicate pattern where we were "peeling" emptycasts to check
10352         whether they were constants.  Now constants will always be
10353         constants.
10354
10355         * ecore.cs: Use an enumconstant here instead of wrapping with
10356         EmptyCast.  
10357
10358         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10359         throwing me off.  By handling this we can get rid of a few hacks.
10360
10361         * statement.cs (Switch): Removed Peel() code.
10362
10363 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10364
10365         * class.cs: Location information for error 508
10366
10367         * expression.cs (New.DoResolve): Add a guard against double
10368         resolution of an expression.  
10369
10370         The New DoResolve might be called twice when initializing field
10371         expressions (see EmitFieldInitializers, the call to
10372         GetInitializerExpression will perform a resolve on the expression,
10373         and later the assign will trigger another resolution
10374
10375         This leads to bugs (#37014)
10376
10377         * delegate.cs: The signature for EndInvoke should contain any ref
10378         or out parameters as well.  We were not doing this in the past. 
10379
10380         * class.cs (Field.Define): Do not overwrite the type definition
10381         inside the `volatile' group.  Turns out that volatile enumerations
10382         were changing the type here to perform a validity test, which
10383         broke conversions. 
10384
10385 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10386
10387         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10388         and structs, we do not want to load the instance variable
10389
10390         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10391         enum_type has to be handled like an object reference (implicit
10392         conversions exists from this to object), but the regular IsClass
10393         and IsValueType tests will never return true for this one.
10394
10395         Also we use TypeManager.IsValueType instead of type.IsValueType,
10396         just for consistency with the rest of the code (this is only
10397         needed if we ever use the construct exposed by test-180.cs inside
10398         corlib, which we dont today).
10399
10400 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10401
10402         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10403         just InternalCall.
10404
10405 2003-02-09  Martin Baulig  <martin@ximian.com>
10406
10407         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10408         (Namespace.DefineNamespaces): New static public method; this is
10409         called when we're compiling with debugging to add all namespaces
10410         to the symbol file.
10411
10412         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10413         pass it to the Namespace's .ctor.
10414
10415         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10416         and MethodBase arguments; pass the namespace ID to the symwriter;
10417         pass the MethodBase instead of the token to the symwriter.
10418         (SymbolWriter.DefineNamespace): New method to add a namespace to
10419         the symbol file.
10420
10421 2003-02-09  Martin Baulig  <martin@ximian.com>
10422
10423         * symbolwriter.cs: New file.  This is a wrapper around
10424         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10425         methods here in near future.
10426
10427 2003-02-09  Martin Baulig  <martin@ximian.com>
10428
10429         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10430         ILGenerator.MarkSequencePoint() which are actually used by the
10431         symbol writer.
10432
10433 2003-02-09  Martin Baulig  <martin@ximian.com>
10434
10435         * location.cs (SourceFile): New public sealed class.  This
10436         contains the name and an index which is used in the location's token.
10437         (Location): Reserve an appropriate number of bits in the token for
10438         the source file instead of walking over that list, this gives us a
10439         really huge performance improvement when compiling with debugging.
10440
10441         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10442         `SourceFile' argument instead of a string.
10443         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10444         but don't parse/tokenize here, we need to generate the list of all
10445         source files before we do that.
10446         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10447         the files.
10448
10449         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10450         instead of a string.
10451
10452         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10453         of a string.
10454
10455 2003-02-09  Martin Baulig  <martin@ximian.com>
10456
10457         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10458         filename on `#line default'.
10459
10460 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10461
10462         * statement.cs: don't clear the pinned var when the fixed statement
10463         returns from the method (fixes bug#37752).
10464
10465 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10466
10467         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10468         to IsValueType.
10469
10470 2003-02-07  Martin Baulig  <martin@ximian.com>
10471
10472         * driver.cs: Removed the `--debug-args' command line argument.
10473
10474         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10475         automatically by the AsssemblyBuilder.
10476         (CodeGen.InitializeSymbolWriter): We don't need to call any
10477         initialization function on the symbol writer anymore.  This method
10478         doesn't take any arguments.
10479
10480 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10481
10482         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10483         from referenced assemblies as well.
10484
10485 2003-02-02  Martin Baulig  <martin@ximian.com>
10486
10487         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10488
10489 2003-02-02  Martin Baulig  <martin@ximian.com>
10490
10491         * class.cs (Constructor.Emit): Open the symbol writer before
10492         emitting the constructor initializer.
10493         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10494         single-stepping through constructor initializers.
10495
10496 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10497
10498         * class.cs: Handle error 549: do not allow virtual methods in
10499         sealed classes. 
10500
10501 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10502
10503         * decl.cs: Check access levels when resolving types
10504
10505 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10506
10507         * statement.cs: Add parameters and locals set in catch blocks that might 
10508         return to set vector
10509
10510 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * class.cs (Operator): Set the SpecialName flags for operators.
10513
10514         * expression.cs (Invocation.DoResolve): Only block calls to
10515         accessors and operators on SpecialName methods.
10516
10517         (Cast.TryReduce): Handle conversions from char constants.
10518
10519
10520 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10521
10522         * statement.cs: small memory and time optimization in FlowBranching.
10523
10524 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10525
10526         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10527         problem that the last fix but in the other sid (Set).
10528
10529         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10530         access when there is no indexer in the hierarchy.
10531
10532 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10533
10534         * class.cs: Combine some if statements.
10535
10536 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10537
10538         * driver.cs: fixed bug #37187.
10539
10540 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10541
10542         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10543         any indexer, it's needed to build a list with all the indexers in the
10544         hierarchy (AllGetters), else we have problems. Fixes #35653.
10545
10546 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10547
10548         * class.cs (MethodData.Define): It is wrong for an interface
10549         implementation to be static in both cases: explicit and implicit.
10550         We were only handling this in one case.
10551
10552         Improve the if situation there to not have negations.
10553
10554         * class.cs (Field.Define): Turns out that we do not need to check
10555         the unsafe bit on field definition, only on usage.  Remove the test.
10556
10557 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10558
10559         * driver.cs: use assembly.Location instead of Codebase (the latest
10560         patch made mcs fail when using MS assemblies).
10561
10562 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10563
10564         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10565         get the path to *corlib.dll.
10566
10567 2003-01-21  Nick Drochak <ndrochak@gol.com>
10568
10569         * cs-tokenizer.cs:
10570         * pending.cs:
10571         * typemanager.cs: Remove compiler warnings
10572
10573 2003-01-20  Duncan Mak  <duncan@ximian.com>
10574
10575         * AssemblyInfo.cs: Bump the version number to 0.19.
10576
10577 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10578
10579         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10580
10581 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10582
10583         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10584
10585 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10586
10587         * cs-parser.jay: Small fix: we were not comparing the constructor
10588         name correctly.   Thanks to Zoltan for the initial pointer.
10589
10590 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10591
10592         * cs-tokenizer.cs: Set file name when specified with #line
10593
10594 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10595
10596         * cs-parser.jay: Only perform the constructor checks here if we
10597         are named like the class;  This will help provider a better
10598         error.  The constructor path is taken when a type definition is
10599         not found, but most likely the user forgot to add the type, so
10600         report that rather than the constructor error.
10601
10602 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10603
10604         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10605         allocations.
10606
10607 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10608
10609         * cs-parser.jay: Add cleanup call.
10610
10611 2003-01-13  Duncan Mak  <duncan@ximian.com>
10612
10613         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10614         consistent with other methods.
10615
10616 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10617
10618         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10619
10620 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10621
10622         * attribute.cs: only set GuidAttr to true when we have a
10623         GuidAttribute.
10624
10625 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10626
10627         * ecore.cs:
10628         * expression.cs:
10629         * typemanager.cs: fixes to allow mcs compile corlib with the new
10630         Type.IsSubclassOf fix.
10631
10632 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10633
10634         * expression.cs (LocalVariableReference.DoResolve): Classify a
10635         constant as a value, not as a variable.   Also, set the type for
10636         the variable.
10637
10638         * cs-parser.jay (fixed_statement): take a type instead of a
10639         pointer_type, so we can produce a better error message later.
10640
10641         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10642         as an error.  
10643
10644         (For.DoEmit): Make inifinite loops have a
10645         non-conditional branch back.
10646
10647         (Fixed.DoEmit): First populate the pinned variables, then emit the
10648         statement, then clear the variables.  Before I was emitting the
10649         code once for each fixed piece.
10650
10651
10652 2003-01-08  Martin Baulig  <martin@ximian.com>
10653
10654         * statement.cs (FlowBranching.MergeChild): A break in a
10655         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10656
10657 2003-01-08  Martin Baulig  <martin@ximian.com>
10658
10659         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10660         lives in the same number space than `param_map'.  Fixes #36154.
10661
10662 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10663
10664         * cs-parser.jay (constructor_declaration): Set the
10665         Constructor.ModFlags before probing for it.  This makes the
10666         compiler report 514, 515 and 132 (the code was there, but got
10667         broken). 
10668
10669         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10670         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10671         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10672
10673 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10674
10675         * enum.cs: create the enum static fields using the enum type.
10676
10677 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10678
10679         * class.cs: don't try to create the ParamBuilder for the return
10680         type if it's not needed (and handle it breaking for the ms runtime
10681         anyway).
10682
10683 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10684
10685         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10686
10687 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10688
10689         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10690         the command.   This showed up while compiling the JANET source
10691         code, which used \r as its only newline separator.
10692
10693 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10694
10695         * class.cs (Method.Define): If we are an operator (because it
10696         reuses our code), then set the SpecialName and HideBySig.  #36128
10697
10698 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10699
10700         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10701         exception, report error 120 `object reference required'.
10702
10703         * driver.cs: Add --pause option, used during to measure the size
10704         of the process as it goes with --timestamp.
10705
10706         * expression.cs (Invocation.DoResolve): Do not allow methods with
10707         SpecialName to be invoked.
10708
10709 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10710
10711         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10712         number before adding it.
10713
10714 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10715
10716         * ecore.cs (StandardImplicitConversion): When in an unsafe
10717         context, we allow conversion between void * to any other pointer
10718         type. This fixes bug #35973.
10719
10720 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10721
10722         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10723         is not thrown when extensionless outputs are used 
10724
10725 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10726
10727         * rootcontext.cs: fixed compilation of corlib.
10728
10729 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10730
10731         * attribute.cs (Attributes.Contains): Add new method.
10732
10733         * class.cs (MethodCore.LabelParameters): if the parameter is an
10734         `out' parameter, check that no attribute `[In]' has been passed.
10735
10736         * enum.cs: Handle the `value__' name in an enumeration.
10737
10738 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10739
10740         * decl.cs: Added special case to allow overrides on "protected
10741         internal" methods
10742
10743 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10744
10745         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10746         since it makes much more sense.
10747
10748         (Attributes.ctor): Don't require a Location parameter.
10749
10750         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10751
10752         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10753         since we already have that information per attribute.
10754
10755         * everywhere : make appropriate changes.
10756
10757         * class.cs (LabelParameters): Write the code which actually
10758         applies attributes to the return type. We can't do this on the MS
10759         .NET runtime so we flag a warning in the case an exception is
10760         thrown.
10761
10762 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10763
10764         * const.cs: Handle implicit null conversions here too.
10765
10766 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10767
10768         * class.cs (MethodCore.LabelParameters): Remove the extra
10769         Type [] parameter since it is completely unnecessary. Instead
10770         pass in the method's attributes so that we can extract
10771         the "return" attribute.
10772
10773 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10774
10775         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10776         of ignoring it and letting the compile continue.
10777
10778         * typemanager.cs (ChangeType): use an extra argument to return an
10779         error condition instead of throwing an exception.
10780
10781 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10782
10783         * expression.cs (Unary.TryReduce): mimic the code for the regular
10784         code path.  Perform an implicit cast in the cases where we can
10785         implicitly convert to one of the integral types, and then reduce
10786         based on that constant.   This fixes bug #35483.
10787
10788 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10789
10790         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10791
10792 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10793
10794         * namespace.cs: fixed bug #35489.
10795
10796 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10797
10798         * class.cs: Remove some dead code.
10799
10800         * cs-parser.jay: Estimate the number of methods needed
10801         (RootContext.MethodCount);
10802
10803         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10804         numbers instead of StringBuilders.
10805
10806         * support.cs (PtrHashtable): Add constructor with initial size;
10807         We can now reduce reallocations of the method table.
10808
10809 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10810
10811         * attribute.cs (ApplyAttributes): Keep track of the emitted
10812         attributes on a per-target basis. This fixes bug #35413.
10813
10814 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10815
10816         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10817         default to the Windows 1252 encoding.
10818
10819         (UnixParseOption): Support version, thanks to Alp for the missing
10820         pointer. 
10821
10822         * AssemblyInfo.cs: Add nice assembly information.
10823
10824         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10825         (bug 35169).
10826
10827         * cs-parser.jay: Allow a trailing comma before the close bracked
10828         in the attribute_section production.
10829
10830         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10831         address of the instance was being taken, I will take this out,
10832         because we take the address of the object immediately here.
10833
10834 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10835
10836         * typemanager.cs (AreMultipleAllowed): Take care of the most
10837         obvious case where attribute type is not in the current assembly -
10838         stupid me ;-)
10839
10840 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10841
10842         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10843         definitions, instead of doing that afterwards.  
10844
10845         Also we use a nice little hack, depending on the constructor, we
10846         know if we are a "composed" name or a simple name.  Hence, we
10847         avoid the IndexOf test, and we avoid 
10848
10849         * codegen.cs: Add code to assist in a bug reporter to track down
10850         the source of a compiler crash. 
10851
10852 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10853
10854         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10855         types have been emitted for a given element and flag an error
10856         if something which does not have AllowMultiple set is used more
10857         than once.
10858
10859         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10860         attribute types and their corresponding AllowMultiple properties
10861
10862         (AreMultipleAllowed): Check the property for a given type.
10863
10864         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10865         property in the case we have a TypeContainer.
10866
10867         (Attributes.AddAttribute): Detect duplicates and just skip on
10868         adding them. This trivial fix catches a pretty gross error in our
10869         attribute emission - global attributes were being emitted twice!
10870
10871         Bugzilla bug #33187 is now fixed.
10872
10873 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10874
10875         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10876         instead of pp_and).
10877
10878         * expression.cs (Binary.ResolveOperator): I can only use the
10879         Concat (string, string, string) and Concat (string, string,
10880         string, string) if the child is actually a concatenation of
10881         strings. 
10882
10883 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10884
10885         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10886         context where we need a 2-character lookahead.
10887
10888         * pending.cs (PendingImplementation): Rework so we can keep track
10889         of interface types all the time, and flag those which were
10890         implemented by parents as optional.
10891
10892 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10893
10894         * expression.cs (Binary.ResolveOperator): Use
10895         String.Concat(string,string,string) or
10896         String.Concat(string,string,string,string) when possible. 
10897
10898         * typemanager: More helper methods.
10899
10900
10901 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10902
10903         * pending.cs: remove the bogus return from GetMissingInterfaces()
10904         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10905
10906 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10907
10908         * namespace.cs: avoid duplicated 'using xxx' being added to
10909         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10910         when we get more than one 'using' statement for the same namespace.
10911         Report a CS0105 warning for it.
10912
10913 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10914
10915         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10916         of calling getChar/putback, uses internal knowledge of it.    
10917
10918         (xtoken): Reorder tokenizer so most common patterns are checked
10919         first.  This reduces the compilation time in another 5% (from 8.11s
10920         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10921
10922         The parsing time is 22% of the compilation in mcs, and from that
10923         64% is spent on the tokenization process.  
10924
10925         I tried using a binary search for keywords, but this is slower
10926         than the hashtable.  Another option would be to do a couple of
10927         things:
10928
10929                 * Not use a StringBuilder, instead use an array of chars,
10930                   with a set value.  Notice that this way we could catch
10931                   the 645 error without having to do it *afterwards*.
10932
10933                 * We could write a hand-parser to avoid the hashtable
10934                   compares altogether.
10935
10936         The identifier consumption process takes 37% of the tokenization
10937         time.  Another 15% is spent on is_number.  56% of the time spent
10938         on is_number is spent on Int64.Parse:
10939
10940                 * We could probably choose based on the string length to
10941                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10942                   computations. 
10943
10944         Another 3% is spend on wrapping `xtoken' in the `token' function.
10945
10946         Handle 0xa0 as whitespace (#34752)
10947
10948 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10949
10950         * typemanager.cs (IsCLRType): New routine to tell whether a type
10951         is one of the builtin types.  
10952
10953         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10954         typecode in more places instead of doing pointer comparissions.
10955         We could leverage some knowledge about the way the typecodes are
10956         laid out.
10957
10958         New code to cache namespaces in assemblies, it is currently not
10959         invoked, to be used soon.
10960
10961         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10962
10963         * expression.cs (Binary.ResolveOperator): specially handle
10964         strings, and do not perform user-defined operator overloading for
10965         built-in types.
10966
10967 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10968
10969         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10970         internalcall as it is a pretty simple operation;  Avoid whenever
10971         possible to call Char.IsLetter.
10972
10973         (consume_identifier): Cut by half the number of
10974         hashtable calls by merging the is_keyword and GetKeyword behavior.
10975
10976         Do not short-circuit, because if we do, we
10977         report errors (ie, #if false && true would produce an invalid
10978         directive error);
10979
10980
10981 2002-11-24  Martin Baulig  <martin@ximian.com>
10982
10983         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10984         check constant ranges and report a CS0221.  Fixes #33186.
10985
10986 2002-11-24  Martin Baulig  <martin@ximian.com>
10987
10988         * cs-parser.jay: Make this work for uninitialized variable
10989         declarations in the `for' initializer.  Fixes #32416.
10990
10991 2002-11-24  Martin Baulig  <martin@ximian.com>
10992
10993         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10994         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10995
10996 2002-11-24  Martin Baulig  <martin@ximian.com>
10997
10998         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10999         argument; if true, we also check for user-defined conversions.
11000         This is only needed if both arguments are of a user-defined type.
11001         Fixes #30443, added test-175.cs.
11002         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11003
11004         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11005
11006 2002-11-24  Martin Baulig  <martin@ximian.com>
11007
11008         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11009         function to get the store opcode.
11010         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11011         only emit the Ldelema if the store opcode is Stobj.  You must run
11012         both test-34 and test-167 to test this.  Fixes #34529.
11013
11014 2002-11-23  Martin Baulig  <martin@ximian.com>
11015
11016         * ecore.cs (Expression.MemberLookup): Added additional
11017         `qualifier_type' argument which is used when we're being called
11018         from MemberAccess.DoResolve() and null if we're called from a
11019         SimpleName lookup.
11020         (Expression.MemberLookupFailed): New method to report errors; this
11021         does the CS1540 check and reports the correct error message.
11022
11023         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11024         argument for the CS1540 check and redone the way how we're dealing
11025         with private members.  See the comment in the source code for details.
11026         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11027         `closure_start_type' to `closure_qualifier_type' and check whether
11028         it's not null.  It was not this filter being broken, it was just
11029         being called with the wrong arguments.
11030
11031         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11032         and pass it the correct `qualifier_type'; this also does the error
11033         handling for us.
11034
11035 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11036
11037         * expression.cs (Invocation.EmitParams): If the we are dealing
11038         with a non-built-in value type, load its address as well.
11039
11040         (ArrayCreation): Use a a pretty constant instead
11041         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11042         static initializers.  
11043
11044         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11045         because they are not really value types, just glorified integers. 
11046
11047         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11048
11049         * ecore.cs: Remove redundant code for enumerations, make them use
11050         the same code path as everything else, fixes the casting issue
11051         with enumerations in Windows.Forms.
11052
11053         * attribute.cs: Do only cast to string if it is a string, the
11054         validation happens later.
11055
11056         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11057         people upgrade their corlibs.
11058
11059         * ecore.cs: Oops, enumerations were not following the entire code path
11060
11061 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11062
11063         * typemanager.cs (FilterWithClosure): Commented out the test for
11064         1540 in typemanager.cs, as it has problems when accessing
11065         protected methods from a parent class (see test-174.cs). 
11066
11067         * attribute.cs (Attribute.ValidateGuid): new method.
11068         (Attribute.Resolve): Use above.
11069
11070 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11071
11072         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11073
11074         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11075         handling for enumerations, as we only needed the TypeContainer
11076         functionality to begin with (this is required for the fix below to
11077         work for enums that reference constants in a container class for
11078         example). 
11079
11080         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11081
11082         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11083         a valid TypeBuilder to perform lookups on.o
11084
11085         * class.cs (InheritableMemberSignatureCompare): Use true in the
11086         call to GetGetMethod and GetSetMethod, because we are comparing
11087         the signature, and we need to get the methods *even* if they are
11088         private. 
11089
11090         (PropertyBase.CheckBase): ditto.
11091
11092         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11093         GotoCase.Resolve): Use Peel on EmpytCasts.
11094
11095         * ecore.cs (EmptyCast): drop child, add Peel method.
11096
11097 2002-11-17  Martin Baulig  <martin@ximian.com>
11098
11099         * ecore.cs (EmptyCast.Child): New public property.
11100
11101         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11102         label resolved to an EmptyCast.  Fixes #34162.
11103         (GotoCase.Resolve): Likewise.
11104         (Block.EmitMeta): Likewise.
11105
11106 2002-11-17  Martin Baulig  <martin@ximian.com>
11107
11108         * expression.cs (Invocation.BetterConversion): Prefer int over
11109         uint; short over ushort; long over ulong for integer literals.
11110         Use ImplicitConversionExists instead of StandardConversionExists
11111         since we also need to check for user-defined implicit conversions.
11112         Fixes #34165.  Added test-173.cs.
11113
11114 2002-11-16  Martin Baulig  <martin@ximian.com>
11115
11116         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11117         with the `true' and `false' literals.  Fixes #33151.
11118
11119 2002-11-16  Martin Baulig  <martin@ximian.com>
11120
11121         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11122         October 22nd; don't do the cs1540 check for static members.
11123
11124         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11125         now using our own filter here and doing the cs1540 check again.
11126
11127 2002-11-16  Martin Baulig  <martin@ximian.com>
11128
11129         * support.cs (InternalParameters): Don't crash if we don't have
11130         any fixed parameters.  Fixes #33532.
11131
11132 2002-11-16  Martin Baulig  <martin@ximian.com>
11133
11134         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11135         when looking up static methods to make this work on Windows.
11136         Fixes #33773.
11137
11138 2002-11-16  Martin Baulig  <martin@ximian.com>
11139
11140         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11141         a setter rather than using PropertyInfo.CanWrite.
11142
11143 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11144
11145         * class.cs: Allow acces to block member by subclasses. Fixes build
11146         breaker.
11147
11148 2002-11-14  Martin Baulig  <martin@ximian.com>
11149
11150         * class.cs (Constructor.Emit): Added the extern/block check.
11151         Fixes bug #33678.
11152
11153 2002-11-14  Martin Baulig  <martin@ximian.com>
11154
11155         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11156         iteration while looking for indexers, this is needed because the
11157         indexer may have a different name in our base classes.  Fixed the
11158         error reporting (no indexers at all, not get accessor, no
11159         overloaded match).  Fixes bug #33089.
11160         (IndexerAccess.DoResolveLValue): Likewise.
11161
11162 2002-11-14  Martin Baulig  <martin@ximian.com>
11163
11164         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11165         indexers.  Fixes the first part of bug #33089.
11166         (MethodSignature.InheritableMemberSignatureCompare): Added support
11167         for properties.
11168
11169 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11170
11171         * attribute.cs (Attribute.Resolve): Catch the
11172         NullReferenceException and report it since it isn't supposed to
11173         happen. 
11174
11175 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11176
11177         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11178         LogicalOr and LogicalAnd that can benefit from recursively
11179         handling EmitBranchable.  The code now should be nice for Paolo.
11180
11181 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11182
11183         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11184         the Type lookups, as we perform quite a number of lookups on
11185         non-Types.  This can be removed once we can deterministically tell
11186         whether we have a type or a namespace in advance.
11187
11188         But this might require special hacks from our corlib.
11189
11190         * TODO: updated.
11191
11192         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11193         and double which avoids a conversion from an integer to a double.
11194
11195         * expression.cs: tiny optimization, avoid calling IsConstant,
11196         because it effectively performs the lookup twice.
11197
11198 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11199
11200         But a bogus return here to keep the semantics of the old code
11201         until the Mono runtime is fixed.
11202
11203         * pending.cs (GetMissingInterfaces): New method used to remove all
11204         the interfaces that are already implemented by our parent
11205         classes from the list of pending methods. 
11206
11207         * interface.cs: Add checks for calls after ResolveTypeExpr.
11208
11209 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11210
11211         * class.cs (Class.Emit): Report warning 67: event not used if the
11212         warning level is beyond 3.
11213
11214         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11215         being a NullLiteral.
11216
11217         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11218         specifiers. 
11219
11220         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11221         path that might fail if a type can not be resolved.
11222
11223         * expression.cs (Binary.Emit): Emit unsigned versions of the
11224         operators. 
11225
11226         * driver.cs: use error 5.
11227
11228 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11229
11230         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11231
11232 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11233
11234         * cs-parser.jay (switch_section): A beautiful patch from Martin
11235         Baulig that fixed 33094.
11236
11237 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11238
11239         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11240         Check whether the base is abstract and report an error if so.
11241
11242         * expression.cs (IndexerAccess.DoResolveLValue,
11243         IndexerAccess.DoResolve): ditto. 
11244
11245         (Invocation.DoResolve): ditto.
11246
11247         (Invocation.FullMethodDesc): Improve the report string.
11248
11249         * statement.cs (Block): Eliminate IsVariableDefined as it is
11250         basically just a wrapper for GetVariableInfo.
11251
11252         * ecore.cs (SimpleName): Use new 
11253
11254         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11255         type, as we return the actual parameter ref/unref state on a
11256         different call.
11257
11258 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11259
11260         * support.cs: Return proper flags REF/OUT fixing the previous
11261         commit.  
11262
11263         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11264         not used to mean `ref' but `ref or out' in ParameterReference
11265
11266         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11267         full type signature instead of calling TypeManger.CSharpName
11268         ourselves. 
11269
11270         * support.cs (InternalParameters.ParameterDesc): Do not compare
11271         directly to the modflags, because REF/OUT will actually be bitsets
11272         if set. 
11273
11274         * delegate.cs (VerifyMethod): Check also the modifiers.
11275
11276         * cs-tokenizer.cs: Fix bug where floating point values with an
11277         exponent where a sign was missing was ignored.
11278
11279         * driver.cs: Allow multiple assemblies to be specified in a single
11280         /r: argument
11281
11282 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11283
11284         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11285         because identifiers after a parenthesis would end up in this kind
11286         of production, and we needed to desamiguate it for having casts
11287         like:
11288
11289                 (UserDefinedType *) xxx
11290
11291 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11292
11293         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11294         we should set on the Bindingflags.NonPublic, but not turn on
11295         private_ok.  private_ok controls whether a Private member is
11296         returned (this is chekced on the filter routine), while the
11297         BindingFlags.NonPublic just controls whether private/protected
11298         will be allowed.   This fixes the problem part of the problem of
11299         private properties being allowed to be used in derived classes.
11300
11301         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11302         so we can call the children DoResolveLValue method (this will
11303         properly signal errors on lvalue assignments to base properties)
11304
11305         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11306         getter are null, and we have a property info, we know that this
11307         happened because the lookup failed, so we report an error 122 for
11308         protection level violation.
11309
11310         We also silently return if setter and getter are null in the
11311         resolve functions, this condition only happens if we have flagged
11312         the error before.  This is the other half of the problem. 
11313
11314         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11315         not have accessibility information, that is why we were returning
11316         true in the filter function in typemanager.cs.
11317
11318         To properly report 122 (property is inaccessible because of its
11319         protection level) correctly, we report this error in ResolveAccess
11320         by failing if both the setter and the getter are lacking (ie, the
11321         lookup failed). 
11322
11323         DoResolve and DoLResolve have been modified to check for both
11324         setter/getter being null and returning silently, the reason being
11325         that I did not want to put the knowledge about this error in upper
11326         layers, like:
11327
11328         int old = Report.Errors;
11329         x = new PropertyExpr (...);
11330         if (old != Report.Errors)
11331                 return null;
11332         else
11333                 return x;
11334
11335         So the property expr is returned, but it is invalid, so the error
11336         will be flagged during the resolve process. 
11337
11338         * class.cs: Remove InheritablePropertySignatureCompare from the
11339         class, as we no longer depend on the property signature to compute
11340         whether it is possible to implement a method or not.
11341
11342         The reason is that calling PropertyInfo.GetGetMethod will return
11343         null (in .NET, in Mono it works, and we should change this), in
11344         cases where the Get Method does not exist in that particular
11345         class.
11346
11347         So this code:
11348
11349         class X { public virtual int A { get { return 1; } } }
11350         class Y : X { }
11351         class Z : Y { public override int A { get { return 2; } } }
11352
11353         Would fail in Z because the parent (Y) would not have the property
11354         defined.  So we avoid this completely now (because the alternative
11355         fix was ugly and slow), and we now depend exclusively on the
11356         method names.
11357
11358         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11359         reference method, instead of using the property.
11360
11361         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11362         routines are gone now.
11363
11364         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11365         names, they were incorrectly named.
11366
11367         * cs-tokenizer.cs: Return are more gentle token on failure. 
11368
11369         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11370         had an out-of-sync index variable, which caused it to remove from
11371         the list of pending methods the wrong method sometimes.
11372
11373 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11374
11375         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11376         CanWrite, because those refer to this particular instance of the
11377         property, and do not take into account the fact that we can
11378         override single members of a property.
11379
11380         Constructor requires an EmitContext.  The resolution process does
11381         not happen here, but we need to compute the accessors before,
11382         because the resolution does not always happen for properties.
11383
11384         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11385         subclass, before we did not update this flag, but we did update
11386         bindingflags. 
11387
11388         (GetAccessors): Drop this routine, as it did not work in the
11389         presence of partially overwritten set/get methods. 
11390
11391         Notice that this broke the cs1540 detection, but that will require
11392         more thinking. 
11393
11394 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11395
11396         * class.cs:
11397         * codegen.cs:
11398         * driver.cs: issue a warning instead of an error if we don't support
11399         debugging for the platform. Also ignore a couple of errors that may
11400         arise when trying to write the symbols. Undo my previous patch.
11401
11402 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11403
11404         * driver.cs: ignore /debug switch except for Unix platforms.
11405
11406 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11407
11408         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11409
11410 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11411
11412         * driver.cs: Do not make mcs-debug conditional, so we do not break
11413         builds that use it.
11414
11415         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11416         review this patch.  But basically after all the children variables
11417         have been merged, the value of "Breaks" was not being set to
11418         new_breaks for Switch blocks.  I think that it should be set after
11419         it has executed.  Currently I set this to the value of new_breaks,
11420         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11421         conservative, but I do not understand this code very well.
11422
11423         I did not break anything in the build, so that is good ;-)
11424
11425         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11426
11427 2002-10-20  Mark Crichton  <crichton@gimp.org>
11428
11429         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11430
11431 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11432
11433         * cfold.cs: Fixed compile blocker.
11434
11435 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11436
11437         * driver.cs: I was chekcing the key, not the file.
11438
11439 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11440
11441         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11442         message that we were generating - we just need to silently return
11443         a null.
11444
11445 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11446
11447         * class.cs (Event.Define): Change my previous commit, as this
11448         breaks the debugger.  This is a temporary hack, as it seems like
11449         the compiler is generating events incorrectly to begin with.
11450
11451         * expression.cs (Binary.ResolveOperator): Added support for 
11452         "U operator - (E x, E y)"
11453
11454         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11455         y)".
11456
11457         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11458         init-only variables, but this path did not take into account that
11459         there might be also instance readonly variables.  Correct this
11460         problem. 
11461
11462         This fixes bug 32253
11463
11464         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11465         delegates as well.
11466
11467         * driver.cs: Change the extension for modules to `netmodule'
11468
11469         * cs-parser.jay: Improved slightly the location tracking for
11470         the debugger symbols.
11471
11472         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11473         modifiers that were specified instead of the hardcoded value
11474         (FamAndAssem).  This was basically ignoring the static modifier,
11475         and others.  Fixes 32429.
11476
11477         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11478         fixed a bug in the process (32476)
11479
11480         * expression.cs (ArrayAccess.EmitAssign): Patch from
11481         hwang_rob@yahoo.ca that fixes bug 31834.3
11482
11483 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11484
11485         * driver.cs: Make the module extension .netmodule.
11486
11487 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11488
11489         * driver.cs: Report an error if the resource file is not found
11490         instead of crashing.
11491
11492         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11493         false, like Emit does.
11494
11495 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11496
11497         * typemanager.cs: Remove unused private member.  Also reported mcs
11498         bug to report this as a warning like csc.
11499
11500 2002-10-15  Martin Baulig  <martin@gnome.org>
11501
11502         * statement.cs (Statement.Emit): Made this a virtual method; emits
11503         the line number info and calls DoEmit().
11504         (Statement.DoEmit): New protected abstract method, formerly knows
11505         as Statement.Emit().
11506
11507         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11508
11509 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11510
11511         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11512         have fixed a remaining problem: not every AddXXXX was adding a
11513         fully qualified name.  
11514
11515         Now everyone registers a fully qualified name in the DeclSpace as
11516         being defined instead of the partial name.  
11517
11518         Downsides: we are slower than we need to be due to the excess
11519         copies and the names being registered this way.  
11520
11521         The reason for this is that we currently depend (on the corlib
11522         bootstrap for instance) that types are fully qualified, because
11523         we dump all the types in the namespace, and we should really have
11524         types inserted into the proper namespace, so we can only store the
11525         basenames in the defined_names array.
11526
11527 2002-10-10  Martin Baulig  <martin@gnome.org>
11528
11529         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11530         from bug #31834, see the bug report for a testcase which is
11531         miscompiled.
11532
11533 2002-10-10  Martin Baulig  <martin@gnome.org>
11534
11535         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11536         flow analysis code for this.
11537
11538         * statement.cs (Do, While, For): Tell the flow analysis code about
11539         infinite loops.
11540         (FlowBranching.UsageVector): Added support for infinite loops.
11541         (Block.Resolve): Moved the dead code elimination here and use flow
11542         analysis to do it.
11543
11544 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11545
11546         * class.cs (Field.Define): Catch cycles on struct type
11547         definitions. 
11548
11549         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11550         fields if the fields are static.  We only need to check instance
11551         fields. 
11552
11553         * expression.cs (As.DoResolve): Test for reference type.
11554
11555         * statement.cs (Using.ResolveExpression): Use
11556         ConvertImplicitRequired, not ConvertImplicit which reports an
11557         error on failture
11558         (Using.ResolveLocalVariableDecls): ditto.
11559
11560         * expression.cs (Binary.ResolveOperator): Report errors in a few
11561         places where we had to.
11562
11563         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11564
11565 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11566
11567         * expression.cs: Use StoreFromPtr instead of extracting the type
11568         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11569
11570         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11571         an enumeration value to a System.Enum, but System.Enum is not a
11572         value type, but an class type, so we need to box.
11573
11574         (Expression.ConvertExplicit): One codepath could return
11575         errors but not flag them.  Fix this.  Fixes #31853
11576
11577         * parameter.cs (Resolve): Do not allow void as a parameter type.
11578
11579 2002-10-06  Martin Baulig  <martin@gnome.org>
11580
11581         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11582         if it's a class type and not a struct.  Fixes #31815.
11583
11584 2002-10-06  Martin Baulig  <martin@gnome.org>
11585
11586         * statement.cs: Reworked the flow analysis code a bit to make it
11587         usable for dead code elimination.
11588
11589 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11590
11591         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11592
11593 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11594
11595         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11596         to fix the test 165, will investigate deeper.
11597
11598 2002-10-04  Martin Baulig  <martin@gnome.org>
11599
11600         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11601         finally blocks actually work.
11602         (Try.Resolve): We don't need to create a sibling for `finally' if
11603         there is no finally block.
11604
11605 2002-10-04  Martin Baulig  <martin@gnome.org>
11606
11607         * class.cs (Constructor.Define): The default accessibility for a
11608         non-default constructor is private, not public.
11609
11610 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11611
11612         * class.cs (Constructor): Make AllowedModifiers public, add
11613         EXTERN.
11614
11615         * cs-parser.jay: Perform the modifiers test here, as the
11616         constructor for the Constructor class usually receives a zero
11617         because of the way we create it (first we create, later we
11618         customize, and we were never checking the modifiers).
11619
11620         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11621         is a version of LookupTypeReflection that includes the type-name
11622         cache.  This can be used as a fast path for functions that know
11623         the fully qualified name and are only calling into *.GetType() to
11624         obtain a composed type.
11625
11626         This is also used by TypeManager.LookupType during its type
11627         composition.
11628
11629         (LookupType): We now also track the real type name, as sometimes
11630         we can get a quey for the real type name from things like
11631         ComposedCast.  This fixes bug 31422.
11632
11633         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11634         complete type fullname, it does not have to go through the type
11635         resolution system to obtain the composed version of the type (for
11636         obtaining arrays or pointers).
11637
11638         (Conditional.Emit): Use the EmitBoolExpression to
11639         generate nicer code, as requested by Paolo.
11640
11641         (ArrayCreation.CheckIndices): Use the patch from
11642         hwang_rob@yahoo.ca to validate the array initializers. 
11643
11644 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * class.cs (ConstructorInitializer.Emit): simplify code by using
11647         Invocation.EmitCall, and at the same time, fix the bugs in calling
11648         parent constructors that took variable arguments. 
11649
11650         * ecore.cs (Expression.ConvertNumericExplicit,
11651         Expression.ImplicitNumericConversion): Remove the code that
11652         manually wrapped decimal (InternalTypeConstructor call is now gone
11653         as well).
11654
11655         * expression.cs (Cast.TryReduce): Also handle decimal types when
11656         trying to perform a constant fold on the type.
11657
11658         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11659
11660         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11661         that only turned off an error report, and did nothing else. 
11662
11663 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11664
11665         * driver.cs: Handle and ignore /fullpaths
11666
11667 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11668
11669         * expression.cs (Binary.ResolveOperator): Catch the case where
11670         DoNumericPromotions returns true, 
11671
11672         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11673
11674 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11675
11676         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11677         report error 70.
11678
11679 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11680
11681         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11682         conversion exists, but it is also required that the conversion be
11683         performed.  This manifested in "(Type64Enum) 2".  
11684
11685         * class.cs (TypeManager.AddMethod): The fix is not to change
11686         AddEnum, because that one was using a fully qualified name (every
11687         DeclSpace derivative does), but to change the AddMethod routine
11688         that was using an un-namespaced name.  This now correctly reports
11689         the duplicated name.
11690
11691         Revert patch until I can properly fix it.  The issue
11692         is that we have a shared Type space across all namespaces
11693         currently, which is wrong.
11694
11695         Options include making the Namespace a DeclSpace, and merge
11696         current_namespace/current_container in the parser.
11697
11698 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11699
11700         * cs-parser.jay: Improve error reporting when we get a different
11701         kind of expression in local_variable_type and
11702         local_variable_pointer_type. 
11703
11704         Propagate this to avoid missleading errors being reported.
11705
11706         * ecore.cs (ImplicitReferenceConversion): treat
11707         TypeManager.value_type as a target just like object_type.   As
11708         code like this:
11709
11710         ValueType v = 1;
11711
11712         Is valid, and needs to result in the int 1 being boxed before it
11713         is assigned to the value type v.
11714
11715         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11716         to validate the enumeration name.
11717
11718         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11719         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11720         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11721
11722         * ecore.cs (TryImplicitIntConversion): When doing an
11723         implicit-enumeration-conversion, check if the type is 64-bits and
11724         perform a conversion before passing to EnumConstant.
11725
11726 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11727
11728         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11729         report ambiguous type references.  Unlike the MS version, we
11730         report what the ambiguity is.   Innovation at work ;-)
11731
11732         (DeclSpace.FindType): Require a location argument to
11733         display when we display an ambiguous error.
11734
11735         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11736
11737         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11738
11739         * expression.cs (EmitDynamicInitializers): Apply patch from
11740         hwang_rob@yahoo.ca that fixes the order in which we emit our
11741         initializers. 
11742
11743 2002-09-21  Martin Baulig  <martin@gnome.org>
11744
11745         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11746         delegate takes no arguments.
11747
11748 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11749
11750         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11751         from integers.
11752
11753         * expression.cs: Extract the underlying type.
11754
11755         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11756
11757         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11758
11759 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11760
11761         * class.cs (TypeContainer.DefineType): We can not use the nice
11762         PackingSize with the size set to 1 DefineType method, because it
11763         will not allow us to define the interfaces that the struct
11764         implements.
11765
11766         This completes the fixing of bug 27287
11767
11768         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11769         means also structs.  This fixes part of the problem. 
11770         (Expresion.ImplicitReferenceConversionExists): ditto.
11771
11772         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11773         error if there were no errors reported during the type lookup
11774         process, to avoid duplicates or redundant errors.  Without this
11775         you would get an ambiguous errors plus a type not found.  We have
11776         beaten the user enough with the first error.  
11777
11778         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11779         reference. 
11780
11781         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11782         during the resolution process, stop the lookup, this avoids
11783         repeated error reports (same error twice).
11784
11785         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11786
11787         * typemanager.cs (LookupType): Redo the type lookup code to match
11788         the needs of System.Reflection.  
11789
11790         The issue is that System.Reflection requires references to nested
11791         types to begin with a "+" sign instead of a dot.  So toplevel
11792         types look like: "NameSpace.TopLevelClass", and nested ones look
11793         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11794         levels. 
11795
11796 2002-09-19  Martin Baulig  <martin@gnome.org>
11797
11798         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11799         says that a method always returns or always throws an exception,
11800         don't report the CS0161.
11801
11802         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11803         set `Returns = new_returns'.
11804
11805 2002-09-19  Martin Baulig  <martin@gnome.org>
11806
11807         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11808         to an enum constant, check for a CS0176.
11809
11810 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11811
11812         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11813         for operators that must be in pairs and report errors.
11814
11815         * ecore.cs (SimpleName.DoResolveType): During the initial type
11816         resolution process, when we define types recursively, we must
11817         check first for types in our current scope before we perform
11818         lookups in the enclosing scopes.
11819
11820         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11821
11822         (Invocation.VerifyArgumentsCompat): Call
11823         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11824         I thought we were supposed to always call this, but there are a
11825         few places in the code where we dont do it.
11826
11827 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11828
11829         * driver.cs: Add support in -linkres and -resource to specify the
11830         name of the identifier.
11831
11832 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11833
11834         * ecore.cs (StandardConversionExists): Sync with the conversion
11835         code: allow anything-* to void* conversions.
11836
11837         (FindMostSpecificSource): Use an Expression argument
11838         instead of a Type, because we might be handed over a Literal which
11839         gets a few more implicit conversions that plain types do not.  So
11840         this information was being lost.
11841
11842         Also, we drop the temporary type-holder expression when not
11843         required.
11844
11845 2002-09-17  Martin Baulig  <martin@gnome.org>
11846
11847         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11848         this is an explicit interface implementation.
11849
11850 2002-09-17  Martin Baulig  <martin@gnome.org>
11851
11852         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11853         different `IndexerName' attributes.
11854
11855         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11856         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11857         virtual CommonResolve().
11858
11859 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11860
11861         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11862         and convert that to the UnderlyingType.
11863
11864         * statement.cs (Foreach.Resolve): Indexers are just like variables
11865         or PropertyAccesses.
11866
11867         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11868         inside quoted strings, we were not doing this before.
11869
11870 2002-09-16  Martin Baulig  <martin@gnome.org>
11871
11872         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11873         resolve it.  This is needed for the definite assignment check of the
11874         instance expression, fixes bug #29846.
11875         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11876
11877 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11878
11879         * parameter.cs: Fix compile error.  Cannot reference static member
11880         from an instance object.  Is this an mcs bug?
11881
11882 2002-09-14  Martin Baulig  <martin@gnome.org>
11883
11884         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11885         multiple times.  Fixes bug #30295, added test-166.cs.
11886
11887 2002-09-14  Martin Baulig  <martin@gnome.org>
11888
11889         * statement.cs (Block.Emit): Don't emit unreachable code.
11890         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11891         `break' statements.
11892         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11893
11894 2002-09-14  Martin Baulig  <martin@gnome.org>
11895
11896         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11897         is set.
11898
11899 2002-09-14  Martin Baulig  <martin@gnome.org>
11900
11901         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11902         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11903         be false on the ms runtime.
11904
11905 2002-09-13  Martin Baulig  <martin@gnome.org>
11906
11907         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11908         the CS0038 error message.
11909
11910 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11911
11912         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11913         constant inside, return it.
11914
11915 2002-09-12  Martin Baulig  <martin@gnome.org>
11916
11917         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11918         implicit conversion can be done between enum types.
11919
11920         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11921         check whether an implicit conversion to the current enum's UnderlyingType
11922         exists and report an error if not.
11923
11924         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11925         without debugging support.
11926
11927         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11928         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11929
11930 2002-09-12  Martin Baulig  <martin@gnome.org>
11931
11932         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11933
11934         * ecore.cs (IMemberExpr.DeclaringType): New property.
11935         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11936         nonstatic member of an outer type (CS0038).
11937
11938 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11939
11940         * driver.cs: Activate the using-error detector at warning level
11941         4 (at least for MS-compatible APIs).
11942
11943         * namespace.cs (VerifyUsing): Small buglett fix.
11944
11945         * pending.cs (PendingImplementation): pass the container pointer. 
11946
11947         * interface.cs (GetMethods): Allow for recursive definition.  Long
11948         term, I would like to move every type to support recursive
11949         definitions, not the current ordering mechanism that we have right
11950         now.
11951
11952         The situation is this: Attributes are handled before interfaces,
11953         so we can apply attributes to interfaces.  But some attributes
11954         implement interfaces, we will now handle the simple cases
11955         (recursive definitions will just get an error).  
11956
11957         * parameter.cs: Only invalidate types at the end if we fail to
11958         lookup all types.  
11959
11960 2002-09-09  Martin Baulig  <martin@gnome.org>
11961
11962         * ecore.cs (PropertyExpr.Emit): Also check for
11963         TypeManager.system_int_array_get_length so this'll also work when
11964         compiling corlib.  Fixes #30003.
11965
11966 2002-09-09  Martin Baulig  <martin@gnome.org>
11967
11968         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11969         and throw an exception if we can't get the type's size.  Fixed #30040,
11970         added test-165.cs.
11971
11972 2002-09-09  Martin Baulig  <martin@gnome.org>
11973
11974         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11975
11976         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11977         context.  Fixes bug #30027.
11978
11979         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11980         virtual functions.  Fixes bug #30043, added test-164.cs.
11981
11982 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11983
11984         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11985
11986 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11987
11988         * driver.cs: Use an object to get the windows codepage since it's not a
11989         static property.
11990
11991 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11992
11993         * statement.cs (For.Emit): for infinite loops (test == null)
11994         return whether there is a break inside, not always "true".
11995
11996         * namespace.cs (UsingEntry): New struct to hold the name of the
11997         using definition, the location where it is defined, and whether it
11998         has been used in a successful type lookup.
11999
12000         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12001         strings.
12002
12003         * decl.cs: ditto.
12004
12005 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12006
12007         * attribute.cs : Fix incorrect code which relied on catching
12008         a NullReferenceException to detect a null being passed in
12009         where an object was expected.
12010
12011 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12012
12013         * statement.cs (Try): flag the catch variable as assigned
12014
12015         * expression.cs (Cast): Simplified by using ResolveType instead of
12016         manually resolving.
12017
12018         * statement.cs (Catch): Fix bug by using ResolveType.
12019
12020 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12021
12022         * expression.cs (BetterConversion): Special case for when we have
12023         a NullLiteral as the argument and we have to choose between string
12024         and object types - we choose string the way csc does.
12025
12026         * attribute.cs (Attribute.Resolve): Catch the
12027         NullReferenceException and report error #182 since the Mono
12028         runtime no more has the bug and having this exception raised means
12029         we tried to select a constructor which takes an object and is
12030         passed a null.
12031
12032 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12033
12034         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12035         message (1502, 1503) when we can't locate a method after overload
12036         resolution. This is much more informative and closes the bug
12037         Miguel reported.
12038
12039         * interface.cs (PopulateMethod): Return if there are no argument
12040         types. Fixes a NullReferenceException bug.
12041
12042         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12043         expressions too. Previously we were checking only in one place for
12044         positional arguments leaving out named arguments.
12045
12046         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12047         type to the enum type is not allowed. Remove code corresponding to
12048         that.
12049
12050         (ConvertNumericExplicit): Allow explicit conversions from
12051         the underlying type to enum type. This precisely follows the spec
12052         and closes a bug filed by Gonzalo.
12053
12054 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12055
12056         * compiler.csproj:
12057         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12058
12059 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12060
12061         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12062         it was important that we stored the right value after the
12063         reduction in `converted'.
12064
12065 2002-09-04  Martin Baulig  <martin@gnome.org>
12066
12067         * location.cs (Location.SymbolDocument): Use full pathnames for the
12068         source files.
12069
12070 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12071
12072         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12073         of the expression resolve mechanism, because that will catch the
12074         SimpleName error failures.
12075
12076         (Conditional): If we can not resolve the
12077         expression, return, do not crash.
12078
12079 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12080
12081         * cs-tokenizer.cs:
12082         (location): display token name instead of its number.
12083
12084 2002-08-28  Martin Baulig  <martin@gnome.org>
12085
12086         * expression.cs (Binary.ResolveOperator): Don't silently return
12087         but return an error if an operator cannot be applied between two
12088         enum types.
12089
12090 2002-08-28  Martin Baulig  <martin@gnome.org>
12091
12092         * class.cs (Constructor.Define): Set the permission attributes
12093         correctly instead of making all constructors public.
12094
12095 2002-08-28  Martin Baulig  <martin@gnome.org>
12096
12097         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12098         for private members before reporting a CS0103; if we find anything,
12099         it's a CS0122.
12100
12101 2002-08-28  Martin Baulig  <martin@gnome.org>
12102
12103         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12104         to check whether `closure_start_type == closure_invocation_type',
12105         we also need to check whether `m.DeclaringType == closure_invocation_type'
12106         before bypassing the permission checks.  We might be accessing
12107         protected/private members from the base class.
12108         (TypeManager.RealMemberLookup): Only set private_ok if private
12109         members were requested via BindingFlags.NonPublic.
12110
12111         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12112
12113         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12114         MethodGroupExpr.IsExplicitImpl if appropriate.
12115         (Invocation.DoResolve): Don't report the CS0120 for explicit
12116         interface implementations.
12117
12118 2002-08-27  Martin Baulig  <martin@gnome.org>
12119
12120         * expression.cs (Invocation.DoResolve): If this is a static
12121         method and we don't have an InstanceExpression, we must report
12122         a CS0120.
12123
12124 2002-08-25  Martin Baulig  <martin@gnome.org>
12125
12126         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12127         `==' between a valuetype and an object.
12128
12129 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12130
12131         * ecore.cs (TypeExpr): Provide a ToString method.
12132
12133 2002-08-24  Martin Baulig  <martin@gnome.org>
12134
12135         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12136         now called proggie.dbg and it's a binary file.
12137
12138 2002-08-23  Martin Baulig  <martin@gnome.org>
12139
12140         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12141
12142 2002-08-23  Martin Baulig  <martin@gnome.org>
12143
12144         * struct.cs (MyStructInfo.ctor): Make this work with empty
12145         structs; it's not allowed to use foreach() on null.
12146
12147 2002-08-23  Martin Baulig  <martin@gnome.org>
12148
12149         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12150         writer the full pathname of the generated assembly.
12151
12152 2002-08-23  Martin Baulig  <martin@gnome.org>
12153
12154         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12155         A `finally' block never returns or breaks; improved handling of
12156         unreachable code.
12157
12158 2002-08-23  Martin Baulig  <martin@gnome.org>
12159
12160         * statement.cs (Throw.Resolve): Allow `throw null'.
12161
12162 2002-08-23  Martin Baulig  <martin@gnome.org>
12163
12164         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12165         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12166         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12167         MemberLookup would return a wrong event if this is an explicit
12168         interface implementation and the class has an event with the same
12169         name.
12170
12171 2002-08-23  Martin Baulig  <martin@gnome.org>
12172
12173         * statement.cs (Block.AddChildVariableNames): New public method.
12174         (Block.AddChildVariableName): Likewise.
12175         (Block.IsVariableNameUsedInChildBlock): Likewise.
12176         (Block.AddVariable): Check whether a variable name has already
12177         been used in a child block.
12178
12179         * cs-parser.jay (declare_local_variables): Mark all variable names
12180         from the current block as being used in a child block in the
12181         implicit block.
12182
12183 2002-08-23  Martin Baulig  <martin@gnome.org>
12184
12185         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12186         find the symbol writer.
12187
12188         * driver.cs: csc also allows the arguments to /define being
12189         separated by commas, not only by semicolons.
12190
12191 2002-08-23  Martin Baulig  <martin@gnome.org>
12192
12193         * interface.cs (Interface.GetMembers): Added static check for events.
12194
12195 2002-08-15  Martin Baulig  <martin@gnome.org>
12196
12197         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12198         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12199
12200         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12201         why the MethodData.EmitDestructor() change was necessary.
12202
12203 2002-08-20  Martin Baulig  <martin@gnome.org>
12204
12205         * class.cs (TypeContainer.FindMembers): Added static check for events.
12206
12207         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12208
12209         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12210         use Type.GetEvents(), not Type.FindMembers().
12211
12212 2002-08-20  Martin Baulig  <martin@gnome.org>
12213
12214         * decl.cs (MemberCache): Added a special method cache which will
12215         be used for method-only searched.  This ensures that a method
12216         search will return a MethodInfo with the correct ReflectedType for
12217         inherited methods.      
12218
12219 2002-08-20  Martin Baulig  <martin@gnome.org>
12220
12221         * decl.cs (DeclSpace.FindMembers): Made this public.
12222
12223 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12224
12225         * delegate.cs: fixed build on windows.
12226         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12227
12228 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12229
12230         * ecore.cs (StandardConversionExists): Return a false
12231         if we are trying to convert the void type to anything else
12232         since that is not allowed.
12233
12234         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12235         we flag error 70 in the event an event is trying to be accessed
12236         directly from outside the declaring type.
12237
12238 2002-08-20  Martin Baulig  <martin@gnome.org>
12239
12240         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12241         MemberCache from typemanager.cs to decl.cs.
12242
12243 2002-08-19  Martin Baulig  <martin@gnome.org>
12244
12245         * class.cs (TypeContainer): Implement IMemberContainer.
12246         (TypeContainer.DefineMembers): Create the MemberCache.
12247         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12248         return public members if BindingFlags.Public was given, check
12249         whether members are static.
12250
12251 2002-08-16  Martin Baulig  <martin@gnome.org>
12252
12253         * decl.cs (DeclSpace.Define): Splitted this in Define and
12254         DefineMembers.  DefineMembers is called first and initializes the
12255         MemberCache.
12256
12257         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12258         DefineMembers() on all our DeclSpaces.
12259
12260         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12261         but call DefineMembers() on all nested interfaces.  We call their
12262         Define() in our new Define() function.
12263
12264         * interface.cs (Interface): Implement IMemberContainer.
12265         (Interface.Define): Moved all code except the attribute stuf to
12266         DefineMembers().
12267         (Interface.DefineMembers): Initialize the member cache.
12268
12269         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12270         need this anymore since we can use MemberCache.FindMembers directly.
12271
12272 2002-08-19  Martin Baulig  <martin@gnome.org>
12273
12274         * typemanager.cs (MemberCache): When creating the cache for an
12275         interface type, add all inherited members.
12276         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12277         to `out bool used_cache' and documented it.
12278         (TypeManager.MemberLookup): If we already used the cache in the first
12279         iteration, we don't need to do the interfaces check.
12280
12281 2002-08-19  Martin Baulig  <martin@gnome.org>
12282
12283         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12284         here from IMemberFinder and don't implement this interface anymore.
12285         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12286
12287         * typemanager.cs (IMemberFinder): This interface is now only used by
12288         classes which actually support the member cache.
12289         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12290         since we only put DeclSpaces into this Hashtable.
12291         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12292         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12293
12294 2002-08-16  Martin Baulig  <martin@gnome.org>
12295
12296         * typemanager.cs (ICachingMemberFinder): Removed.
12297         (IMemberFinder.MemberCache): New property.
12298         (TypeManager.FindMembers): Merged this with RealFindMembers().
12299         This function will never be called from TypeManager.MemberLookup()
12300         so we can't use the cache here, just the IMemberFinder.
12301         (TypeManager.MemberLookup_FindMembers): Check whether the
12302         IMemberFinder has a MemberCache and call the cache's FindMembers
12303         function.
12304         (MemberCache): Rewrote larger parts of this yet another time and
12305         cleaned it up a bit.
12306
12307 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12308
12309         * driver.cs (LoadArgs): Support quoting.
12310
12311         (Usage): Show the CSC-like command line arguments.
12312
12313         Improved a few error messages.
12314
12315 2002-08-15  Martin Baulig  <martin@gnome.org>
12316
12317         * typemanager.cs (IMemberContainer.Type): New property.
12318         (IMemberContainer.IsInterface): New property.
12319
12320         The following changes are conditional to BROKEN_RUNTIME, which is
12321         defined at the top of the file.
12322
12323         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12324         class'es members, but add all members from TypeHandle.ObjectType
12325         if we're an interface.
12326         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12327         is the current type.
12328         (MemberCache.CacheEntry.Container): Removed this field.
12329         (TypeHandle.GetMembers): Include inherited members.
12330
12331 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12332
12333         * typemanager.cs: fixed compilation and added a comment on a field that
12334         is never used.
12335
12336 2002-08-15  Martin Baulig  <martin@gnome.org>
12337
12338         * class.cs (ConstructorInitializer.Resolve): In the
12339         Expression.MemberLookup call, use the queried_type as
12340         invocation_type.
12341
12342         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12343         declared' attribute, it's always true.
12344         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12345         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12346         temporary wrapper for FindMembers which tells MemberLookup whether
12347         members from the base classes are included in the return value.
12348         This will go away soon.
12349         (TypeManager.MemberLookup): Use this temporary hack here; once the
12350         new MemberCache is completed, we don't need to do the DeclaredOnly
12351         looping here anymore since the MemberCache will take care of this.
12352         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12353         (MemberCache): When creating the MemberCache for a class, get
12354         members from the current class and all its base classes.
12355         (MemberCache.CacheEntry.Container): New field.  This is a
12356         temporary hack until the Mono runtime is fixed to distinguish
12357         between ReflectedType and DeclaringType.  It allows us to use MCS
12358         with both the MS runtime and the unfixed Mono runtime without
12359         problems and without accecting performance.
12360         (MemberCache.SearchMembers): The DeclaredOnly looping from
12361         TypeManager.MemberLookup is now done here.      
12362
12363 2002-08-14  Martin Baulig  <martin@gnome.org>
12364
12365         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12366         Type.GetFields on dynamic types but get the fields from the
12367         corresponding TypeContainer.
12368         (MyStructInfo.GetStructInfo): Added check for enum types.
12369
12370         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12371         (MemberList.SyncRoot): Implemented.
12372         (TypeManager.FilterWithClosure): No need to check permissions if
12373         closure_start_type == closure_invocation_type, don't crash if
12374         closure_invocation_type is null.
12375
12376 2002-08-13  Martin Baulig  <martin@gnome.org>
12377
12378         Rewrote TypeContainer.FindMembers to use a member cache.  This
12379         gives us a speed increase of about 35% for the self-hosting MCS
12380         build and of about 15-20% for the class libs (both on GNU/Linux).
12381
12382         * report.cs (Timer): New class to get enhanced profiling.  This
12383         whole class is "TIMER" conditional since it remarkably slows down
12384         compilation speed.
12385
12386         * class.cs (MemberList): New class.  This is an IList wrapper
12387         which we're now using instead of passing MemberInfo[]'s around to
12388         avoid copying this array unnecessarily.
12389         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12390         (ICachingMemberFinder, IMemberContainer): New interface.
12391         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12392         has already been checked, otherwise use it for the name comparision.
12393         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12394         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12395         if possible.  Returns a MemberList, not a MemberInfo [].
12396         (TypeHandle): New class, implements IMemberContainer.  We create
12397         one instance of this class per type, it contains a MemberCache
12398         which is used to do the member lookups.
12399         (MemberCache): New class.  Each instance of this class contains
12400         all members of a type and a name-based hash table.
12401         (MemberCache.FindMembers): This is our new member lookup
12402         function.  First, it looks up all members of the requested name in
12403         the hash table.  Then, it walks this list and sorts out all
12404         applicable members and returns them.
12405
12406 2002-08-13  Martin Baulig  <martin@gnome.org>
12407
12408         In addition to a nice code cleanup, this gives us a performance
12409         increase of about 1.4% on GNU/Linux - not much, but it's already
12410         half a second for the self-hosting MCS compilation.
12411
12412         * typemanager.cs (IMemberFinder): New interface.  It is used by
12413         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12414         Enum, Delegate or Interface.
12415         (TypeManager.finder_to_member_finder): New PtrHashtable.
12416         (TypeManager.finder_to_container): Removed.
12417         (TypeManager.finder_to_delegate): Removed.
12418         (TypeManager.finder_to_interface): Removed.
12419         (TypeManager.finder_to_enum): Removed.
12420
12421         * interface.cs (Interface): Implement IMemberFinder.
12422
12423         * delegate.cs (Delegate): Implement IMemberFinder.
12424
12425         * enum.cs (Enum): Implement IMemberFinder.
12426
12427         * class.cs (TypeContainer): Implement IMemberFinder.
12428
12429 2002-08-12  Martin Baulig  <martin@gnome.org>
12430
12431         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12432
12433 2002-08-12  Martin Baulig  <martin@gnome.org>
12434
12435         * ecore.cs (ITypeExpression): New interface for expressions which
12436         resolve to a type.
12437         (TypeExpression): Renamed to TypeLookupExpression.
12438         (Expression.DoResolve): If we're doing a types-only lookup, the
12439         expression must implement the ITypeExpression interface and we
12440         call DoResolveType() on it.
12441         (SimpleName): Implement the new ITypeExpression interface.
12442         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12443         hack, the situation that we're only looking up types can't happen
12444         anymore when this method is called.  Moved the type lookup code to
12445         DoResolveType() and call it.
12446         (SimpleName.DoResolveType): This ITypeExpression interface method
12447         is now doing the types-only lookup.
12448         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12449         (ResolveFlags): Added MaskExprClass.
12450
12451         * expression.cs (MemberAccess): Implement the ITypeExpression
12452         interface.
12453         (MemberAccess.DoResolve): Added support for a types-only lookup
12454         when we're called via ITypeExpression.DoResolveType().
12455         (ComposedCast): Implement the ITypeExpression interface.
12456
12457         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12458         Expression.Resolve() with ResolveFlags.Type instead.
12459
12460 2002-08-12  Martin Baulig  <martin@gnome.org>
12461
12462         * interface.cs (Interface.Define): Apply attributes.
12463
12464         * attribute.cs (Attribute.ApplyAttributes): Added support for
12465         interface attributes.
12466
12467 2002-08-11  Martin Baulig  <martin@gnome.org>
12468
12469         * statement.cs (Block.Emit): Only check the "this" variable if we
12470         do not always throw an exception.
12471
12472         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12473         whether the property has a set accessor.
12474
12475 2002-08-11  Martin Baulig  <martin@gnome.org>
12476
12477         Added control flow analysis support for structs.
12478
12479         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12480         with control flow analysis turned off.
12481         (IVariable): New interface.
12482         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12483         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12484         (FieldExpr.DoResolve): Resolve the instance expression with flow
12485         analysis turned off and do the definite assignment check after the
12486         resolving when we know what the expression will resolve to.
12487
12488         * expression.cs (LocalVariableReference, ParameterReference):
12489         Implement the new IVariable interface, only call the flow analysis
12490         code if ec.DoFlowAnalysis is true.
12491         (This): Added constructor which takes a Block argument.  Implement
12492         the new IVariable interface.
12493         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12494         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12495         This does the definite assignment checks for struct members.
12496
12497         * class.cs (Constructor.Emit): If this is a non-static `struct'
12498         constructor which doesn't have any initializer, call
12499         Block.AddThisVariable() to tell the flow analysis code that all
12500         struct elements must be initialized before control returns from
12501         the constructor.
12502
12503         * statement.cs (MyStructInfo): New public class.
12504         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12505         argument to this indexer.  If non-zero, check an individual struct
12506         member, not the whole struct.
12507         (FlowBranching.CheckOutParameters): Check struct members.
12508         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12509         overloaded versions of these methods which take an additional
12510         `int field_idx' argument to check struct members.
12511         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12512         overloaded versions of these methods which take an additional
12513         `string field_name' argument to check struct member.s
12514         (VariableInfo): Implement the IVariable interface.
12515         (VariableInfo.StructInfo): New public property.  Returns the
12516         MyStructInfo instance of the variable if it's a struct or null.
12517         (Block.AddThisVariable): New public method.  This is called from
12518         Constructor.Emit() for non-static `struct' constructor which do
12519         not have any initializer.  It creates a special variable for the
12520         "this" instance variable which will be checked by the flow
12521         analysis code to ensure that all of the struct's fields are
12522         initialized before control returns from the constructor.
12523         (UsageVector): Added support for struct members.  If a
12524         variable/parameter is a struct with N members, we reserve a slot
12525         in the usage vector for each member.  A struct is considered fully
12526         initialized if either the struct itself (slot 0) or all its
12527         members are initialized.
12528
12529 2002-08-08  Martin Baulig  <martin@gnome.org>
12530
12531         * driver.cs (Driver.MainDriver): Only report an error CS5001
12532         if there were no compilation errors.
12533
12534         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12535         `UnsafeContext' property to determine whether the parent is in
12536         unsafe context rather than checking the parent's ModFlags:
12537         classes nested in an unsafe class are unsafe as well.
12538
12539 2002-08-08  Martin Baulig  <martin@gnome.org>
12540
12541         * statement.cs (UsageVector.MergeChildren): Distinguish between
12542         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12543         we return.  Added test17() and test18() to test-154.cs.
12544
12545 2002-08-08  Martin Baulig  <martin@gnome.org>
12546
12547         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12548         Family access, make sure the invoking type isn't a subclass of the
12549         queried type (that'd be a CS1540).
12550
12551         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12552         this method which takes an additional `Type invocation_type'.
12553
12554         * expression.cs (BaseAccess.DoResolve): Use the base type as
12555         invocation and query type.
12556         (MemberAccess.DoResolve): If the lookup failed and we're about to
12557         report a CS0122, try a lookup with the ec.ContainerType - if this
12558         succeeds, we must report a CS1540.
12559
12560 2002-08-08  Martin Baulig  <martin@gnome.org>
12561
12562         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12563         (MethodGroupExpr): Implement the IMemberExpr interface.
12564
12565         * expression (MemberAccess.ResolveMemberAccess): No need to have
12566         any special code for MethodGroupExprs anymore, they're now
12567         IMemberExprs.   
12568
12569 2002-08-08  Martin Baulig  <martin@gnome.org>
12570
12571         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12572         Family, FamANDAssem and FamORAssem permissions.
12573         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12574
12575 2002-08-08  Martin Baulig  <martin@gnome.org>
12576
12577         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12578         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12579         or loop block.
12580
12581 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12582
12583         * driver.cs: implemented /resource option to embed managed resources.
12584
12585 2002-08-07  Martin Baulig  <martin@gnome.org>
12586
12587         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12588         (FieldBase.HasFieldInitializer): New public property.
12589         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12590         returns the field initializer and makes sure it is only resolved once.
12591         (TypeContainer.EmitFieldInitializers): Call
12592         FieldBase.GetInitializerExpression to get the initializer, this ensures
12593         that it isn't resolved multiple times.
12594
12595         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12596         the resolving process (SimpleName/MemberLookup) that we're currently
12597         emitting a field initializer (which must not access any instance members,
12598         this is an error CS0236).
12599
12600         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12601         argument, if the `IsFieldInitializer' flag is set, we must report and
12602         error CS0236 and not an error CS0120.   
12603
12604 2002-08-07  Martin Baulig  <martin@gnome.org>
12605
12606         * ecore.cs (IMemberExpr): New public interface.
12607         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12608         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12609         if the expression is an IMemberExpr.
12610
12611         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12612         to be null, implicitly default to `this' if we're non-static in
12613         this case.  Simplified the code a lot by using the new IMemberExpr
12614         interface.  Also fixed bug #28176 here.
12615
12616 2002-08-06  Martin Baulig  <martin@gnome.org>
12617
12618         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12619         ParameterReferences during semantic analysis so that we can do a
12620         type-only search when resolving Cast, TypeOf and SizeOf.
12621         (block): Pass the `current_local_parameters' to the Block's
12622         constructor.
12623
12624         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12625         argument to the constructor.
12626         (ConstructorInitializer.Resolve): Create a temporary implicit
12627         block with the parameters.
12628
12629         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12630         references here if we aren't doing a type-only search.
12631
12632         * statement.cs (Block): Added constructor which takes a
12633         `Parameters parameters' argument.
12634         (Block.Parameters): New public property.
12635
12636         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12637         to `Parameters' and made it public readonly.
12638
12639 2002-08-06  Martin Baulig  <martin@gnome.org>
12640
12641         * ecore.cs (Expression.Warning): Made this public as well.
12642
12643         * report.cs (Report.Debug): Print the contents of collections.
12644
12645 2002-08-06  Martin Baulig  <martin@gnome.org>
12646
12647         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12648         used to tell Resolve() which kinds of expressions it may return.
12649         (Expression.Resolve): Added overloaded version of this method which
12650         takes a `ResolveFlags flags' argument.  This can be used to tell
12651         Resolve() which kinds of expressions it may return.  Reports a
12652         CS0118 on error.
12653         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12654         ResolveFlags.SimpleName.
12655         (Expression.Error118): Added overloaded version of this method which
12656         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12657         which kinds of expressions are allowed.
12658
12659         * expression.cs (Argument.ResolveMethodGroup): New public method.
12660         Resolves an argument, but allows a MethodGroup to be returned.
12661         This is used when invoking a delegate.
12662
12663         * TODO: Updated a bit.
12664
12665 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12666
12667         Fixed compilation with csc.
12668
12669         * ecore.cs: Expression.Error made public. Is this correct? Should
12670         Warning be made public too?
12671
12672         * expression.cs: use ea.Location instead of ea.loc.
12673         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12674
12675 2002-08-06  Martin Baulig  <martin@gnome.org>
12676
12677         * ecore.cs (Expression.loc): Moved the location here instead of
12678         duplicating it in all derived classes.
12679         (Expression.Location): New public property.
12680         (Expression.Error, Expression.Warning): Made them non-static and
12681         removed the location argument.
12682         (Expression.Warning): Added overloaded version which takes an
12683         `int level' argument.
12684         (Expression.Error118): Make this non-static and removed the
12685         expression and location arguments.
12686         (TypeExpr): Added location argument to the constructor.
12687
12688         * expression.cs (StaticCallExpr): Added location argument to
12689         the constructor.
12690         (Indirection, PointerArithmetic): Likewise.
12691         (CheckedExpr, UnCheckedExpr): Likewise.
12692         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12693         (StringPtr): Likewise.
12694
12695
12696 2002-08-05  Martin Baulig  <martin@gnome.org>
12697
12698         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12699
12700         * assign.cs (Assign.DoResolve): Check whether the source
12701         expression is a value or variable.
12702
12703         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12704         while resolving the corresponding blocks.
12705
12706         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12707         an error, don't silently return null.
12708
12709         * statement.cs (Block.AddVariable): Do the error reporting here
12710         and distinguish between CS0128 and CS0136.
12711         (Block.DoResolve): Report all unused labels (warning CS0164).
12712         (LabeledStatement): Pass the location to the constructor.
12713         (LabeledStatement.HasBeenReferenced): New property.
12714         (LabeledStatement.Resolve): Set it to true here.
12715
12716         * statement.cs (Return.Emit): Return success even after reporting
12717         a type mismatch error (CS0126 or CS0127), this is what csc does and
12718         it avoids confusing the users with any consecutive errors.
12719
12720 2002-08-05  Martin Baulig  <martin@gnome.org>
12721
12722         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12723
12724         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12725
12726         * expression.cs (MemberAccess.DoResolve): Silently return if an
12727         error has already been reported.
12728
12729         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12730         error has already been reported.
12731
12732 2002-08-05  Martin Baulig  <martin@gnome.org>
12733
12734         * statement.cs (UsageVector): Only initialize the `parameters'
12735         vector if we actually have any "out" parameters.
12736
12737 2002-08-05  Martin Baulig  <martin@gnome.org>
12738
12739         * expression.cs (Binary.ResolveOperator): When combining delegates,
12740         they must have the same type.
12741
12742 2002-08-05  Martin Baulig  <martin@gnome.org>
12743
12744         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12745         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12746         work with the ms runtime and we also don't need it: if we're a
12747         PropertyBuilder and not in the `indexer_arguments' hash, then we
12748         are a property and not an indexer.
12749
12750         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12751         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12752         since the latter one doesn't work with the ms runtime.
12753
12754 2002-08-03  Martin Baulig  <martin@gnome.org>
12755
12756         Fixed bugs #27998 and #22735.
12757
12758         * class.cs (Method.IsOperator): New public field.
12759         (Method.CheckBase): Report CS0111 if there's already a method
12760         with the same parameters in the current class.  Report CS0508 when
12761         attempting to change the return type of an inherited method.
12762         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12763         and it's not marked abstract or extern.
12764         (PropertyBase): New abstract base class for Property and Indexer.
12765         (PropertyBase.CheckBase): Moved here from Property and made it work
12766         for indexers.
12767         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12768         the same so we can reuse it there.
12769         (Property, Indexer): Derive from PropertyBase.
12770         (MethodSignature.inheritable_property_signature_filter): New delegate
12771         to find properties and indexers.
12772
12773         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12774         argument and improved error reporting.
12775
12776         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12777         EmptyReadOnlyParameters and made it a property.
12778
12779         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12780         version of this method which takes a `PropertyInfo indexer'.
12781         (TypeManager.RegisterIndexer): New method.
12782
12783         * class.cs: Added myself as author of this file :-)
12784
12785 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12786
12787         * class.cs: fixed compilation on windoze.
12788
12789 2002-08-03  Martin Baulig  <martin@gnome.org>
12790
12791         * interface.cs (Interface.GetInterfaceBases): Check whether all
12792         base interfaces are at least as accessible than the current one.
12793
12794         * class.cs (TypeContainer.GetClassBases): Check whether base types
12795         are at least as accessible than the current type.
12796         (TypeContainer.AsAccessible): Implemented and made non-static.
12797         (MemberBase.CheckParameters): Report errors if the accessibility
12798         checks fail.
12799
12800         * delegate.cs (Delegate.Delegate): The default visibility is
12801         internal for top-level types and private for nested types.
12802         (Delegate.Define): Report errors if the accessibility checks fail.
12803
12804         * enum.cs (Enum.Enum): The default visibility is internal for
12805         top-level types and private for nested types.
12806         (Enum.DefineType): Compute the correct visibility.
12807
12808         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12809         function which takes a `bool is_toplevel' instead of a TypeContainer.
12810
12811         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12812         builtin type.
12813
12814 2002-08-02  Martin Baulig  <martin@gnome.org>
12815
12816         * expression.cs (LocalVariableReferenc): Added constructor which
12817         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12818         (LocalVariableReference.IsReadOnly): New property.
12819         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12820         variable is readonly, use our own readonly flag to do this; you can
12821         use the new constructor to get a writable reference to a read-only
12822         variable.
12823
12824         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12825         reference to the local variable.
12826
12827 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12828
12829         * rootcontext.cs (ResolveCore): Also include System.Exception
12830
12831         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12832         we reach an EmptyStatement.
12833
12834         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12835         is also fine.
12836
12837         * expression.cs (Binary.ResolveOperator): Check error result in
12838         two places.
12839
12840         use brtrue/brfalse directly and avoid compares to null.
12841
12842 2002-08-02  Martin Baulig  <martin@gnome.org>
12843
12844         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12845         Fixes bug #28407, added test-155.cs.
12846
12847 2002-08-01  Martin Baulig  <martin@gnome.org>
12848
12849         * class.cs (Event.EmitDefaultMethod): Make this work with static
12850         events.  Fixes #28311, added verify-3.cs.
12851
12852 2002-08-01  Martin Baulig  <martin@gnome.org>
12853
12854         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12855         `is_disposable' fields.
12856         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12857         `hm.is_disposable' if we're using the collection pattern.
12858         (Foreach.EmitCollectionForeach): Use the correct type for the
12859         enumerator's local variable, only emit the try/finally block if
12860         necessary (fixes #27713).
12861
12862 2002-08-01  Martin Baulig  <martin@gnome.org>
12863
12864         * ecore.cs (Expression.report118): Renamed to Error118 and made
12865         it public static.
12866
12867         * statement.cs (Throw.Resolve): Check whether the expression is of
12868         the correct type (CS0118) and whether the type derives from
12869         System.Exception (CS0155).
12870         (Catch.Resolve): New method.  Do the type lookup here and check
12871         whether it derives from System.Exception (CS0155).
12872         (Catch.CatchType, Catch.IsGeneral): New public properties.
12873
12874         * typemanager.cs (TypeManager.exception_type): Added.
12875
12876 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12877
12878         * driver.cs: Updated About function.
12879
12880 2002-07-31  Martin Baulig  <martin@gnome.org>
12881
12882         Implemented Control Flow Analysis.
12883
12884         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12885         (EmitContext.CurrentBranching): Added.
12886         (EmitContext.StartFlowBranching): Added.
12887         (EmitContext.EndFlowBranching): Added.
12888         (EmitContext.KillFlowBranching): Added.
12889         (EmitContext.IsVariableAssigned): Added.
12890         (EmitContext.SetVariableAssigned): Added.
12891         (EmitContext.IsParameterAssigned): Added.
12892         (EmitContext.SetParameterAssigned): Added.
12893         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12894         Added control flow analysis stuff here.
12895
12896         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12897         resolve the expression as lvalue.
12898         (LocalVariableReference.DoResolve): Check whether the variable has
12899         already been assigned.
12900         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12901         the parameter as assigned here.
12902         (ParameterReference.DoResolve): Check whether the parameter has already
12903         been assigned.
12904         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12905         expression as lvalue.
12906
12907         * statement.cs (FlowBranching): New class for the flow analysis code.
12908         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12909         (LabeledStatement.IsDefined): New public property.
12910         (LabeledStatement.AddUsageVector): New public method to tell flow
12911         analyis that the label may be reached via a forward jump.
12912         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12913         flow analysis.
12914         (VariableInfo.Number): New public field.  This is used by flow analysis
12915         to number all locals of a block.
12916         (Block.CountVariables): New public property.  This is the number of
12917         local variables in this block (including the locals from all parent
12918         blocks).
12919         (Block.EmitMeta): Number all the variables.
12920
12921         * statement.cs: Added flow analysis support to all classes.
12922
12923 2002-07-31  Martin Baulig  <martin@gnome.org>
12924
12925         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12926         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12927         then use this argument.
12928
12929         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12930
12931         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12932         use this to specify /define options.
12933
12934 2002-07-29  Martin Baulig  <martin@gnome.org>
12935
12936         * statement.cs (Fixed): Moved all code that does variable lookups
12937         and resolvings from Emit to Resolve.
12938
12939         * statement.cs (For): Moved all code that does variable lookups
12940         and resolvings from Emit to Resolve.
12941
12942         * statement.cs (Using): Moved all code that does variable lookups
12943         and resolvings from Emit to Resolve.
12944
12945 2002-07-29  Martin Baulig  <martin@gnome.org>
12946
12947         * attribute.cs (Attribute.Resolve): Explicitly catch a
12948         System.NullReferenceException when creating the
12949         CustromAttributeBuilder and report a different warning message.
12950
12951 2002-07-29  Martin Baulig  <martin@gnome.org>
12952
12953         * support.cs (ParameterData.ParameterName): Added method to
12954         get the name of a parameter.
12955
12956         * typemanager.cs (TypeManager.IsValueType): New public method.
12957
12958 2002-07-29  Martin Baulig  <martin@gnome.org>
12959
12960         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12961         is a flag which specifies that it's either ref or out.
12962         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12963         the out parameter to `out Parameter.Modifier mod', also set the
12964         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12965
12966         * support.cs (InternalParameters.ParameterModifier): Distinguish
12967         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12968         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12969
12970         * expression.cs (Argument.GetParameterModifier): Distinguish
12971         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12972         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12973
12974 2002-07-29  Martin Baulig  <martin@gnome.org>
12975
12976         * expression.cs (ParameterReference.ParameterReference): Added
12977         `Location loc' argument to the constructor.
12978
12979         * cs-parser.jay: Pass location to ParameterReference.
12980
12981 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12982
12983         * statement.cs (Try): Initialize the location.
12984
12985         * cs-parser.jay: pass location to Try.
12986
12987         * expression.cs (Unary.Reduce): Change the prototype to return
12988         whether a constant fold could be performed or not.  The result is
12989         returned in an out parameters.  In the case of Indirection and
12990         AddressOf, we want to perform the full tests.
12991
12992 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12993
12994         * statement.cs (Statement.Emit): Flag dead code.
12995
12996 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12997
12998         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12999
13000 2002-07-27  Martin Baulig  <martin@gnome.org>
13001
13002         * class.cs (MethodData.Define): Put back call to
13003         TypeManager.AddMethod(), accidentally commented this out.
13004
13005         * report.cs (Debug): New public method to print debugging information,
13006         this is `[Conditional ("DEBUG")]'.
13007
13008 2002-07-26  Martin Baulig  <martin@gnome.org>
13009
13010         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13011         (switch_statement): Push the current_block to the switch_stack and
13012         pop it again when we're done with the switch.
13013         (switch_section): The new block is a child of the current_block.
13014         Fixes bug #24007, added test-152.cs.
13015
13016 2002-07-27  Martin Baulig  <martin@gnome.org>
13017
13018         * expression.cs (Invocation.EmitArguments): When calling a varargs
13019         function with only its fixed arguments, we need to pass an empty
13020         array.
13021
13022 2002-07-27  Martin Baulig  <martin@gnome.org>
13023
13024         Mono 0.13 has been released.
13025
13026 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13027
13028         * driver.cs: Rename --resource to --linkres, because that is what
13029         we do currently, we dont support --resource yet.
13030
13031         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13032
13033 2002-07-25  Martin Baulig  <martin@gnome.org>
13034
13035         * class.cs (MethodData): New public class.  This is a `method builder'
13036         class for a method or one accessor of a Property/Indexer/Event.
13037         (MethodData.GetMethodFlags): Moved here from MemberBase.
13038         (MethodData.ApplyAttributes): Likewise.
13039         (MethodData.ApplyObsoleteAttribute): Likewise.
13040         (MethodData.ApplyConditionalAttribute): Likewise.
13041         (MethodData.ApplyDllImportAttribute): Likewise.
13042         (MethodData.CheckAbstractAndExternal): Likewise.
13043         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13044         (MethodData.Emit): Formerly known as Method.Emit().
13045         (MemberBase): Moved everything which was specific to a single
13046         accessor/method to MethodData.
13047         (Method): Create a new MethodData and call Define() and Emit() on it.
13048         (Property, Indexer, Event): Create a new MethodData objects for each
13049         accessor and call Define() and Emit() on them.
13050
13051 2002-07-25  Martin Baulig  <martin@gnome.org>
13052
13053         Made MethodCore derive from MemberBase to reuse the code from there.
13054         MemberBase now also checks for attributes.
13055
13056         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13057         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13058         as virtual.
13059         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13060         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13061         (MemberBase.ApplyAttributes): New virtual method; applies the
13062         attributes to a method or accessor.
13063         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13064         (MemberBase.ApplyConditionalAttribute): Likewise.
13065         (MemberBase.ApplyDllImportAttribute): Likewise.
13066         (MemberBase.CheckAbstractAndExternal): Likewise.
13067         (MethodCore.ParameterTypes): This is now a property instead of a
13068         method, it's initialized from DoDefineParameters().
13069         (MethodCore.ParameterInfo): Removed the set accessor.
13070         (MethodCore.DoDefineParameters): New protected virtual method to
13071         initialize ParameterTypes and ParameterInfo.
13072         (Method.GetReturnType): We can now simply return the MemberType.
13073         (Method.GetMethodFlags): Override the MemberBase version and add
13074         the conditional flags.
13075         (Method.CheckBase): Moved some code from Define() here, call
13076         DoDefineParameters() here.
13077         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13078         here to avoid some larger code duplication.
13079         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13080         ensure that abstract and external accessors don't declare a body.
13081
13082         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13083         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13084         lookup in the attribute's parent classes, so we need to abort as soon
13085         as we found the first match.
13086         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13087         the attribute has no arguments.
13088
13089         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13090         of a Method.
13091
13092 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13093
13094         * cs-parser.jay: reverted previous patch.
13095
13096 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13097
13098         * cs-parser.jay: fixed bug #22119.
13099
13100 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13101
13102         * attribute.cs: fixed compilation. The error was:
13103         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13104         be assigned to before control leaves the current method."
13105         [FIXME:  Filed as bug #28186: MCS must report this error.]
13106
13107 2002-07-25  Martin Baulig  <martin@gnome.org>
13108
13109         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13110         method to pull the condition name ouf of a Conditional attribute.
13111         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13112         the obsolete message and error flag out of an Obsolete attribute.
13113
13114         * class.cs (Method.GetMethodFlags): New public method to get the
13115         TypeManager.MethodFlags for this method.
13116         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13117         private methods.
13118         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13119         if we're overriding a virtual function, set the new private variable
13120         `parent_method'; call the new TypeManager.AddMethod().
13121
13122         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13123         the MethodBuilder and the Method in a PtrHashtable.
13124         (TypeManager.builder_to_method): Added for this purpose.
13125         (TypeManager.MethodFlags): Added IsObsoleteError.
13126         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13127         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13128         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13129         the message from the attribute.
13130
13131 2002-07-24  Martin Baulig  <martin@gnome.org>
13132
13133         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13134         preprocessor directives, ensure that the argument to #define/#undef is
13135         exactly one identifier and that it's actually an identifier.
13136
13137         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13138         did not work ....
13139
13140 2002-07-24  Martin Baulig  <martin@gnome.org>
13141
13142         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13143         initialize it to TypeManager.object_type in the constructor.
13144         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13145         of the `hm.get_current' method if we're using the collection pattern.
13146         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13147         for the explicit conversion to make it work when we're using the collection
13148         pattern and the `Current' property has a different return type than `object'.
13149         Fixes #27713.
13150
13151 2002-07-24  Martin Baulig  <martin@gnome.org>
13152
13153         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13154         does not match, but don't report any errors.  This method is called in
13155         order for all methods in a MethodGroupExpr until a matching method is
13156         found, so we don't want to bail out if the first method doesn't match.
13157         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13158         matches, report the 123.  Fixes #28070.
13159
13160 2002-07-24  Martin Baulig  <martin@gnome.org>
13161
13162         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13163         TypeManager.TypeToCoreType() to the top of the method so the
13164         following equality checks will work.  Fixes #28107.
13165
13166 2002-07-24  Martin Baulig  <martin@gnome.org>
13167
13168         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13169         operand is of type uint, and the other operand is of type sbyte,
13170         short or int, the operands are converted to type long." -
13171         Actually do what this comment already told us.  Fixes bug #28106,
13172         added test-150.cs.
13173
13174 2002-07-24  Martin Baulig  <martin@gnome.org>
13175
13176         * class.cs (MethodBase): New abstract class.  This is now a base
13177         class for Property, Indexer and Event to avoid some code duplication
13178         in their Define() and DefineMethods() methods.
13179         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13180         generic methods for Define() and DefineMethods().
13181         (FieldBase): Derive from MemberBase, not MemberCore.
13182         (Property): Derive from MemberBase, not MemberCore.
13183         (Property.DefineMethod): Moved all the code from this method to the
13184         new MethodBase.DefineAccessor(), just call it with appropriate
13185         argumetnts.
13186         (Property.Define): Call the new Property.DoDefine(), this does some
13187         sanity checks and we don't need to duplicate the code everywhere.
13188         (Event): Derive from MemberBase, not MemberCore.
13189         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13190         accessors, this will also make them work with interface events.
13191         (Indexer): Derive from MemberBase, not MemberCore.
13192         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13193         (Indexer.Define): Use the new MethodBase functions.
13194
13195         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13196         argument to the constructor.
13197         (Interface.FindMembers): Added support for interface events.
13198         (Interface.PopluateEvent): Implemented.
13199
13200         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13201
13202 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13203
13204         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13205         but this is required to check for a method name being the same as
13206         the containing class.  
13207
13208         Handle this now.
13209
13210 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13211
13212         * interface.cs: initialize variable.
13213
13214 2002-07-23  Martin Baulig  <martin@gnome.org>
13215
13216         Implemented the IndexerName attribute in interfaces.
13217
13218         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13219         name if this is an explicit interface implementation.
13220         (Indexer.InterfaceIndexerName): New public variable.  If we're
13221         implementing an interface indexer, this is the IndexerName in that
13222         interface.  Otherwise, it's the IndexerName.
13223         (Indexer.DefineMethod): If we're implementing interface indexer,
13224         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13225         and Pending.ImplementIndexer methods.
13226         (Indexer.Define): Also define the PropertyBuilder if we're
13227         implementing an interface indexer and this is neither an explicit
13228         interface implementation nor do the IndexerName match the one in
13229         the interface.
13230
13231         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13232         If a method is defined here, then we always need to create a proxy
13233         for it.  This is used when implementing interface indexers.
13234         (Pending.IsInterfaceIndexer): New public method.
13235         (Pending.ImplementIndexer): New public method.
13236         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13237         This is used when implementing interface indexers to define a proxy
13238         if necessary.
13239         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13240         define a proxy if necessary.
13241
13242         * interface.cs (Interface.IndexerName): New public variable.
13243         (Interface.PopulateIndexer): Set the IndexerName.
13244         (Interface.DefineIndexers): New private method.  Populate all the
13245         indexers and make sure their IndexerNames match.
13246
13247         * typemanager.cs (IndexerPropertyName): Added support for interface
13248         indexers.
13249
13250 2002-07-22  Martin Baulig  <martin@gnome.org>
13251
13252         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13253         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13254         ret if HasReturnLabel.
13255         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13256         variables.
13257
13258         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13259         and set the ec.LoopBeginTryCatchLevel.
13260         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13261         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13262         the current ec.TryCatchLevel, the branch goes out of an exception
13263         block.  In this case, we need to use Leave and not Br.
13264
13265 2002-07-22  Martin Baulig  <martin@gnome.org>
13266
13267         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13268         block unless the block does not always return or it is contained in
13269         another try { ... } catch { ... } block.  Fixes bug #26506.
13270         Added verify-1.cs to the test suite.
13271
13272 2002-07-22  Martin Baulig  <martin@gnome.org>
13273
13274         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13275         then we do not always return.  Fixes bug #24985.
13276
13277 2002-07-22  Martin Baulig  <martin@gnome.org>
13278
13279         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13280         lookup on a per-class level; ie. walk up the class hierarchy until we
13281         found at least one applicable method, then choose the best among them.
13282         Fixes bug #24463 and test-29.cs.
13283
13284 2002-07-22  Martin Baulig  <martin@gnome.org>
13285
13286         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13287         return types of the methods.  The return type is not part of the
13288         signature and we must not check it to make the `new' modifier work.
13289         Fixes bug #27999, also added test-147.cs.
13290         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13291
13292         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13293         on the method's return type.
13294
13295 2002-07-21  Martin Baulig  <martin@gnome.org>
13296
13297         * assign.cs: Make this work if the rightmost source is a constant and
13298         we need to do an implicit type conversion.  Also adding a few more tests
13299         to test-38.cs which should have caught this.
13300
13301         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13302         target in the makefile for this.  The makefile.gnu is primarily intended
13303         for end-users who don't want to debug the compiler.
13304
13305 2002-07-21  Martin Baulig  <martin@gnome.org>
13306
13307         * assign.cs: Improved the Assign class so it can now handle embedded
13308         assignments (X = Y = Z = something).  As a side-effect this'll now also
13309         consume less local variables.  test-38.cs now passes with MCS, added
13310         a few new test cases to that test.
13311
13312 2002-07-20  Martin Baulig  <martin@gnome.org>
13313
13314         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13315         instructions.  Fixes bug #27977, also added test-146.cs.
13316
13317 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13318
13319         * cs-tokenizer.cs: fixed getHex ().
13320
13321 2002-07-19  Martin Baulig  <martin@gnome.org>
13322
13323         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13324         not Type.GetType() to lookup the array type.  This is needed when
13325         we're constructing an array of a user-defined type.
13326         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13327         single-dimensional arrays, but also for single-dimensial arrays of
13328         type decimal.
13329
13330 2002-07-19  Martin Baulig  <martin@gnome.org>
13331
13332         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13333         this function is called, it's not allowed to share LocalBuilders
13334         among ILGenerators.
13335
13336 2002-07-19  Martin Baulig  <martin@gnome.org>
13337
13338         * expression.cs (Argument.Resolve): Report an error 118 when trying
13339         to pass a type as argument.
13340
13341 2002-07-18  Martin Baulig  <martin@gnome.org>
13342
13343         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13344         Conv_R_Un for the signed `long' type.
13345
13346 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13347
13348         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13349         `expr' for the temporary result, as that will fail if we do
13350         multiple resolves on the same expression.
13351
13352 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13355         ec.TypeContainer for looking up aliases. 
13356
13357         * class.cs (TypeContainer): Remove LookupAlias from here.
13358
13359         * decl.cs (DeclSpace); Move here.
13360
13361 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13362
13363         * class.cs (FindMembers): Only call filter if the constructor
13364         bulider is not null.
13365
13366         Also handle delegates in `NestedTypes' now.  Now we will perform
13367         type lookups using the standard resolution process.  This also
13368         fixes a bug.
13369
13370         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13371         This uses Expressions (the limited kind that can be parsed by the
13372         tree) instead of strings.
13373
13374         * expression.cs (ComposedCast.ToString): Implement, used to flag
13375         errors since now we have to render expressions.
13376
13377         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13378         FormArrayType. 
13379
13380         * ecore.cs (SimpleName.ToString): ditto.
13381
13382         * cs-parser.jay: Instead of using strings to assemble types, use
13383         Expressions to assemble the type (using SimpleName, ComposedCast,
13384         MemberAccess).  This should fix the type lookups in declarations,
13385         because we were using a different code path for this.
13386
13387         * statement.cs (Block.Resolve): Continue processing statements
13388         even when there is an error.
13389
13390 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13391
13392         * class.cs (Event.Define): Also remove the `remove' method from
13393         the list of pending items.
13394
13395         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13396         generate more compact code. 
13397
13398 2002-07-17  Martin Baulig  <martin@gnome.org>
13399
13400         * const.cs (Const.LookupConstantValue): Add support for constant
13401         `unchecked' and `checked' expressions.
13402         Also adding test case test-140.cs for this.
13403
13404 2002-07-17  Martin Baulig  <martin@gnome.org>
13405
13406         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13407         check whether mi.ReturnType implements the IEnumerator interface; the
13408         `==' and the IsAssignableFrom() will fail in this situation.
13409
13410 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13411
13412         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13413         here too.
13414
13415 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13416
13417         * expression.cs: fixed bug #27811.
13418
13419 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13420
13421         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13422         Molaro: when we are a ref, the value already contains a pointer
13423         value, do not take the address of it.
13424
13425 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13426         * removed mb-parser.jay and mb-tokenizer.cs
13427
13428 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13429
13430         * expression.cs: check against the building corlib void type.
13431
13432 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13433
13434         * ecore.cs: fix for valuetype static readonly fields: when 
13435         initializing them, we need their address, not the address of a copy.
13436
13437 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13438
13439         * typemanager.cs: register also enum_type in corlib.
13440
13441 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13442
13443         * class.cs: allow calling this (but not base) initializers in structs.
13444
13445 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13446
13447         * ecore.cs: make sure we compare against the building base types
13448         in GetTypeSize ().
13449
13450 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13451
13452         * typemanager.cs: fix TypeToCoreType() to handle void and object
13453         (corlib gets no more typerefs after this change).
13454
13455 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13456
13457         * expression.cs (ArrayCreation.EmitArrayArguments): use
13458         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13459
13460         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13461         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13462         array indexes, the runtime actually forbids them.
13463
13464         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13465         for array arguments here.
13466
13467         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13468         instead of the default for ValueTypes.
13469
13470         (New.DoEmit): Use IsValueType instead of
13471         IsSubclassOf (value_type)
13472         (New.DoResolve): ditto.
13473         (Invocation.EmitCall): ditto.
13474
13475         * assign.cs (Assign): ditto.
13476
13477         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13478         Statements *are* currently doing part of their resolution during
13479         Emit.  
13480
13481         Expressions do always resolve during resolve, but statements are
13482         only required to propagate resolution to their children.
13483
13484 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13485
13486         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13487
13488         (LoadAssembly): Do not add the dll if it is already specified
13489
13490         (MainDriver): Add the System directory to the link path at the end,
13491         after all the other -L arguments. 
13492
13493         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13494         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13495         ldelem.u1) and using the opposite for sbytes.
13496
13497         This fixes Digger, and we can finally run it.
13498
13499         * driver.cs (UnixParseOption): Move the option parsing here.  
13500         (CSCParseOption): Implement CSC-like parsing of options.
13501
13502         We now support both modes of operation, the old Unix way, and the
13503         new CSC-like way.  This should help those who wanted to make cross
13504         platform makefiles.
13505
13506         The only thing broken is that /r:, /reference: and /lib: are not
13507         implemented, because I want to make those have the same semantics
13508         as the CSC compiler has, and kill once and for all the confussion
13509         around this.   Will be doing this tomorrow.
13510
13511         * statement.cs (Unsafe.Resolve): The state is checked during
13512         resolve, not emit, so we have to set the flags for IsUnsfe here.
13513
13514 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13515
13516         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13517         not catch the Error_ObjectRefRequired in SimpleName (as it is
13518         possible to have a class/instance variable name that later gets
13519         deambiguated), we have to check this here.      
13520
13521 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13522
13523         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13524         make static and put into Expression.
13525
13526         (Event.Define): Register the private field of the event with the 
13527         TypeManager so that GetFieldFromEvent can get at it.
13528
13529         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13530         keep track of the private field associated with an event which
13531         has no accessors.
13532
13533         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13534         private field.
13535
13536         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13537
13538 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13539
13540         * expression.cs (Binary.EmitBranchable): this routine emits the
13541         Binary expression in a branchable context.  This basically means:
13542         we need to branch somewhere, not just get the value on the stack.
13543
13544         This works together with Statement.EmitBoolExpression.
13545
13546         * statement.cs (Statement.EmitBoolExpression): Use
13547         EmitBranchable. 
13548
13549 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13550
13551         * statement.cs (For): Reduce the number of jumps in loops.
13552
13553         (For): Implement loop inversion for the For statement.
13554
13555         (Break): We can be breaking out of a Try/Catch controlled section
13556         (foreach might have an implicit try/catch clause), so we need to
13557         use Leave instead of Br.
13558
13559         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13560         now).  If the instace expression supports IMemoryLocation, we use
13561         the AddressOf method from the IMemoryLocation to extract the
13562         address instead of emitting the instance.
13563
13564         This showed up with `This', as we were emitting the instance
13565         always (Emit) instead of the Address of This.  Particularly
13566         interesting when This is a value type, as we dont want the Emit
13567         effect (which was to load the object).
13568
13569 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13570
13571         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13572
13573         * statement.cs (Checked): Set the CheckedState during the resolve
13574         process too, as the ConvCast operations track the checked state on
13575         the resolve process, and not emit.
13576
13577         * cs-parser.jay (namespace_member_declaration): Flag that we have
13578         found a declaration when we do.  This is used to flag error 1529
13579
13580         * driver.cs: Report ok when we display the help only.
13581
13582 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13583
13584         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13585
13586 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13587
13588         * cs-tokenizer.cs (define): We also have to track locally the
13589         defines.  AllDefines is just used for the Conditional Attribute,
13590         but we also need the local defines for the current source code. 
13591
13592 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13593
13594         * statement.cs (While, For, Do): These loops can exit through a
13595         Break statement, use this information to tell whether the
13596         statement is the last piece of code.
13597
13598         (Break): Flag that we break.
13599
13600         * codegen.cs (EmitContexts): New `Breaks' state variable.
13601
13602 2002-07-03  Martin Baulig  <martin@gnome.org>
13603
13604         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13605         modifiers in method declarations in structs.  Otherwise, you won't
13606         be able to override things like Object.Equals().
13607
13608 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13609
13610         * class.cs (Method, Property, Indexer): Do not allow the public
13611         modifier to be used in explicit interface implementations.
13612
13613         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13614         override modifiers in method declarations in structs
13615
13616 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13617
13618         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13619         integer or real overflow, report an error
13620
13621 2002-07-02  Martin Baulig  <martin@gnome.org>
13622
13623         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13624         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13625         to tell the runtime about our newly created System.Object and
13626         System.ValueType types.
13627
13628 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13629
13630         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13631         struct instead of Ldarg/Starg.
13632
13633 2002-07-02  Martin Baulig  <martin@gnome.org>
13634
13635         * expression.cs (Indirection.Indirection): Call
13636         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13637
13638 2002-07-02  Martin Baulig  <martin@gnome.org>
13639
13640         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13641         ValueType, call TypeManager.TypeToCoreType() on it.
13642         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13643         the OpCodes.Newarr argument.
13644
13645 2002-07-02  Martin Baulig  <martin@gnome.org>
13646
13647         * expression.cs (Invocation.EmitCall): When compiling corlib,
13648         replace all calls to the system's System.Array type to calls to
13649         the newly created one.
13650
13651         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13652         System.Array methods.
13653         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13654         from the system's System.Array type which must be replaced.
13655
13656 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13657
13658         * typemanager.cs: load unverifiable_code_ctor so we can build
13659         corlib using the correct type. Avoid using GetTypeCode() with
13660         TypeBuilders.
13661         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13662         TypeManager.object_type to allow building corlib.
13663
13664 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13665
13666         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13667
13668 2002-07-01  Martin Baulig  <martin@gnome.org>
13669
13670         * class.cs: Make the last change actually work, we need to check
13671         whether `ifaces != null' to avoid a crash.
13672
13673 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13674
13675         * class.cs: when we build structs without fields that implement
13676         interfaces, we need to add the interfaces separately, since there is
13677         no API to both set the size and add the interfaces at type creation
13678         time.
13679
13680 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13681
13682         * expression.cs: the dimension arguments to the array constructors
13683         need to be converted if they are a long.
13684
13685 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13686
13687         * class.cs: don't emit ldarg.0 if there is no parent constructor
13688         (fixes showstopper for corlib).
13689
13690 2002-06-29  Martin Baulig  <martin@gnome.org>
13691
13692         MCS now compiles corlib on GNU/Linux :-)
13693
13694         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13695         ie. check for MethodImplOptions.InternalCall.
13696
13697         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13698         and TypeManager.attribute_type are null, so we must explicitly check
13699         whether parent is not null to find out whether it's an attribute type.
13700         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13701         and SetBuilder, not only if the property is neither abstract nor external.
13702         This is necessary to set the MethodImplOptions on the accessor methods.
13703         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13704         SetBuilder, see Property.Emit().
13705
13706         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13707         populate "System.Object", "System.ValueType" and "System.Attribute" since
13708         they've already been populated from BootCorlib_PopulateCoreTypes().
13709
13710 2002-06-29  Martin Baulig  <martin@gnome.org>
13711
13712         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13713         is the NullLiteral, we also need to make sure that target_type is not
13714         an enum type.   
13715
13716 2002-06-29  Martin Baulig  <martin@gnome.org>
13717
13718         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13719         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13720         before calling BootstrapCorlib_ResolveDelegate ().
13721
13722 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13723
13724         * statement.cs: fixed build-breaker. All tests passed ok.
13725
13726 2002-06-27  Martin Baulig  <martin@gnome.org>
13727
13728         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13729         for System.Decimal when compiling corlib.
13730
13731 2002-06-27  Martin Baulig  <martin@gnome.org>
13732
13733         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13734         switch blocks which contain nothing but a default clause.
13735
13736 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13737
13738        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13739
13740 2002-06-27  Martin Baulig  <martin@gnome.org>
13741
13742         * ecore.cs (PropertyExpr.PropertyExpr): Call
13743         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13744
13745         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13746         is already a TypeBuilder.
13747
13748 2002-06-27  Martin Baulig  <martin@gnome.org>
13749
13750         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13751         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13752         the "from an array-type to System.Array" case.  This makes it work
13753         when compiling corlib.
13754
13755 2002-06-27  Martin Baulig  <martin@gnome.org>
13756
13757         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13758         non-static PropertyExpr, set its InstanceExpression.  This makes
13759         the `ICollection.Count' property work in System/Array.cs.
13760
13761 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13762
13763         * driver.cs: Made error handling more consistent.  Errors now
13764         tracked by Report class, so many methods which used to return int
13765         now return void.  Main() now prints success/failure and 
13766         errors/warnings message.
13767
13768         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13769         the magic number return values (123 and 124).  Now, if the
13770         expected error occurs, the compiler exits with success (exit value
13771         0).  If the compilation completes without seeing that particular
13772         error, the compiler exits with failure (exit value 1).  The
13773         makefile in mcs/errors has been changed to handle the new behaviour.
13774
13775         * report.cs: Made 'expected error' number a property and renamed
13776         it from 'Probe' to 'ExpectedError'.
13777
13778         * genericparser.cs: Removed error handling support, since it is
13779         now all done by Report class.
13780
13781         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13782         class, so parse() no longer returns an int.
13783
13784         * namespace.cs: Use Report.Error instead of GenericParser.error
13785
13786 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13787
13788         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13789         TypeContainer.AddOperator): At the front of the list put the
13790         explicit implementations, so they get resolved/defined first. 
13791
13792 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13793
13794         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13795         interface type is implemented by this TypeContainer.  Used during
13796         explicit interface implementation.
13797
13798         (Property.Define, Indexer.Define, Method.Define): Validate that
13799         the given interface in the explicit implementation is one of the
13800         base classes for the containing type.
13801
13802         Also if we are explicitly implementing an interface, but there is
13803         no match in the pending implementation table, report an error.
13804
13805         (Property.Define): Only define the property if we are
13806         not explicitly implementing a property from an interface.  Use the
13807         correct name also for those properties (the same CSC uses,
13808         although that is really not needed).
13809
13810         (Property.Emit): Do not emit attributes for explicitly implemented
13811         properties, as there is no TypeBuilder.
13812
13813         (Indexer.Emit): ditto.
13814
13815         Hiding then means that we do not really *implement* a pending
13816         implementation, which makes code fail.
13817
13818 2002-06-22  Martin Baulig  <martin@gnome.org>
13819
13820         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13821         the return value of Object.GetType().  [FIXME: we need to do this whenever
13822         we get a type back from the reflection library].
13823
13824 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13825
13826         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13827
13828 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13829
13830         * attribute.cs: Return null if we can not look up the type.
13831
13832         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13833         the interface types found.
13834
13835         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13836         interface types found.
13837
13838         * typemanager.cs (GetInterfaces): Make this routine returns alll
13839         the interfaces and work around the lame differences between
13840         System.Type and System.Reflection.Emit.TypeBuilder in the results
13841         result for GetInterfaces.
13842
13843         (ExpandInterfaces): Given an array of interface types, expand and
13844         eliminate repeated ocurrences of an interface.  This expands in
13845         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13846         be IA, IB, IC.
13847
13848 2002-06-21  Martin Baulig  <martin@gnome.org>
13849
13850         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13851         on System.Enum.
13852
13853 2002-06-21  Martin Baulig  <martin@gnome.org>
13854
13855         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13856         and called with one of the core types, return the corresponding typebuilder for
13857         that type.
13858
13859         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13860         element type.
13861
13862 2002-06-21  Martin Baulig  <martin@gnome.org>
13863
13864         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13865         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13866         (Expression.ConvertReferenceExplicit): Likewise.
13867
13868         * expression.cs (ElementAccess.DoResolve): Likewise.
13869         (ElementAccess.DoResolveLValue): Likewise.
13870
13871 2002-06-10  Martin Baulig  <martin@gnome.org>
13872
13873         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13874         add the "value" parameter to the parameter list.
13875
13876         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13877         to our caller.
13878
13879 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13880
13881         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13882         the argument to an int, uint, long or ulong, per the spec.  Also
13883         catch negative constants in array creation.
13884
13885 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13886
13887         * class.cs: do not allow the same interface to appear twice in
13888         the definition list.
13889
13890 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13891
13892         * ecore.cs: don't use ldlen with System.Array.
13893
13894 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13895
13896         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13897
13898 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13899
13900         * modifiers.cs: produce correct field attributes for protected
13901         internal. Easy fix so miguel can work on ther harder stuff:-)
13902
13903 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13904
13905         * pending.cs: New file.  Move the code from class.cs here.
13906         Support clearning the pending flag for all methods (when not doing
13907         explicit interface implementation).
13908
13909 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13910
13911         * rootcontext.cs: added a couple more types needed to bootstrap.
13912
13913 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13914
13915         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13916         constructor in the type, instead of any constructor in the type
13917         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13918         a bug in the Mono runtime when applying the params attribute). 
13919
13920 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13921         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13922
13923 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13924
13925         * expression.cs (Unary.ResolveOperator): Use TypeManager
13926         to resolve the type.
13927
13928 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13929
13930         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13931         attached.
13932
13933         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13934         with each member too.
13935
13936         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13937         field builders too - this takes care of the enum member case.
13938
13939 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13940
13941         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13942         address-of operator on both value types and pointers.
13943
13944 2002-06-10  Martin Baulig  <martin@gnome.org>
13945
13946         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13947         PropertyBuilder to the `property_builders' list.
13948
13949         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13950         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13951         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13952         find any indexers which are inherited from an interface.
13953
13954 2002-06-09  Martin Baulig  <martin@gnome.org>
13955
13956         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13957         the same type as the constant if necessary.  There's also a test-130.cs
13958         for this.
13959
13960         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13961
13962         * typemanager.cs (TypeManager.ChangeType): Previously known as
13963         Enum.ChangeEnumType().
13964
13965 2002-06-09  Martin Baulig  <martin@gnome.org>
13966
13967         * expression.cs (Cast.TryReduce): Added support for consts.
13968
13969 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13970
13971         * class.cs (Accessor): Hold attributes information so we can pass
13972         it along.
13973
13974         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13975         Modify to pass in attributes attached to the methods.
13976
13977         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13978
13979         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13980         to handle the Accessor kind :-)
13981
13982         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13983
13984 2002-06-08  Martin Baulig  <martin@gnome.org>
13985
13986         * expression.cs (Unary.TryReduceNegative): Added support for
13987         ULongConstants.
13988
13989 2002-06-08  Martin Baulig  <martin@gnome.org>
13990
13991         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13992         name can't be found in the `defined_names' - the caller will do a
13993         MemberLookup in this case and thus find methods in System.Enum
13994         such as Enum.IsDefined().
13995
13996 2002-06-08  Martin Baulig  <martin@gnome.org>
13997
13998         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13999         Convert.ChangeType() which works with TypeBuilder created types.
14000         (Enum.LookupEnumValue, Enum.Define): Use it here.
14001
14002         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14003         `TypeBuilder.BaseType != null' check.
14004         (TypeContainer.FindMembers): Only lookup parent members if we
14005         actually have a parent.
14006         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14007         (ConstructorInitializer.Resolve): Likewise.
14008
14009         * interface.cs (Interface.FindMembers): Added
14010         `TypeBuilder.BaseType != null' check.
14011
14012         * rootcontext.cs (RootContext.ResolveCore): Added
14013         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14014         classes_second_stage.
14015
14016         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14017         debug_type and trace_type when compiling with --nostdlib.       
14018
14019 2002-06-07  Martin Baulig  <martin@gnome.org>
14020
14021         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14022         (AddField): Set it to true when adding a non-static field.
14023         (DefineType): Use `have_nonstatic_fields' to find out whether we
14024         have non-static fields, not `Fields != null'.
14025
14026 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14027
14028         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14029         dereferencing a null on the static-field code path)
14030
14031 2002-05-30  Martin Baulig  <martin@gnome.org>
14032
14033         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14034         to take command line arguments.  Use reflection to call the new
14035         custom `Initialize' function on the symbol writer and pass it the
14036         command line arguments.
14037
14038         * driver.cs (--debug-args): New command line argument to pass command
14039         line arguments to the symbol writer.
14040
14041 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14042
14043         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14044         the target type for indexers and properties.  Thanks to Joe for
14045         catching this.
14046
14047 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14048
14049         * typemanager.cs (MethodFlags): returns the method flags
14050         (Obsolete/ShouldIgnore) that control warning emission and whether
14051         the invocation should be made, or ignored. 
14052
14053         * expression.cs (Invocation.Emit): Remove previous hack, we should
14054         not do this on matching a base type, we should do this based on an attribute
14055
14056         Only emit calls to System.Diagnostics.Debug and
14057         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14058         on the command line.
14059
14060         * rootcontext.cs: Global settings for tracing and debugging.
14061
14062         * cs-tokenizer.cs (define): New utility function to track
14063         defines.   Set the global settings for TRACE and DEBUG if found.
14064
14065 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14066
14067         * interface.cs (Populate*): Pass in the TypeContainer as well as
14068         the DeclSpace as parameters so that we can create EmitContexts and
14069         then use that to apply attributes etc.
14070
14071         (PopulateMethod, PopulateEvent, PopulateProperty)
14072         (PopulateIndexer): Apply attributes everywhere.
14073
14074         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14075         etc.
14076
14077         (ApplyAttributes): Update accordingly.
14078
14079         We now apply interface attributes for all members too.
14080
14081 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14082
14083         * class.cs (Indexer.Define); Correctly check if we are explicit
14084         implementation (instead of checking the Name for a ".", we
14085         directly look up if the InterfaceType was specified).
14086
14087         Delay the creation of the PropertyBuilder.
14088
14089         Only create the PropertyBuilder if we are not an explicit
14090         interface implementation.   This means that explicit interface
14091         implementation members do not participate in regular function
14092         lookups, and hence fixes another major ambiguity problem in
14093         overload resolution (that was the visible effect).
14094
14095         (DefineMethod): Return whether we are doing an interface
14096         implementation. 
14097
14098         * typemanager.cs: Temporary hack until we get attributes in
14099         interfaces (Ravi is working on that) and we get IndexerName
14100         support in interfaces.
14101
14102         * interface.cs: Register the indexers as properties.
14103
14104         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14105         warning, I have verified that this is a bug in the .NET runtime
14106         (JavaScript suffers of the same problem).
14107
14108         * typemanager.cs (MemberLookup): When looking up members for
14109         interfaces, the parent of an interface is the implicit
14110         System.Object (so we succeed in searches of Object methods in an
14111         interface method invocation.  Example:  IEnumerable x;  x.ToString
14112         ()) 
14113
14114 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14115
14116         * class.cs (Event): Events should also register if they do
14117         implement the methods that an interface requires.
14118
14119         * typemanager.cs (MemberLookup); use the new GetInterfaces
14120         method. 
14121
14122         (GetInterfaces): The code used to lookup interfaces for a type is
14123         used in more than one place, factor it here. 
14124
14125         * driver.cs: Track the errors at the bottom of the file, we kept
14126         on going.
14127
14128         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14129         instance if the method we are calling is static!
14130
14131 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14132
14133         * attribute.cs (ApplyAttributes): Make this function filter out
14134         the IndexerName attribute (as that attribute in reality is never
14135         applied) and return the string constant for the IndexerName
14136         attribute. 
14137
14138         * class.cs (TypeContainer.Emit): Validate that all the indexers
14139         have the same IndexerName attribute, and if so, set the
14140         DefaultName attribute on the class. 
14141
14142         * typemanager.cs: The return value might contain other stuff (not
14143         only methods).  For instance, consider a method with an "Item"
14144         property and an Item method.
14145
14146         * class.cs: If there is a problem with the parameter types,
14147         return. 
14148
14149 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14150
14151         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14152         looks at user defined conversion after making a call to 
14153         StandardConversionExists - we need this for overload resolution.
14154
14155         * expression.cs : Update accordingly the various method calls.
14156
14157         This fixes 2 bugs filed against implicit user defined conversions 
14158
14159 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14160
14161         * statement.cs: Track the result of the assignment.
14162
14163 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14164
14165         * expression.cs (MemberAccess): Improved error reporting for
14166         inaccessible members.
14167
14168 2002-05-22  Martin Baulig  <martin@gnome.org>
14169
14170         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14171         itself with debugging support.
14172
14173 2002-05-22  Martin Baulig  <martin@gnome.org>
14174
14175         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14176         Removed, this isn't needed anymore.
14177
14178 2002-05-20  Martin Baulig  <martin@gnome.org>
14179
14180         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14181         be underlying type for an enum.
14182
14183 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14184
14185         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14186         that splits out the loading of just the core types.
14187
14188         * rootcontext.cs (ResolveCore): Split the struct resolution in
14189         two, so we can load the enumeration underlying types before any
14190         enums are used.
14191
14192         * expression.cs (Is): Bandaid until we fix properly Switch (see
14193         bug #24985 for details).
14194
14195         * typemanager.cs (ImplementsInterface): The hashtable will contain
14196         a null if there are no interfaces implemented.
14197
14198 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14199
14200         * cs-parser.jay (indexer_declarator): It is fine to have array
14201         parameters
14202
14203 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14204
14205         * typemanager.cs: (RegisterBuilder): New function used to register
14206         TypeBuilders that implement interfaces.  Since
14207         TypeBuilder.GetInterfaces (as usual) does not work with lame
14208         Reflection.Emit. 
14209         (AddUserType): register interfaces.
14210
14211         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14212         dealing with TypeBuilder.  Also, arrays are showing up as
14213         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14214         methods can not be invoked on them!
14215
14216         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14217         (ImplicitReferenceConversionExists): Split out from
14218         StandardConversionExists. 
14219
14220         * expression.cs (As): We were only implementing one of the three
14221         cases for the as operator.  We now implement them all.
14222         (Is): Implement the various other cases for Is as well.
14223
14224         * typemanager.cs (CACHE): New define used to control if we want or
14225         not the FindMembers cache.  Seems to have a negative impact on
14226         performance currently
14227
14228         (MemberLookup): Nested types have full acess to
14229         enclosing type members
14230
14231         Remove code that coped with instance/static returns for events, we
14232         now catch this in RealFindMembers.
14233
14234         (RealFindMembers): only perform static lookup if the instance
14235         lookup did not return a type or an event.  
14236
14237 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14238
14239         * assign.cs (CompoundAssign): We pass more semantic information
14240         now to Compound Assignments than we did before: now we have all
14241         the information at hand, and now we resolve the target *before* we
14242         do the expression expansion, which allows the "CacheValue" method
14243         to have the effect we intended (before, a [x] += 1 would generate
14244         two differen ArrayAccess expressions from the ElementAccess,
14245         during the resolution process).
14246
14247         (CompoundAssign.DoResolve): Resolve target and original_source here.
14248
14249 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14250
14251         * expression.cs (ArrayAccess): dropped debugging information. 
14252
14253         * typemanager.cs: Small bug fix: I was always returning i_members,
14254         instead of one of i_members or s_members (depending on which had
14255         the content).
14256
14257         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14258         method is invoked before any code generation takes place, and it
14259         is a mechanism to inform that the expression will be invoked more
14260         than once, and that the method should use temporary values to
14261         avoid having side effects
14262
14263         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14264
14265         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14266         implementation.
14267
14268         * expression.cs (Indirection, ArrayAccess): Add support for
14269         CacheTemporaries in these two bad boys. 
14270
14271         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14272         ldobj or ldind_ref.  
14273         (StoreFromPtr): Handle stobj as well.
14274
14275         * expression.cs (UnaryMutator): Share more code.
14276
14277         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14278         down: I was not tracking the Filter function as well, which
14279         was affecting the results of the cache.
14280
14281 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14282
14283         * attribute.cs: Remove the hack to handle the CharSet property on
14284         StructLayouts. 
14285
14286 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14287
14288         * attribute.cs (DoResolve): More uglyness, we now only try to
14289         resolve the attribute partially, to extract the CharSet
14290         information (only if we are a StructLayout attribute).  Otherwise 
14291
14292         (GetExtraTypeInfo): Add some code to conditionally kill in the
14293         future this.   I am more and more convinced that the .NET
14294         framework has special code to handle the attribute setting on
14295         certain elements.
14296
14297         * expression.cs (IsParamsMethodApplicable): Revert my previous
14298         foreach change here, it was wrong.
14299
14300 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14301
14302         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14303         (pp_expr): do not abort on unknown input, just return.
14304         (eval): abort if there are pending chars.
14305
14306         * attribute.cs (Attribute.Resolve): Positional parameters are
14307         optional.  Deal with that case.
14308
14309         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14310         the Ansi/Unicode/Auto information for the type.
14311
14312         (TypeContainer.DefineType): instantiate the EmitContext here, as
14313         we will be using it during the type definition (to resolve
14314         attributes) and during the emit phase.
14315
14316         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14317         to pull type information out of the attributes
14318
14319         (Attribute.Resolve): track the constructor builder, and allow for
14320         multiple invocations (structs and classes will use this).
14321
14322         * ecore.cs (MemberLookupFinal): new version with all the
14323         parameters customizable.
14324
14325         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14326         constructors.  Return if the result value is null (as the error
14327         would have been flagged already by MemberLookupFinal)
14328
14329         Do not allow instances of abstract classes or interfaces to be
14330         created.
14331
14332         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14333         We have to compare the assembly property here when dealing with
14334         FamANDAssem and Assembly access modifiers, because we might be
14335         creating an assembly from *modules* (that means that we are not
14336         getting TypeBuilders for types defined in other modules that are
14337         part of this assembly).
14338
14339         (Method.Emit): If the method is marked abstract and has a body,
14340         emit an error. 
14341
14342         (TypeContainer.DefineMembers): If both the defined member and the
14343         parent name match are methods, then do not emit any warnings: let
14344         the Method.Define routine take care of flagging warnings.  But if
14345         there is a mismatch (method overrides something else, or method is
14346         overriwritten by something, then emit warning).
14347
14348         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14349         set to null, this means `do not check for the return type on the
14350         signature'. 
14351
14352         (Method.Define): set the return type for the method signature to
14353         null, so that we get methods with the same name and parameters and
14354         different return types.  This is used to flag warning 114 (you are
14355         hiding a method, and you probably want to use the new/override
14356         keywords instead).
14357
14358         * typemanager.cs (MemberLookup): Implemented proper access
14359         control, closing a long standing set of bug reports.  The problem
14360         was that the Framework only has two bits: Public and NonPublic,
14361         and NonPublic includes private and protected methods, but we need
14362         to enforce the FamANDAssem, FamOrAssem and Family. 
14363
14364 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * statement.cs (GotoCase): Return true: Ammounts to giving up
14367         knowledge on whether we return or not, and letting the other case
14368         be responsible for it.
14369
14370 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14371
14372         * driver.cs: Do not load directories for each file processed, only
14373         do it if there is a pattern.
14374
14375         * ecore.cs: Report readonly assigns here as well, as we might have
14376         been resolved only by MemberAccess.
14377
14378         (SimpleName.SimpleNameResolve): Also be useful for LValue
14379         resolution.   We need this to propagate assign to local readonly variables
14380
14381         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14382         do not want to reuse potential criteria memory.
14383
14384         * class.cs (MyEventBuilder): Set reflected_type;
14385
14386         * ecore.cs (Constantify): Added support for constifying bools.
14387
14388         (RootContext.LookupType): Added a cache for values looked up in
14389         the declaration space.
14390
14391         * typemanager.cs (FindMembers): Now is a front-end to
14392         RealFindMembers, and provides a two-level hashtable-based cache to
14393         the request.  
14394
14395         15% performance improvement: from 22.5 to 19.2 seconds.
14396
14397         * expression.cs (IsParamsMethodApplicable): use foreach.
14398         (Invocation.DoResolve): ditto.
14399         (New.DoResolve): ditto.
14400         (ArrayCreation.DoResolve): ditto.
14401
14402         * ecore.cs (FindMostEncompassingType): use foreach.
14403
14404         * delegate.cs (NewDelegate.DoResolve): Use foreach
14405
14406         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14407         (RemoveMethods): use foreach.
14408
14409         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14410         nested foreach statements instead of for, and also break out of
14411         the inner loop once a match is found.
14412
14413         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14414
14415 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14416
14417         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14418         we actually unwrap the expression to allow for extra information
14419         to be extracted. 
14420
14421         * expression.cs: Use Shr_Un on unsigned operations. 
14422
14423 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14424
14425         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14426         applicable operators was not being considered correctly. This closes
14427         the bug Miguel reported.
14428
14429 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14430
14431         * attribute.cs: check that the type derives from System.Attribute
14432         and report the correct error in that case (moved the duplicate code to
14433         its own method, too).
14434
14435 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14436
14437         * attribute.cs: lookup attribute type name as the spec says: first the
14438         bare attribute name and then name + "Attribute" (nant compiles with
14439         mcs after this fix).
14440
14441 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14442
14443         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14444         Because of the way we parse things, we should try to see if a
14445         UIntConstant can fit in an integer.
14446
14447 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14448
14449         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14450         when we are in an explicit context.
14451
14452         (ConvertReferenceExplicit): When converting from Iface type S to Class
14453         T make sure the rules are implemented as an OR.
14454
14455         * parameter.cs (ParameterType): Make it a property for now although the
14456         purpose really isn't anything immediate.
14457
14458         * expression.cs (Is*Applicable): Do better checking on the parameter type
14459         of a ref/out parameter. The ones from the system assemblies are already 
14460         marked with the correct type so we don't need to do any correction.
14461
14462         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14463         the object type is standard too so include that.
14464
14465 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14466
14467         * ecore.cs (StandardConversionExists): Augment with missing code:
14468         deal with IntConstant, LongConstants and Enumerations.
14469
14470         * assign.cs: Report the error, instead of failing silently
14471
14472         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14473         typecontainer that they are declared, because the
14474         typecontainer/namespace will have the list of using clauses that
14475         need to be applied.
14476
14477         Assembly Attributes were escaping the normal registration
14478         mechanism. 
14479
14480         (EmitCode): Apply attributes within an EmitContext that represents
14481         the container they were declared on.
14482
14483         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14484
14485 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14486
14487         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14488         Revamp completely - make much cleaner as we now operate only
14489         on a set of Types.
14490
14491         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14492         to implement the logic detailed in the spec more correctly.
14493
14494         (UserDefinedConversion): Update accordingly.
14495
14496 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14497
14498         * statement.cs: Return flow analysis information up.
14499
14500         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14501         and the default.
14502
14503         (token): Do not consume an extra character before calling
14504         decimal_digits.
14505
14506 2002-05-06  Piers Haken <piersh@friskit.com>
14507
14508         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14509
14510 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14511
14512         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14513         EmitContext during the instance constructor initializer
14514         resolution, to stop access to instance variables.
14515
14516         This is mandated by the spec, last paragraph of the `constructor
14517         initializers' section. 
14518
14519 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14520
14521         * cs-parser.jay, class.cs (Accessor): new class used to represent
14522         an accessor (get or set).  In the past we used `null' to represent
14523         a missing accessor.  But this is ambiguous because there was no
14524         way to tell in abstract indexers/properties if one of them was
14525         specified.
14526
14527         Now there is a way of addressing that.
14528
14529         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14530         instead of FindMembers.
14531
14532         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14533         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14534
14535         * attribute.cs: Treat indexers and properties as the same in terms
14536         of applying attributes
14537
14538         * ecore.cs (FindMostEncompassedType): Use statically initialized
14539         EmptyExpressions()s like we do elsewhere to avoid creating useless
14540         objects (and we take this out of the tight loop).
14541
14542         (GetConversionOperators): Move the code to extract the actual
14543         operators to a separate routine to clean things up.
14544
14545 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14546
14547         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14548         events are always registered FieldBuilders.
14549
14550         * class.cs (FieldBase): New class shared by Fields 
14551
14552         * delegate.cs: If we are a toplevel delegate, use our full name.
14553         If we are a nested delegate, then only use our tail name.
14554
14555 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14556
14557         * expression.cs (IsApplicable): Ensure that we add the "&" to
14558         ref/out types before comparing it with the type of the argument.
14559
14560         (IsParamsMethodApplicable): Ditto.
14561
14562         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14563         silly me ;-)
14564
14565         * delegate.cs : Handle the case when we have more than one applicable
14566         method. Flag an error only when we finish checking all.
14567
14568 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * expression.cs: Add support for boolean static initializers.
14571
14572 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14573
14574         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14575
14576         * parameter.cs (ComputeParameterTypes,
14577         ComputeAndDefineParameterTypes): Better error handling: now we
14578         clear the `types' cache if we fail during any of the type lookups.
14579         We also return the status code correctly to our caller
14580
14581         * delegate.cs: If we fail to define a delegate, abort the extra
14582         steps. 
14583
14584         * expression.cs (Binary.ResolveOperator): for
14585         operator==(object,object) and operator !=(object, object) we also
14586         have to verify that there is an implicit conversion from one to
14587         the other.
14588
14589         (ArrayAccess.DoResolve): Array Access can operate on
14590         non-variables. 
14591
14592 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14593
14594         * assign.cs (CompoundAssign): A new class used as a "flag" that
14595         the assignment actually is happening as part of a compound
14596         assignment operator.
14597
14598         During compound assignment, a few new rules exist to enable things
14599         like:
14600
14601         byte b |= 1 + 2
14602
14603         From the spec:
14604
14605         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14606         to the type of x) if y is implicitly convertible to the type of x,
14607         and the operator is a builtin operator and the return type of the
14608         operator is explicitly convertible to the type of x. 
14609
14610         * rootcontext.cs: Reset warning level to 2.  4 catches various
14611         "interesting" features in mcs, we must clean this up at some
14612         point, but currently am trying to kill other bugs ;-)
14613
14614         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14615         in container classes as well.  
14616
14617         * expression.cs (Binary.ResolveOperator): Handle string case
14618         before anything else (as operator overloading does emit an error
14619         before doing anything else).
14620
14621         This code could go away when we move to a table driven model, but
14622         i could not come up with a good plan last night.
14623
14624 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14625
14626         * typemanager.cs (CSharpName): reimplementation using regex.
14627         * class.cs: added null check for fields in Emit
14628         * rootcontext.cs: set warninglevel to 4
14629
14630 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14631
14632         * typemanager.cs (CSharpName): reimplemented with Lupus
14633         suggestion.
14634
14635 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14636
14637         * statement.cs (If): correclty implement Resolve, because we were
14638         not catching sem errors in there.  The same process is needed
14639         everywhere else. 
14640         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14641
14642
14643         (Statement.Warning_DeadCodeFound): Factorize code.
14644         (While): Report dead code here too.
14645
14646         (Statement): Added Resolve virtual method to allow
14647         for resolution split from the emit code.
14648
14649 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14650
14651         * statement.cs (EmitBoolExpression): No longer try to resolve the
14652         expression here.    
14653         (MakeBoolean): New utility function that resolve, implicitly
14654         converts to boolean and tags the expression. 
14655
14656
14657         (If, Do): Implement dead code elimination.
14658         (While): Implement loop inversion
14659
14660         (Do, While, For, If): Resolve the expression prior to calling our
14661         code generation.
14662
14663 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14664
14665         * class.cs:
14666           - added method Report28 (warning: program has more than one entry point)
14667           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14668           - modified method Method.Define, the part at the end of the method
14669
14670         * rootcontext.cs: added static public Location EntryPointLocation;
14671           
14672         * ../errors/cs0028.cs : Add test case for the above warning.              
14673
14674         * typemanager.cs:
14675           - modified method CSharpName to allow arrays of primitive type to
14676             be printed nicely (e.g. instead of System.Int32[][] it now prints
14677             int[][])
14678           - added method CSharpSignature: returns the signature of a method
14679             in string format to be used in reporting errors, warnings, etc.
14680
14681         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14682         with String.Empty.
14683
14684 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14685
14686         * delegate.cs (Define): Fix extremely silly bug where I was
14687         setting the type of the 'object' parameter of the BeginInvoke
14688         method to System.IAsyncResult instead of System.Object ;-)
14689
14690 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14691
14692         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14693         here. 
14694
14695         (Constructor.Emit): return if we fail to initialize the
14696         constructor.  Another door closed!  
14697
14698         * expression.cs (New.DoResolve): Improve error message (from -6 to
14699         1501).  Use DeclaredOnly lookup to find the exact constructor.
14700
14701         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14702         loop.  This is useful.
14703
14704         * cs-parser.jay: Adjust the default parameters so that destructors
14705         have the proper signature.
14706
14707 2002-04-26  Martin Baulig  <martin@gnome.org>
14708
14709         * driver.cs (LoadAssembly): If `assembly' contains any characters
14710         which are only valid in path names and not in assembly names
14711         (currently slash, backslash and point), use Assembly.LoadFrom ()
14712         instead of Assembly.Load () on the `assembly' (before iteration
14713         over the link_paths).
14714
14715 2002-04-26  Martin Baulig  <martin@gnome.org>
14716
14717         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14718
14719 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14720
14721         * class.cs (Property): use the new typemanager.MemberLookup
14722
14723         (TypeContainer.MemberLookup): Implement using the
14724         TypeManager.MemberLookup now. 
14725
14726         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14727         and return MemberInfos, so that these can be used without an
14728         EmitContext (what we had before).
14729
14730 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14731
14732         * expression.cs: Fix the case where the argument to params if the
14733         type of the params.  I omitted handling this before.   Fixed
14734
14735 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * driver.cs: Call BootCorlib_PopulateCoreType
14738
14739         * class.cs (Property.CheckBase): Check for properties only, not
14740         for all members. 
14741
14742         * interface.cs: Temporary hack: try/catch around the
14743         CustomAttributeBuilder, because I am getting an exception that I
14744         do not understand.
14745
14746         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14747         types whose definitions are required to be there (attributes are
14748         defined before standard types).
14749
14750         Compute definitions as we boot the various types, as they are used
14751         immediately (value_type class will need object_type, but if we do
14752         not initialize object_type, we will pass a null, which will let
14753         the runtime pick the System.Object from the existing corlib, which
14754         is not what we want).
14755
14756 2002-04-22  Patrik Torstensson <totte@labs2.com>
14757
14758         * cs-tokenizer.cs: fixed a number of trim() issues.
14759
14760 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14761
14762         * expression.cs (Argument.Type): Ensure that we return the correct
14763         type when we have out or ref parameters [in which case we 
14764         append a "&"].
14765
14766 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * class.cs (Property, Indexer): Allow extern modifier in there. 
14769
14770         * typemanager.cs (InitBaseTypes): Initializes object_type and
14771         value_type, since those will be used early on during the bootstrap
14772         process to compile corlib.
14773
14774         (InitCoreTypes): Move code from here to InitBaseTypes.
14775
14776 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14777
14778         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14779         single-dimension arrays as using the ldlen opcode.  
14780
14781         Daniel Lewis discovered this optimization.  
14782
14783         * typemanager.cs: Add signature for System.Array::get_Length
14784
14785 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14786
14787         * statement.cs: report the error when the foreach does not apply to an
14788         array nor a collection.
14789
14790 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14791
14792         * expression.cs: Add implicit conversions to the operator ~.
14793
14794         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14795
14796         * typemanager.cs: Locate the decimal constructor.
14797
14798 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14799
14800         * attribute.cs: use the new property of TypeOf.
14801         * expression.cs: added 'get' property around typearg.
14802
14803         These changes fix a build breaker reported by NickD. Is this the
14804         correct way to fix?  If not, please, revert my changes and make it
14805         work :-).
14806
14807 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14808
14809         * attribute.cs: Add support for typeof in attribute invocations.
14810         I am not sure that this is right though.
14811
14812 2002-04-14  Duncan Mak  <duncan@ximian.com>
14813
14814         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14815         Binary.Operator.Division case.
14816
14817 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14818
14819         * class.cs (DefineType): Ensure that we do a proper check on
14820         attribute types and also register it with the TypeManager.
14821
14822         (TypeContainer.Targets): The default for attribute types is
14823         AttributeTargets.All.
14824
14825         * attribute.cs (ApplyAttributes): Registering the attribute type
14826         is done elsewhere, not when we discover we have a Usage attribute.
14827
14828 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14829
14830         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14831         and get rid of is_delegate parameter.
14832
14833         * everywhere : update.
14834
14835 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14836
14837         * cs-parser.jay (compilation_unit): Revamp completely to use
14838         some new ideas that I got from Rhys' grammar to solve the problems
14839         with assembly level attributes.
14840
14841         (outer_declaration): New grammar production.
14842
14843         (attribute_sections): Add.
14844
14845         (opt_attributes): Base on attribute_sections
14846
14847         (namespace_declaration): Allow opt_attributes to tackle the case
14848         when we have assembly level attributes - we are clever in this
14849         regard now ;-)
14850
14851         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14852         attributes in the non-global context.
14853
14854         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14855         instead of SetGlobalAttributes.
14856
14857         * class.cs, rootcontext.cs : Ensure we define and generate 
14858         attribute types before anything else.
14859
14860         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14861         and flag the new error -20 for the case when the attribute type
14862         does not have valid targets specified. csc does not catch this.
14863
14864         * ../errors/errors.txt : update for error # -20
14865
14866 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14867
14868         * support.cs (InternalParameters.ParameterModifier): Do some null
14869         checking and return sane values.
14870
14871         * class.cs (Method.Define): If we are a PInvoke method, ensure
14872         that we are static and extern. Report error # 601
14873
14874         * ../errors/cs0601.cs : Add test case for the above error.
14875
14876 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14877
14878         * rootcontext.cs (attribute_types): We need to keep type of
14879         all attribute types separately and emit code for them first.
14880
14881         (RegisterAttribute) : Implement.
14882
14883         * class.cs (DefineType): Check if the current Type is a custom
14884         attribute type and register it accordingly.
14885
14886         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14887         adding the first attribute twice and rename to
14888
14889         (SetGlobalAttributes): this.
14890
14891         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14892         lookups.
14893
14894         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14895         if we are processing global arguments. Hmm, I am unsure of this.
14896
14897 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14898
14899         * expression.cs: added static array of strings to avoid calling
14900         Enum.ToString () for Operator in Binary. Significant recover of
14901         performance.
14902
14903 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * class.cs (FindMembers): Allow the Builders of the various
14906         members to be null.  If they are skip them.  This only happens
14907         during the PInvoke declaration.
14908
14909 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14910
14911         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14912         failure, so we do not keep going afterwards.
14913
14914         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14915         wanted to pass `false' as the `is_delegate' argument.  If this is
14916         the case, why not use delegate_type == null to mean `is_delegate =
14917         false' and anything else as is_delegate = true.
14918
14919 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14920
14921         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14922         code for the section, not the beginning of the tests.
14923
14924 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14925
14926         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14927
14928         * expression.cs (Binary): same.  Warn about errors where we have
14929         Enum/Enum in operator + as well.
14930
14931 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14932
14933         * statement.cs:
14934                 - added support for switch(bool)
14935                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14936                 - add TableSwitchEmit() to handle table-based switch statements
14937
14938 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14939
14940         * expression.cs (Invocation.OverloadResolve): Factor out code which
14941         does parameter compatibility checking with arguments so that we can 
14942         re-use the code even from Delegate.VerifyApplicability
14943
14944         (VerifyArgumentsCompat): Move above code here.
14945
14946         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14947         and instead make a call to the above method.
14948
14949 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14950
14951         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14952         We use it to keep track of classes which are attribute types.
14953
14954 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14955
14956         * delegate.cs (Delegate.Define): Correctly define the types in the
14957         presence of fixed and array parameters.
14958
14959         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14960         doing FindMembers.
14961
14962         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14963         include NonPublic after the first iteration.
14964
14965         * class.cs (Indexer.CheckBase): Only check if both parents are
14966         non-null. 
14967
14968         * cs-parser.jay (accessor_body): If empty, set to null.
14969
14970         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14971         same code path here to resolve constants names that we did have in
14972         MemberAccess.DoResolve.  There is too much code duplicated here.
14973
14974 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14975
14976         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14977
14978         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14979         to MakeUnionSet.
14980
14981         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14982         tokens, numbers and strings.
14983
14984         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14985         parenthesis.
14986
14987         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14988         asyncronous parameters and the regular parameters.  
14989
14990         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14991         specify the target directory.
14992
14993         * expression.cs: (This.DoResolve): Simplify
14994         (As.Emit): Optimize, do not generate IsInst if the expression is
14995         always of the given type.
14996
14997         (Is.DoResolve): Bug fix, we were reporting both always/never for
14998         the is expression.
14999
15000         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15001         creating too many unnecessary arrays.
15002
15003 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15004
15005         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15006         fields instead of rolling our own initializer.   Takes care of all
15007         implicit conversions, and drops unnecessary static checks/argument.
15008
15009 2002-03-31  Dick Porter  <dick@ximian.com>
15010
15011         * driver.cs: use the GetDirectories() return values properly, and
15012         use "/" as path separator.
15013
15014 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15015
15016         * expression.cs (Unary): Optimize - - expr into expr.
15017         (Binary): Optimize a + (-b) into a -b.
15018
15019         * codegen.cs (CodeGen): Made all methods static.
15020
15021 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15022
15023         * rootcontext.cs: 
15024
15025         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15026         TypeBuilder property.
15027
15028         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15029         instead. 
15030
15031         * tree.cs: Removed the various RecordXXXX, and replaced with a
15032         single RecordDecl.  Removed all the accessor methods, and just
15033         left a single access point Type 
15034
15035         * enum.cs: Rename DefineEnum to DefineType.
15036
15037         * decl.cs: New abstract method `DefineType' used to unify the
15038         Defines for Enumerations, Interfaces, TypeContainers and
15039         Delegates.
15040
15041         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15042         LookupBaseClasses method that used to live in class.cs and
15043         interface.cs here, and renamed to FindType.
15044
15045         * delegate.cs: Implement DefineType.  Take advantage of the
15046         refactored pattern for locating the parent builder without taking
15047         the parent_builder argument (which we know does not work if we are
15048         nested, and triggering a toplevel definition).
15049
15050 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15051
15052         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15053         accessibility of a member has changed during override and report
15054         an error if so.
15055
15056         * class.cs (Method.Define, Property.Define): Only complain on
15057         overrides if the method is private, any other accessibility is
15058         fine (and since we just checked the permission is the same, we are
15059         good to go).
15060
15061         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15062         and elif are processed always.  The other pre-processing
15063         directives are only processed if we are "taking" the path
15064
15065 2002-03-29  Martin Baulig  <martin@gnome.org>
15066
15067         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15068         current location is not Null.
15069
15070         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15071         a separate method so we can profile it.
15072
15073         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15074         `span.Seconds' are just seconds, but no minutes or hours.
15075         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15076
15077 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15078
15079         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15080         Remove the gratuitous set of Final:
15081
15082                                 // If an interface implementation, then we can set Final.
15083                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15084                                     implementing.DeclaringType.IsInterface)
15085                                         flags |= MethodAttributes.Final;
15086
15087         I do not know what I was smoking when I used that.
15088
15089
15090         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15091         step into fixing the name resolution issues for delegates and
15092         unifying the toplevel name resolution.
15093
15094 2002-03-28  Martin Baulig  <martin@gnome.org>
15095
15096         * class.cs (Method.Emit): If we have a symbol writer, call its
15097         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15098         tell it about the current method.
15099
15100         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15101         writer that we're going to emit the first byte of IL code for a new
15102         statement (a new source line).
15103         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15104         EmitContext.Mark() before emitting any code.
15105
15106         * location.cs (SymbolDocument): Return null when we're Null.
15107
15108         * statement.cs (Statement): Moved the `Location loc' variable here.
15109         (Statement.EmitBoolExpression): If we have a symbol writer, call
15110         ec.Mark() before emitting any code to tell it that we're at the
15111         beginning of a new statement.
15112         (StatementExpression): Added `Location' argument to the constructor.
15113         (Block): Added public readonly variable `StartLocation' and public
15114         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15115         (Block): Added constructor which takes a start and end location.
15116         (Block.SetEndLocation): New method. This sets the end location.
15117         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15118         local variables we create.
15119         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15120         each statement and do also mark the begin and end of the block.
15121
15122         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15123         tell it the current lexer.Location, use Location.Null for the end of the
15124         block.
15125         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15126         current block, set its end location using SetEndLocation().
15127         (statement_expression): StatementExpression constructor now takes the
15128         lexer.Location as additional argument.
15129         (for_statement, declare_local_variables): Likewise.
15130         (declare_local_variables): When creating a new implicit block, use the
15131         new Block constructor and pass it the lexer.Location.
15132
15133 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15134
15135         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15136         members also on the parent interfaces recursively.
15137
15138 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15139
15140         * report.cs: Use new formats, since Gonzalo finished the missing
15141         bits. 
15142
15143         * expression.cs (Binary.ResolveOperator): added missing operator|
15144         operator& and operator^ for bool/bool.
15145
15146         * cs-parser.jay: CheckDef now takes a Location argument that is
15147         used to report errors more precisly (instead of reporting the end
15148         of a definition, we try to track something which is a lot closer
15149         to the source of the problem).
15150
15151         * cs-tokenizer.cs: Track global token use, so we can properly flag
15152         the use of #define/#undef after the first token has been seen.
15153
15154         Also, rename the reportXXXX to Error_DescriptiveName
15155
15156         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15157         TypeContainer, so that Enum and Interface can use this too.
15158
15159         * class.cs (TypeContainer.LookupInterfaceOrClass,
15160         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15161         `builder' argument.  Typically this was used to pass the parent
15162         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15163         the definition).  
15164
15165         The problem is that a nested class could trigger the definition of
15166         a toplevel class, and the builder would be obviously wrong in that
15167         case. 
15168
15169         So we drop this argument, and we compute dynamically the
15170         TypeBuilder/ModuleBuilder (the correct information was available
15171         to us anyways from DeclSpace.Parent)
15172
15173         * interface.cs (Interface.DefineInterface): Drop builder
15174         parameter cleanup like class.cs
15175
15176         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15177         like class.cs
15178
15179         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15180         values. 
15181
15182         (Try.Emit): Propagate the returns value from the statement.
15183
15184         (Return.Emit): Even if we are leavning 
15185
15186         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15187
15188         * modifiers.cs: Fix the computation of MethodAttributes flags.
15189
15190 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15191
15192         * driver.cs: allow compilation of files that start with '/'.
15193         Add a default case when checking the argument of --target.
15194
15195 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15196
15197         * interface.cs: Implement the same search algorithm for types in
15198         the interface code.
15199
15200         * delegate.cs: Do not allow multiple definition.
15201
15202         * Recovered ChangeLog that got accidentally amputated
15203
15204         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15205
15206         * rootcontext.cs: Load manually enum to allow core classes to
15207         contain enumerations.
15208
15209         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15210         Update to new static methods in TypeManager.
15211
15212         * typemanager.cs (GetMethod, GetConstructor): Use our
15213         implementation of FindMembers to find the members, since during
15214         corlib compilation, the types are TypeBuilders and GetMethod and
15215         GetConstructor do not work.
15216
15217         Make all methods in TypeManager static.
15218
15219         (InitCodeHelpers): Split the functionality from
15220         the InitCodeTypes function.
15221
15222         * driver.cs: Call InitCodeHelpers after we have populated the
15223         types. 
15224
15225         * cs-parser.jay (delegate_declaration): we did not used to compute
15226         the delegate name correctly for void delegates.
15227
15228 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15229
15230         * rootcontext.cs (RootContext): Init the interface_resolve_order
15231         and type_container_resolve_order always.
15232
15233         (ResolveCore, BootstrapCorlib_ResolveClass,
15234         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15235         compiler when compiling with --nostdlib
15236
15237         * class.cs (TypeContainer.DefineType): Check that our parent is
15238         not null.  This test is most important when we are bootstraping
15239         the core types.
15240
15241         * codegen.cs: Split out the symbol writing code.
15242
15243 2002-03-25  Martin Baulig  <martin@gnome.org>
15244
15245         * driver.cs (-g): Made -g an alias for --debug.
15246
15247 2002-03-24  Martin Baulig  <martin@gnome.org>
15248
15249         * codegen.cs (SymbolWriter): New public variable. Returns the
15250         current symbol writer.
15251         (CodeGen): Added `bool want_debugging_support' argument to the
15252          constructor. If true, tell the ModuleBuild that we want debugging
15253         support and ask it for the ISymbolWriter.
15254         (Save): If we have a symbol writer, call it's Close() method after
15255         saving the assembly.
15256
15257         * driver.c (--debug): New command line argument to create a
15258         debugger information file.
15259
15260         * location.cs (SymbolDocument): New public property. Returns an
15261         ISymbolDocumentWriter object for the current source file or null
15262         if we don't have a symbol writer.
15263
15264 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15265
15266         * driver.cs (LoadAssembly): Correctly return when all the paths
15267         have been tried and not before.
15268
15269         * statement.cs (Switch.Emit): return the actual coverage for this
15270         statement (returns/not-returns)
15271
15272         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15273         switch of the statement if we are the last switch section.  That
15274         kills two problems: try/catch problems (we used to emit an empty
15275         nop at the end) and switch statements where all branches would
15276         return. 
15277
15278 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15279
15280         * driver.cs: Add default assemblies (the equivalent to the
15281         Microsoft CSC.RSP file)
15282
15283         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15284         also update tokens_seen and set it to false.
15285
15286         * driver.cs: Implement --recurse for Mike.
15287
15288         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15289         correctly splitting out the paths.
15290
15291 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15292
15293         * interface.cs (Interface.PopulateProperty): Instead of using
15294         `parent' as the declaration space for the set parameters, use
15295         `this' 
15296
15297         * support.cs (InternalParameters): InternalParameters constructor
15298         takes a DeclSpace instead of a TypeContainer.
15299
15300         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15301         types are being initialized, load the address of it before calling
15302         the function.  
15303
15304         (New): Provide a mechanism to disable the generation of local
15305         value type temporaries when the caller will be providing us with
15306         an address to store it.
15307
15308         (ArrayCreation.EmitDynamicInitializers): Use it.
15309
15310 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15311
15312         * expression.cs (Invocation.EmitArguments): Only probe for array
15313         property if there is more than one argument.  Sorry about that.
15314
15315         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15316         empty param arrays.
15317
15318         * class.cs (Method.LabelParameters): Fix incorrect code path that
15319         prevented the `ParamArrayAttribute' from being applied to the
15320         params attribute.
15321
15322 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15323
15324         * support.cs (ReflectionParameters): Correctly compute whether the
15325         last argument is a params array.  Fixes the problem with
15326         string.Split ('a')
15327
15328         * typemanager.cs: Make the assemblies array always be non-null
15329         (empty, but non-null)
15330
15331         * tree.cs (RecordDecl): New function that abstracts the recording
15332         of names.  This reports error 101, and provides a pointer to the
15333         previous declaration.  Fixes a crash in the compiler.
15334
15335         * cs-parser.jay (constructor_declaration): Update to new grammar,
15336         and provide a constructor_body that can be empty.
15337
15338 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15339
15340         * driver.cs: Add support for --resources.
15341
15342         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15343         Make all types for the various array helper methods be integer.
15344
15345         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15346         CheckState to ConvCast.
15347
15348         (ConvCast): Now it takes a `checked' state argument, to avoid
15349         depending on the emit context for the conversion, and just using
15350         the resolve time setting.
15351
15352         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15353         instead of Invocation.EmitArguments.  We do not emit the original
15354         arguments, instead we emit those which have been converted to
15355         unsigned int expressions.
15356
15357         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15358
15359         * codegen.cs: ditto.
15360
15361         * expression.cs (LocalVariableReference): Drop the use of the
15362         Store function that depended on the variable index.
15363
15364         * statement.cs (VariableInfo): Drop the `Idx' property from this
15365         class, as this is not taking into account the indexes for
15366         temporaries tat we generate during the execution, getting the
15367         indexes wrong.
15368
15369         * class.cs: First emit class initializers, then call the parent
15370         constructor. 
15371
15372         * expression.cs (Binary): Fix opcode emision.
15373         (UnaryMutator.EmitCode): Support checked code generation
15374
15375         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15376         matches for events for both the Static and Instance scans,
15377         pointing to the same element.   Fix that.
15378
15379 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15380
15381         * rootcontext.cs (ResolveTree): Always set the
15382         interface_resolve_order, because nested interfaces will be calling
15383         into us.
15384
15385         * class.cs (GetInterfaceOrClass): Track the same resolution
15386         process used by TypeManager.LookupType.  This fixes the nested
15387         type lookups in class declarations (separate path from
15388         LookupType). 
15389
15390         (TypeContainer.DefineType): Also define nested interfaces.
15391         (TypeContainer.RegisterOrder): New public function used to
15392         register the order in which child interfaces need to be closed.
15393
15394         Nested interfaces need to be closed after their parents have been
15395         created. 
15396
15397         * interface.cs (InterfaceAttr): Put all the logic for computing
15398         the interface attribute here. 
15399
15400         (DefineInterface): Register our interface order with the
15401         RootContext or with the TypeContainer depending on the case.
15402
15403 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15404
15405         * cs-parser.jay: rework foreach statement to work with the new
15406         changes to the policy on SimpleNames.
15407
15408         * report.cs: support Stacktrace on warnings as well.
15409
15410         * makefile: drop --unsafe and /unsafe from the compile.
15411
15412 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15413
15414         * ecore.cs (StandardConversionExists): Modify to take an Expression
15415         as the first parameter. Ensure we do null -> reference type conversion
15416         checking.
15417
15418         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15419         temporary Expression objects.
15420
15421 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15422
15423         * interface.cs: workaround bug in method overloading resolution
15424         (there is already a bugzilla bug for it).
15425
15426 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15427
15428         We could also solve this problem by having a separate path for
15429         performing type lookups, instead of DoResolve, we could have a
15430         ResolveType entry point, and only participating pieces of the
15431         production (simplename, deref, array) would implement this. 
15432
15433         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15434         signal SimpleName to only resolve type names and not attempt to
15435         resolve anything else.
15436
15437         * expression.cs (Cast): Set the flag.
15438
15439         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15440
15441         * class.cs: Only report 108 if there is no `new' modifier.
15442
15443         * cs-parser.jay: rework foreach statement to work with the new
15444         changes to the policy on SimpleNames.
15445
15446         * report.cs: support Stacktrace on warnings as well.
15447
15448         * makefile: drop --unsafe and /unsafe from the compile.
15449
15450 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15451
15452         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15453         lookups here, instead of doing that at parse time.  This means
15454         that our grammar will not introduce `LocalVariableReferences' as
15455         expressions at this point.  That solves the problem of code like
15456         this:
15457
15458         class X {
15459            static void Main ()
15460            { int X = 1;
15461             { X x = null }}}
15462
15463         This is only half the fix.  The full fix requires parameters to
15464         also be handled in this way.
15465
15466         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15467         makes the use more obvious of the DeclSpace.  The
15468         ec.TypeContainer.TypeBuilder is now only used to pull the
15469         TypeBuilder for it.
15470
15471         My theory is that I can get rid of the TypeBuilder completely from
15472         the EmitContext, and have typecasts where it is used (from
15473         DeclSpace to where it matters).  
15474
15475         The only pending problem is that the code that implements Aliases
15476         is on TypeContainer, and probably should go in DeclSpace.
15477
15478         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15479         lookups here, instead of doing that at parse time.  This means
15480         that our grammar will not introduce `LocalVariableReferences' as
15481         expressions at this point.  That solves the problem of code like
15482         this:
15483
15484         class X {
15485            static void Main ()
15486            { int X = 1;
15487             { X x = null }}}
15488
15489         This is only half the fix.  The full fix requires parameters to
15490         also be handled in this way.
15491
15492         * class.cs (Property.DefineMethod): When implementing an interface
15493         method, set newslot, when implementing an abstract method, do not
15494         set the flag (before we tried never setting it, or always setting
15495         it, which is the difference).
15496         (Indexer.DefineMethod): same.
15497         (Method.DefineMethod): same.
15498
15499         * ecore.cs: Only set the status used flag if we get back a Field.
15500
15501         * attribute.cs: Temporary hack, so Paolo can keep working.
15502
15503 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15504
15505         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15506         the unmanaged type in the case we have a MarshalAs attribute.
15507
15508         (Resolve): Handle the case when we are parsing the special MarshalAs
15509         attribute [we need to store the unmanaged type to use later]
15510
15511         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15512         MarshalAs Attribute.
15513
15514         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15515         on parameters and accordingly set the marshalling info.
15516
15517 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15518
15519         * class.cs: Optimizing slightly by removing redundant code after
15520         we switched to the `NoTypes' return value.
15521         (Property.DefineMethod): use NoTypes here too.
15522
15523         This fixes the bug I introduced in my last batch of changes.
15524
15525 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15526
15527         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15528
15529         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15530         Enums since those are types too. 
15531
15532         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15533
15534         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15535         thanks to a call during the lookup process.
15536
15537 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15538
15539         * statement.cs (Foreach): Lots of work to accomodate a particular
15540         kind of foreach statement that I had not kept in mind.  It is
15541         possible to have foreachs on classes that provide a GetEnumerator
15542         method that return objects that implement the "pattern" for using
15543         a foreach, there is no need to support GetEnumerator
15544         specifically. 
15545
15546         This is needed to compile nant.
15547
15548         * decl.cs: Only report 114 if the member is not `Finalize' and if
15549         the warning level is at least 2.
15550
15551         * class.cs: Moved the compare function from Method to
15552         MethodSignature. 
15553
15554         (MethodSignature.InheritableMemberSignatureCompare): Add new
15555         filter function that is used to extract inheritable methods from a
15556         class. 
15557
15558         (Method.Define): Use the new `inheritable_method_signature_filter'
15559         delegate
15560
15561         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15562         command. 
15563
15564 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15565
15566         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15567
15568         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15569
15570         * expression.cs: Pass location information to
15571         ConvertImplicitStandard. 
15572
15573         * class.cs: Added debugging code to track return values from
15574         interfaces. 
15575
15576 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15577
15578         * expression.cs (Is.DoResolve): If either side of the `is' is an
15579         interface, do not flag the warning.
15580
15581         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15582         for interfaces
15583
15584         * report.cs: Allow for --fatal to be used with --probe.
15585
15586         * typemanager.cs (NoTypes): Move the definition for the empty Type
15587         array here. 
15588
15589         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15590         properties. 
15591         (TypeContainer.DefineProxy): New function used to proxy to parent
15592         implementations when implementing interfaces.
15593         (TypeContainer.ParentImplements): used to lookup if our parent
15594         implements a public function that is required by an interface.
15595         (TypeContainer.VerifyPendingMethods): Hook this up.
15596
15597         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15598         `modules' and `assemblies' arraylists into arrays.  We only grow
15599         these are the very early start up of the program, so this improves
15600         the speedof LookupType (nicely measured).
15601
15602         * expression.cs (MakeByteBlob): Replaced unsafe code with
15603         BitConverter, as suggested by Paolo.
15604
15605         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15606         folding of string concatenation, but if either side is a string,
15607         and the other is not, then return null, and let the runtime use
15608         the concatenation on the string plus the object (using
15609         `Object.ToString'). 
15610
15611 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15612
15613         Constant Folding has been implemented now.
15614
15615         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15616         the error instead on types that are not supported in one's
15617         complement. 
15618
15619         * constant.cs (Constant and all children): New set of functions to
15620         perform implict and explicit conversions.
15621
15622         * ecore.cs (EnumConstant): Implement the new functions to perform
15623         conversion by proxying to the child expression.
15624
15625         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15626         own separate setting that can not be turned off from the command
15627         line using --unchecked or --checked and is only controlled using
15628         the checked/unchecked statements and expressions.  This setting is
15629         used by the constant folder to flag errors.
15630
15631         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15632         ConstantCheckState as well.   
15633
15634         During Resolve, they also have to flag the state, because the
15635         constant folder runs completely in the Resolve phase.
15636
15637         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15638         well.
15639
15640 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * cfold.cs: New file, this file contains the constant folder.
15643
15644         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15645         argument to track whether we are using the resulting address to
15646         load or store a value and provide better error messages. 
15647
15648         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15649         new AddressOf arguments.
15650
15651         * statement.cs (Foreach.EmitCollectionForeach): Update
15652
15653         * expression.cs (Argument.Emit): Call AddressOf with proper
15654         arguments to track usage.
15655
15656         (New.DoEmit): Call AddressOf with new arguments.
15657
15658         (Unary.Emit): Adjust AddressOf call.
15659
15660 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15661
15662         * cs-parser.jay (member_access): Change the case for pre-defined types
15663         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15664         this suggestion.
15665
15666         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15667         a method body.
15668
15669         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15670         essentially like methods and apply attributes like MethodImplOptions to them too.
15671
15672         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15673         not being null.
15674
15675         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15676         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15677         is the DeclSpace.
15678
15679         * Update code everywhere accordingly.
15680
15681         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15682
15683         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15684
15685 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15686
15687         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15688         try performing lookups against those instead of jumping straight into using
15689         the 'using' clauses.
15690
15691         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15692
15693         (LookupType): Perform lookups in implicit parents too.
15694
15695         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15696         sequence as RootContext.LookupType. 
15697
15698         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15699         the various cases of namespace lookups into this method.
15700
15701 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15702
15703         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15704         in positional arguments)
15705
15706         * class.cs (Operator): Update the AllowedModifiers to contain
15707         extern. 
15708
15709         * cs-parser.jay: Update operator declaration to allow for the
15710         operator body to be empty.
15711
15712         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15713         values. 
15714
15715 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15716
15717         * class.cs (Method.Emit): Label parameters.
15718
15719         * driver.cs: Return 1 or 0 as the program exit code.
15720
15721 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15722
15723         * expression.cs: Special case the `null' object when trying to
15724         auto-compute the type, as anything can be explicitly converted to
15725         that. 
15726
15727         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15728         spotting this Paolo.
15729
15730         (Expression.ImplicitNumericConversion): Perform comparissions of
15731         the type using the underlying type in the case of an enumeration
15732         rather than using the enumeration type for the compare.
15733
15734         Cope with the underlying == type case, which is not possible to
15735         catch before. 
15736
15737         (Expression.ConvertNumericExplicit): Perform comparissions of
15738         the type using the underlying type in the case of an enumeration
15739         rather than using the enumeration type for the compare.
15740
15741         * driver.cs: If the user does not supply an extension, assume .exe
15742
15743         * cs-parser.jay (if_statement): Rewrote so that we can track the
15744         location for the if statement.
15745
15746         * expression.cs (Binary.ConstantFold): Only concat strings when
15747         the operation is "+", not everything ;-)
15748
15749         * statement.cs (Statement.EmitBoolExpression): Take a location
15750         argument. 
15751         (If, While, Do): Track location.
15752
15753         * expression.cs (Binary.ResolveOperator): In the object + string
15754         case, I was missing a call to ConvertImplicit
15755
15756 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15757
15758         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15759         Location arguments. Ensure we use RootContext.LookupType to do our work
15760         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15761
15762         * interface.cs (PopulateMethod): Handle the type of the parameter being
15763         null gracefully.
15764
15765         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15766         have a params method with no fixed arguments and a call is made with no
15767         arguments.
15768
15769 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15770
15771         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15772         the verbatim-string-literal
15773
15774         * support.cs (InternalParameters.ParameterModifier): handle null
15775         fixed parameters.
15776         (InternalParameters.ParameterType): ditto.
15777
15778         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15779         duplicating the name of the variable parameter.
15780         (GetParameterByName): Fix bug where we were not looking up array
15781         paramters if they were the only present (thanks Paolo!).
15782         (GetParameterInfo): We only have an empty set of types if both
15783         fixed and array are set to null.
15784         (GetParameterInfo-idx): Handle FixedParameter == null
15785
15786         * cs-parser.jay: Handle the case where there is no catch
15787         statements (missing null test).
15788
15789 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15790
15791         * driver.cs (MainDriver): Be conservative on our command line
15792         handling.
15793
15794         Catch DirectoryNotFoundException when calling GetFiles.
15795
15796         (SplitPathAndPattern): Used to split the input specification into
15797         a path and a pattern that we can feed to Directory.GetFiles.
15798
15799 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15800
15801         * statement.cs (Fixed): Implement the last case of the Fixed
15802         statement (string handling).
15803
15804         * expression.cs (StringPtr): New class used to return a char * to
15805         a string;  Used by the Fixed statement.
15806
15807         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15808
15809         * expression.cs (Binary.ResolveOperator): Remove redundant
15810         MemberLookup pn parent type.
15811         Optimize union call, we do not need a union if the types are the same.
15812         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15813         type.
15814
15815         Specialize the use of MemberLookup everywhere, instead of using
15816         the default settings. 
15817
15818         (StackAlloc): Implement stackalloc keyword.
15819
15820         * cs-parser.jay: Add rule to parse stackalloc.
15821
15822         * driver.cs: Handle /h, /help, /?
15823
15824         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15825         before we supported unsafe code.
15826
15827         * makefile: add --unsafe to the self compilation of mcs.
15828
15829 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15830
15831         * expression.cs (PointerArithmetic): New class that is used to
15832         perform pointer arithmetic.
15833         (Binary.Resolve): Handle pointer arithmetic
15834         Handle pointer comparission.
15835         (ArrayPtr): Utility expression class that is used to take the
15836         address of an array.
15837
15838         (ElementAccess): Implement array access for pointers
15839
15840         * statement.cs (Fixed): Implement fixed statement for arrays, we
15841         are missing one more case before we are done.
15842
15843         * expression.cs (Indirection): Implement EmitAssign and set the
15844         ExprClass to Variable.  This allows pointer dereferences to be
15845         treated as variables, and to have values assigned to them.
15846
15847         * ecore.cs (Expression.StoreFromPtr): New utility function to
15848         store values dereferencing.
15849
15850 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15851
15852         * expression.cs (Binary.ResolveOperator): Ensure that we are
15853         not trying to operate on a void type - this fixes the reported
15854         bug.
15855
15856         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15857         the parent implementation is sealed.
15858
15859         * ../errors/cs0239.cs : Add.
15860
15861         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15862
15863         * typemanager.cs (unverifiable_code_type): Corresponds to 
15864         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15865         which have unsafe code in them.
15866
15867         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15868         unsafe context.
15869
15870 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15871
15872         * cs-tokenizer.cs: Add support for @"litreal strings"
15873
15874         Make tokenizer accept pre-processor directives
15875         on any column (remove the old C-like limitation). 
15876
15877         * rootcontext.cs (EmitCode): Emit any global attributes.
15878         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15879
15880         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15881
15882         * cs-parser.jay: Add support for global attributes.  
15883
15884 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15885
15886         * expression.cs (Indirection): New helper class.  Unary will
15887         create Indirection classes to be able to implement the
15888         IMemoryLocation interface on it.
15889
15890 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15891
15892         * cs-parser.jay (fixed_statement): reference the right statement.
15893
15894         * statement.cs (Fixed.Emit): Finish implementing the fixed
15895         statement for the &x case.
15896
15897 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15898
15899         * class.cs (Property.Define, Method.Define): Remove newslot when
15900         `implementing'.  
15901
15902         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15903         wrong.  NewSlot should only be used if the `new' keyword is present.
15904
15905         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15906         locating our system dir.  Sorry about this.
15907
15908 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15909
15910         * driver.cs (GetSystemDir): Compute correctly the location of our
15911         system assemblies.  I was using the compiler directory instead of
15912         the library directory.
15913
15914 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15915
15916         * expression.cs (BetterFunction): Put back in what Miguel commented out
15917         since it is the correct fix. The problem is elsewhere ;-)
15918
15919         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15920         parameters of the parms method are themselves compatible or not !
15921
15922         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15923         to check that a class implements an interface before saying that an implicit
15924         conversion was allowed. Use ImplementsInterface to do the checking.
15925
15926 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15927
15928         * class.cs (Method.Define): Track whether we are an explicit
15929         implementation or not.  And only call DefineMethodOverride if we
15930         are an explicit implementation.
15931
15932         (Property.DefineMethod): Ditto.
15933
15934 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15935
15936         * expression.cs (BetterFunction): Catch hideous bug which was
15937          preventing us from detecting ambiguous calls due to implicit casts i.e
15938         cs0121.
15939
15940 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * support.cs (Pair): Remove un-needed method.  I figured why I was
15943         getting the error in cs-parser.jay, the variable in a foreach loop
15944         is readonly, and the compiler does not really treat this as a variable.
15945
15946         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15947         instead of EQUALS in grammar.  
15948
15949         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15950
15951         * expression.cs (Unary.DoResolve): Check whether the argument is
15952         managed or not.
15953
15954 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15955
15956         * support.cs: Api for Pair to set a value.  Despite the fact that
15957         the variables are public the MS C# compiler refuses to compile
15958         code that accesses the field if the variable is part of a foreach
15959         statement. 
15960
15961         * statement.cs (Fixed): Begin implementation of the fixed
15962         statement.
15963
15964         (Block.AddVariable): Return the VariableInfo on success and null
15965         on failure instead of true/false. 
15966
15967         * cs-parser.jay (foreach): Catch errors on variables already
15968         defined (we were ignoring this value before) and properly unwind
15969         the block hierarchy
15970
15971         (fixed_statement): grammar for the fixed statement.
15972
15973 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15974
15975         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15976         pointer types to be incretemented.
15977
15978         (SizeOf): Implement.
15979
15980         * cs-parser.jay (pointer_member_access): Implement
15981         expr->IDENTIFIER production.
15982
15983         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15984         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15985         on safe contexts.
15986
15987         (Unary): Implement indirection.
15988
15989         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15990         use in non-unsafe context).
15991
15992         (SimpleName.DoResolve): Check for pointers in field access on safe
15993         contexts. 
15994
15995         (Expression.LoadFromPtr): Factor the load-indirect code in this
15996         function.  This was duplicated in UnboxCast and ParameterReference
15997
15998 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15999
16000         * expression.cs (ComposedCast): report an error if a pointer cast
16001         is used in a safe region.
16002
16003         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16004         pointer type casts in unsafe context.
16005
16006         * codegen.cs (EmitContext): Set up IsUnsafe.
16007
16008         * cs-parser.jay (non_expression_type): Add productions for pointer
16009         casts. 
16010
16011         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16012         code.  We should not use force into static mode if the method is
16013         not virtual.  Fixes bug in MIS
16014
16015         * statement.cs (Do.Emit, While.Emit, For.Emit,
16016         Statement.EmitBoolExpression): Add support to Do and While to
16017         propagate infinite loop as `I do return' semantics.
16018
16019         Improve the For case to also test for boolean constants.
16020
16021         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16022         to the list of attributes we can add.
16023
16024         Remove `EmitContext' argument.
16025
16026         * class.cs (Method.Define): Apply parameter attributes.
16027         (Constructor.Define): Apply parameter attributes.
16028         (MethodCore.LabelParameters): Move here the core of labeling
16029         parameters. 
16030
16031         * support.cs (ReflectionParameters.ParameterModifier,
16032         InternalParameters.ParameterModifier): Use IsByRef on the type and
16033         only return the OUT bit for these parameters instead of in/out/ref
16034         flags.
16035
16036         This is because I miss-understood things.  The ParameterInfo.IsIn
16037         and IsOut represent whether the parameter has the [In] and [Out]
16038         attributes set.  
16039
16040 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16041
16042         * ecore.cs (FieldExpr.Emit): Release temporaries.
16043
16044         * assign.cs (LocalTemporary.Release): new function.
16045
16046         * codegen.cs (EmitContext.GetTemporaryStorage,
16047         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16048         temporary storage.  Now we can "put back" localbuilders when we
16049         are done with them
16050
16051 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16052
16053         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16054         need to make a copy of the variable to generate verifiable code.
16055
16056 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16057
16058         * driver.cs: Compute dynamically the system directory.
16059
16060         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16061         Slower, but more generally useful.  Used by the abstract
16062         registering implementation. 
16063
16064         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16065         the rules for the special rule on Type/instances.  First check if
16066         we have the same name, and if so, try that special static path
16067         rather than the instance path.
16068
16069 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16070
16071         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16072         for, while and if.
16073
16074         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16075         Enum, ValueType, Delegate or Array for non-corlib compiles.
16076
16077         * cs-tokenizer.cs: Catch long identifiers (645)
16078
16079         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16080         piece of code.
16081
16082         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16083         fix, we were returning too early, so we were not registering
16084         pending methods from abstract classes.
16085
16086         Do not register pending methods if the class is abstract.
16087
16088         * expression.cs (Conditional.DoResolve): Report circular implicit
16089         conversions when we neecd to compute it for conditional
16090         expressions. 
16091
16092         (Is.DoResolve): If the expression is always of the provided type,
16093         flag warning 183.  If the expression can not ever be of the
16094         provided type flag warning 184.
16095
16096         * class.cs: Catch 169 as well.
16097
16098         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16099         read. 
16100
16101 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16102
16103         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16104
16105 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16106
16107         * interface.cs: (PopulateMethod): Check for pointers being defined
16108         only if the unsafe context is active.
16109         (PopulateProperty): ditto.
16110         (PopulateIndexer): ditto.
16111
16112         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16113         specified.  If pointers are present, make sure that they are
16114         present in an unsafe context.
16115         (Constructor, Constructor.Define): ditto.
16116         (Field, Field.Define): ditto.
16117         (Property, Property.Define): ditto.
16118         (Event, Event.Define): ditto.
16119
16120         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16121         hashtable if there are classes or structs defined.
16122
16123         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16124         code, as the constant resolution moved.
16125
16126         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16127         the metadata, so we can flag error 133. 
16128
16129         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16130         pointer is being declared in an unsafe context.
16131
16132 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16133
16134         * modifiers.cs (Modifiers.Check): Require a Location argument.
16135         Report error 227 for Unsafe use.
16136
16137         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16138
16139         * statement.cs (For.Emit): If the test is null, then report that
16140         we do `return', as we wont reach anything afterwards.
16141
16142         (Switch.SwitchGoverningType): Track the expression that matched
16143         the conversion.
16144
16145         * driver.cs: Allow negative numbers as an error code to flag.
16146
16147         * cs-parser.jay: Handle 1551.
16148
16149         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16150
16151 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16152
16153         * cs-parser.jay: Report 1518 (type declaration can only contain
16154         class, struct, interface, enum or delegate)
16155
16156         (switch_label): Report 1523 (keywords `case' or `default' must
16157         preced code)
16158
16159         (opt_switch_sections): Report 1522 (empty switch)
16160
16161         * driver.cs: Report 1515 (response file specified multiple times)
16162         Report 1516 (Source file specified multiple times).
16163
16164         * expression.cs (Argument.Resolve): Signal 1510
16165
16166         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16167         access not allowed in static code)
16168
16169 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16170
16171         * typemanager.cs (IsPointerType): Utility method which we are going
16172         to need a lot.
16173
16174         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16175         the object type, so we take care of that.
16176
16177         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16178
16179         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16180         added to non-params parameters :-)
16181
16182         * typemanager.cs (CSharpName): Include 'void' type too. 
16183
16184         (void_ptr_type): Include in the set of core types.
16185
16186         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16187         duplicating code.
16188
16189         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16190         an unsafe context.
16191
16192         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16193         completely forgotten about it.
16194
16195 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16196
16197         * cs-parser.jay (pointer_type): Add. This begins our implementation
16198         of parsing rules for unsafe code.
16199
16200         (unsafe_statement): Implement.
16201
16202         (embedded_statement): Modify to include the above.
16203
16204         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16205
16206         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16207         if the current context is an unsafe one.
16208
16209         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16210         are handled differently, we need separate rules for them.
16211
16212         (local_variable_declaration): Update to use local_variable_pointer_type
16213         to allow variable declarations of unmanaged pointer types.
16214
16215         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16216         in unsafe contexts.
16217
16218         * ../errors/cs0214.cs : Add.
16219
16220 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16221
16222         * makefile: remove 'response' file when cleaning.
16223
16224 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16225
16226         * cs-parser.jay: Report 1524.
16227
16228 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16229
16230         * typemanager.cs (RegisterMethod): drop checking if we have
16231         registered this from here
16232
16233 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16234
16235         * class.cs (Method.EmitDestructor): Implement calling our base
16236         destructor. 
16237
16238         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16239         value of InFinally.
16240
16241         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16242         this routine and will wrap the call in a try/catch block.  Deal
16243         with the case.
16244
16245 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16246
16247         * ecore.cs (Expression.MemberLookup): instead of taking a
16248         parameter `same_type' that was used to tell whether we could
16249         access private members we compute our containing type from the
16250         EmitContext.
16251
16252         (FieldExpr): Added partial support for volatile fields.  This does
16253         not work for volatile fields exposed from assemblies, as I can not
16254         figure out how to extract the modreq from it.
16255
16256         Updated all the source files to use this.
16257
16258         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16259         because it is referenced by MemberLookup very often. 
16260
16261 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16262
16263         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16264         TypeBuilder.GetCustomAttributes to retrieve what we need.
16265
16266         Get rid of redundant default_member_attr_type as this is the same as
16267         default_member_type which already exists.
16268
16269         * interface.cs, attribute.cs : Update accordingly.
16270
16271 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16272
16273         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16274         work for TYpeBuilders though.  Ravi, can you please fix this?
16275
16276         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16277
16278         * expression.cs (Argument.Emit): Handle the case of ref objects
16279         being passed to ref functions;  
16280
16281         (ParameterReference.EmitLoad): Loads the content of the pointer
16282         without dereferencing.
16283
16284 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16285
16286         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16287
16288 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16289
16290         * class.cs (Indexer.DefineMethod): Incorporate the interface
16291         type in the name of the method if we are doing explicit interface
16292         implementation.
16293
16294         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16295
16296         (BetterConversion): Fix extremely trivial bug where we were referring to
16297         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16298         again !
16299
16300         * ../errors/bug16.cs : Add although we have fixed it.
16301
16302 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16303
16304         * expression.cs (BaseIndexer): Begin implementation.
16305
16306         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16307
16308         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16309         production directly to remove a shift/reduce, and implement
16310         explicit interface implementation.
16311
16312         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16313         after a floating point suffix.
16314
16315         * expression.cs (DoNumericPromotions): Improved the conversion for
16316         uint/uint.  If we have a constant, we avoid doing a typecast to a
16317         larger type.
16318
16319         * class.cs (Indexer): Implement explicit interface implementation
16320         for indexers.
16321
16322 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16323
16324         * class.cs: make the default instance constructor public and hidebysig.
16325
16326 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16327
16328         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16329         so we can call it from elsewhere.
16330
16331         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16332         we emit it internally if the class has a defined indexer; otherwise the user
16333         emits it by decorating the class definition with the DefaultMemberAttribute.
16334
16335         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16336         attribute is not used on a type which defines an indexer.
16337
16338         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16339         character when we skip whitespace.
16340
16341         * ../errors/cs0646.cs : Add.
16342
16343 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16344
16345         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16346         again. 
16347
16348         * makefile: Add practical target `mcs3.exe' which builds the third
16349         generation compiler. 
16350
16351         * expression.cs (New): Fix structures constructor calling.
16352
16353         * class.cs (Property, Method, Indexer): Emit Final flag on the
16354         method if we are an interface implementation and we are not
16355         abstract. 
16356
16357         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16358         whether this property is referencing a `base' method.
16359
16360         * expression.cs (Invocation.EmitCall): take an extra argument:
16361         is_base, this is used to determine whether the `call' or
16362         `callvirt' opcode should be used.
16363
16364
16365         * delegate.cs: update EmitCall.
16366
16367         * class.cs (Method.Define): Set NewSlot for the cases where we are
16368         not implementing an interface method.
16369
16370         (Property.Define): ditto.
16371
16372 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16373
16374         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16375         'r'.  Allows mcs to parse itself fully.
16376
16377 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16378
16379         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16380         of the number of initializers that require the InitializeArray method.
16381
16382         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16383         update the above field where necessary.
16384
16385         (MakeByteBlob): Update accordingly.
16386
16387         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16388         greater than 2.
16389
16390         (EmitDynamicInitializers): Update in accordance with the new optimization.
16391
16392         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16393         same OpCode applies.
16394
16395         * cs-parser.jay : Fix some glaring errors I introduced.
16396
16397 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16398
16399         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16400         so that we can check for name clashes there too.
16401
16402         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16403         for interface indexers.
16404
16405         * interfaces.cs (Define): Emit the default member attribute.
16406
16407         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16408         variable was being referred to while setting the value ;-)
16409
16410 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16411
16412         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16413         byte-by-byte information when we know the data is zero.
16414
16415         Make the block always a multiple of 4, because
16416         DefineInitializedData has a bug.
16417
16418         * assign.cs: Fix, we should assign from the temporary, not from
16419         the source. 
16420
16421         * expression.cs (MakeByteBlob): Fix my incorrect code.
16422
16423 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16424
16425         * typemanager.cs (EnumToUnderlying): This function is used to get
16426         the underlying type from an enumeration, because it does not
16427         always work. 
16428
16429         * constant.cs: Use the I4_S form for values between -128 and 127.
16430
16431         * statement.cs (Block.LookupLabel): Looks up a label.
16432         (Block): Drop support for labeled blocks.
16433
16434         (LabeledStatement): New kind of statement that represents a label
16435         only.
16436
16437         (Goto): Finally implement this bad boy.
16438
16439         * cs-parser.jay: Update to reflect new mechanism to implement
16440         labels.
16441
16442 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16443
16444         * codegen.cs (EmitContext.This): a codegen property that keeps the
16445         a single instance of this instead of creating many different this
16446         instances. 
16447
16448         * delegate.cs (Delegate.DoResolve): Update to use the property;
16449
16450         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16451
16452         * expression.cs (BaseAccess.DoResolve): Ditto.
16453
16454 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16455
16456         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16457         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16458
16459         (InitCoreTypes): Update accordingly.
16460
16461         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16462         so we can quickly store the state.
16463
16464         (ApplyAttributes): Set the correct implementation flags
16465         for InternalCall methods.
16466
16467 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16468
16469         * expression.cs (EmitCall): if a method is not virtual, then do
16470         not use callvirt on it.
16471
16472         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16473         user defined stuff) requires the use of stobj, which takes an
16474         address on the stack instead of an array and an index.  So emit
16475         the Ldelema operation for it.
16476
16477         (EmitStoreOpcode): Use stobj for valuetypes.
16478
16479         (UnaryMutator.EmitCode): Use the right 1 value depending on
16480         whether we are dealing with int64/uint64, float or doubles.
16481
16482         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16483         constructors that I implemented last night.
16484
16485         (Constructor.IsDefault): Fix to work properly for static
16486         constructors.
16487
16488         * cs-parser.jay (CheckDef): report method signature errors.
16489         Update error number 103 to be 132.
16490
16491         * decl.cs: New AdditionResult enumeration value: MethodExists.
16492         Although we do this check for methods later on in the semantic
16493         analysis, catching repeated default constructors is so easy that
16494         we catch these here. 
16495
16496         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16497         promotions code.
16498
16499         (ParameterReference.EmitAssign, Emit): handle
16500         bools as bytes.
16501
16502         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16503         (ArrayAccess.EmitStoreOpcode): ditto.
16504
16505         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16506
16507         * expression.cs (MakeByteBlob): Complete all the missing types
16508         (uint, short, ushort, byte, sbyte)
16509
16510         * class.cs: Only init instance field initializers on instance
16511         constructors. 
16512
16513         Rename `constructors' to instance_constructors. 
16514
16515         (TypeContainer.AddConstructor): Only add constructors to the list
16516         if it is not static.
16517
16518         Make sure that we handle default_static_constructor independently
16519         everywhere where we handle instance_constructors
16520
16521 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16522
16523         * class.cs: Do not lookup or create a base initializer for a
16524         static constructor.
16525
16526         (ConstructorInitializer.Resolve): use the proper type to lookup
16527         for constructors.
16528
16529         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16530
16531         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16532         in DeclSpace. 
16533
16534         * decl.cs: CloseType is now an virtual method, the default
16535         implementation just closes this type.
16536
16537 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16538
16539         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16540         to PreserveSig by default. Also emit HideBySig on such methods.
16541
16542         Basically, set the defaults to standard values.
16543
16544         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16545         argument, if candidate is better, it can't be worse than the best !
16546
16547         (Invocation): Re-write bits to differentiate between methods being
16548         applicable in their expanded form and their normal form - for params
16549         methods of course.
16550
16551         Get rid of use_standard everywhere as only standard conversions are allowed
16552         in overload resolution. 
16553
16554         More spec conformance.
16555
16556 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16557
16558         * driver.cs: Add --timestamp, to see where the compiler spends
16559         most of its time.
16560
16561         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16562         `this' in static code.
16563
16564         (SimpleName.DoResolve): Implement in terms of a helper function
16565         that allows static-references to be passed upstream to
16566         MemberAccess.
16567
16568         (Expression.ResolveWithSimpleName): Resolve specially simple
16569         names when called by MemberAccess to implement the special
16570         semantics. 
16571
16572         (Expression.ImplicitReferenceConversion): Handle conversions from
16573         Null to reference types before others, as Null's type is
16574         System.Object. 
16575
16576         * expression.cs (Invocation.EmitCall): Handle the special case of
16577         calling methods declared on a reference type from a ValueType
16578         (Base classes System.Object and System.Enum)
16579
16580         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16581         the left hand side is a TypeExpr, not on every enumeration. 
16582
16583         (Binary.Resolve): If types are reference types, then do a cast to
16584         object on operators != and == of both arguments.
16585
16586         * typemanager.cs (FindMembers): Extract instance and static
16587         members if requested.
16588
16589         * interface.cs (PopulateProperty): Use void_type instead of null
16590         as the return type for the setter method.
16591
16592         (PopulateIndexer): ditto.
16593
16594 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16595
16596         * support.cs (ReflectionParameters): Fix minor bug where we
16597         were examining the wrong parameter for the ParamArray attribute.
16598
16599         Cope with requests for the type of the parameter at position
16600         greater than the params parameter's. We now return the element
16601         type of the params array as that makes more sense.
16602
16603         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16604         accordingly as we no longer have to extract the element type
16605         ourselves.
16606
16607         (Invocation.OverloadResolve): Update.
16608
16609 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16610
16611         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16612         against IEnumerator, test whether the return value is a descendant
16613         of the IEnumerator interface.
16614
16615         * class.cs (Indexer.Define): Use an auxiliary method to implement
16616         the other bits of the method definition.  Begin support for
16617         explicit interface implementation.
16618
16619         (Property.DefineMethod): Use TypeManager.void_type instead of null
16620         for an empty return value.
16621
16622 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16623
16624         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16625         dealing with a FieldExpr which is composed of a FieldBuilder, in
16626         the code path we did extract the constant, but we should have
16627         obtained the underlying value to be able to cast it (otherwise we
16628         end up in an infinite loop, this is what Ravi was running into).
16629
16630         (ArrayCreation.UpdateIndices): Arrays might be empty.
16631
16632         (MemberAccess.ResolveMemberAccess): Add support for section
16633         14.5.4.1 that deals with the special case of E.I when E is a type
16634         and something else, that I can be a reference to a static member.
16635
16636         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16637         handle a particular array type to create byte blobs, it is just
16638         something we dont generate byteblobs for.
16639
16640         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16641         arguments. 
16642
16643         * location.cs (Push): remove the key from the hashtable that we
16644         are about to add.   This happens for empty files.
16645
16646         * driver.cs: Dispose files after we have parsed them.
16647
16648         (tokenize): new function that only runs the tokenizer on its
16649         input, for speed testing.
16650
16651 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16652
16653         * class.cs (Event.Define): Define the private field only if there
16654         are no accessors defined.
16655
16656         * expression.cs (ResolveMemberAccess): If there is no associated
16657         field with the event, that means we have an event defined with its
16658         own accessors and we should flag error cs0070 since transforming
16659         ourselves into a field is not valid in that case.
16660
16661         * ecore.cs (SimpleName.DoResolve): Same as above.
16662
16663         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16664         and charset to sane values.
16665
16666 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16667
16668         * assign.cs (DoResolve): Perform check on events only if they 
16669         are being accessed outside the declaring type.
16670
16671         * cs-parser.jay (event_declarations): Update rules to correctly
16672         set the type of the implicit parameter etc.
16673
16674         (add_accessor, remove_accessor): Set current local parameters.
16675
16676         * expression.cs (Binary): For delegate addition and subtraction,
16677         cast the return value from the method into the appropriate delegate
16678         type.
16679
16680 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16681
16682         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16683         of these as the workaround is unnecessary.
16684
16685         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16686         delegate data - none of that is needed at all.
16687
16688         Re-write bits to extract the instance expression and the delegate method
16689         correctly.
16690
16691         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16692         on delegates too.
16693
16694         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16695         of attaching attributes instead of duplicating code everywhere.
16696
16697         * everywhere : Update code to do attribute emission using the above method.
16698
16699 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * expression.cs (IsParamsMethodApplicable): if there are not
16702         parameters, return immediately.
16703
16704         * ecore.cs: The 0 literal can be implicity converted to an enum
16705         type. 
16706
16707         (SimpleName.DoResolve): First lookup the type, then lookup the
16708         members. 
16709
16710         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16711         want to get its address.  If the InstanceExpression is not
16712         addressable, store the result in a temporary variable, then get
16713         the address of it.
16714
16715         * codegen.cs: Only display 219 errors on warning level or above. 
16716
16717         * expression.cs (ArrayAccess): Make it implement the
16718         IMemoryLocation interface.
16719
16720         (Binary.DoResolve): handle the operator == (object a, object b)
16721         and operator != (object a, object b) without incurring into a
16722         BoxedCast (because 5 != o should never be performed).
16723
16724         Handle binary enumerator operators.
16725
16726         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16727         value type, otherwise use Ldelem_ref.
16728
16729         Use precomputed names;
16730
16731         (AddressOf): Implement address of
16732
16733         * cs-parser.jay (labeled_statement): Fix recursive block
16734         addition by reworking the production.
16735
16736         * expression.cs (New.DoEmit): New has a special case:
16737                 
16738                  If we are dealing with a ValueType, we have a few
16739                  situations to deal with:
16740                 
16741                     * The target of New is a ValueType variable, that is
16742                       easy, we just pass this as the variable reference
16743                 
16744                     * The target of New is being passed as an argument,
16745                       to a boxing operation or a function that takes a
16746                       ValueType.
16747                 
16748                       In this case, we need to create a temporary variable
16749                       that is the argument of New.
16750
16751
16752 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16753
16754         * rootcontext.cs (LookupType): Check that current_type is not null before
16755         going about looking at nested types.
16756
16757         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16758         not implement the IAssignMethod interface any more.
16759
16760         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16761         where we tranform them into FieldExprs if they are being resolved from within
16762         the declaring type.
16763
16764         * ecore.cs (SimpleName.DoResolve): Do the same here.
16765
16766         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16767
16768         * ../errors/bug10.cs : Add.
16769
16770         * ../errors/cs0070.cs : Add.
16771
16772         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16773
16774         * assign.cs : Get rid of EventIsLocal everywhere.
16775
16776 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16777
16778         * ecore.cs (ConvertIntLiteral): finished the implementation.
16779
16780         * statement.cs (SwitchLabel): Convert the value we are using as a
16781         key before looking up the table.
16782
16783 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16784
16785         * codegen.cs (EmitTopBlock): Require a Location argument now.
16786
16787         * cs-parser.jay (constructor_declarator): We need to setup
16788         current_local_parameters before we parse the
16789         opt_constructor_initializer, to allow the variables to be bound
16790         to the constructor arguments.
16791
16792         * rootcontext.cs (LookupType): First lookup nested classes in our
16793         class and our parents before we go looking outside our class.
16794
16795         * expression.cs (ConstantFold): Extract/debox the values at the
16796         beginnning. 
16797
16798         * rootcontext.cs (EmitCode): Resolve the constants first before we
16799         resolve the types.  This is not really needed, but it helps debugging.
16800
16801         * statement.cs: report location.
16802
16803         * cs-parser.jay: pass location to throw statement.
16804
16805         * driver.cs: Small bug fix.
16806
16807         * report.cs: Updated format to be 4-zero filled digits.
16808
16809 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16810
16811         * expression.cs (CheckIndices): Fix minor bug where the wrong
16812         variable was being referred to ;-)
16813
16814         (DoEmit): Do not call EmitStaticInitializers when the 
16815         underlying type is System.Object.
16816
16817 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16818
16819         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16820         and do the usual workaround for SRE.
16821
16822         * class.cs (MyEventBuilder.EventType): New member to get at the type
16823         of the event, quickly.
16824
16825         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16826
16827         * assign.cs (Assign.DoResolve): Handle the case when the target
16828         is an EventExpr and perform the necessary checks.
16829
16830         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16831         interface.
16832
16833         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16834
16835         (EventExpr): Set the type in the constructor itself since we 
16836         are meant to be born fully resolved.
16837
16838         (EventExpr.Define): Revert code I wrote earlier.
16839                 
16840         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16841         instance expression is null. The instance expression is a This in that case
16842         or a null, depending on whether it is a static method or not.
16843
16844         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16845         refers to more than one method.
16846
16847         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16848         and accordingly flag errors.
16849
16850 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16851
16852         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16853
16854 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16855
16856         * location.cs (ToString): Provide useful rutine.
16857
16858 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16859
16860         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16861         objects, return the actual integral boxed.
16862
16863         * statement.cs (SwitchLabel): define an ILLabel for each
16864         SwitchLabel. 
16865
16866         (Switch.CheckSwitch): If the value is a Literal, extract
16867         the underlying literal.
16868
16869         Also in the unused hashtable we had, add the SwitchLabel so we can
16870         quickly look this value up.
16871
16872         * constant.cs: Implement a bunch of new constants.  Rewrite
16873         Literal based on this.  Made changes everywhere to adapt to this.
16874
16875         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16876         dereferencing array only once, and also copes with enumrations.
16877
16878         bytes are two bytes wide, not one.
16879
16880         (Cast): Perform constant conversions.
16881
16882         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16883         wrappers to the literals here.
16884
16885         * expression.cs (DoNumericPromotions): long literals can converted
16886         to ulong implicity (this is taken care of elsewhere, but I was
16887         missing this spot).
16888
16889         * ecore.cs (Expression.Literalize): Make the return type Literal,
16890         to improve type checking.
16891
16892         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16893
16894 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16895
16896         * literal.cs: Revert code from ravi that checked the bounds.  The
16897         bounds are sane by the definition of the type itself. 
16898
16899         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16900         need to actually look up in our parent hierarchy for interfaces
16901         implemented. 
16902
16903         * const.cs: Use the underlying type for enumerations
16904
16905         * delegate.cs: Compute the basename for the delegate creation,
16906         that should fix the delegate test case, and restore the correct
16907         Type Lookup semantics in rootcontext
16908
16909         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16910         referencing a nested type with the Reflection API is using the "+"
16911         sign. 
16912
16913         * cs-parser.jay: Do not require EOF token at the end.
16914
16915 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16916
16917         * rootcontext.cs (LookupType): Concatenate type names with
16918         a '.' instead of a '+' The test suite passes again.
16919
16920         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16921         field of the enumeration.
16922
16923         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16924         the case when the member is an EventExpr.
16925
16926         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16927         static has an associated instance expression.
16928
16929         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16930
16931         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16932
16933         * class.cs (Event.Define): Register event and perform appropriate checks
16934         for error #111.
16935
16936         We define the Add and Remove methods even if the use provides none because
16937         in that case, we provide default implementations ourselves.
16938
16939         Define a private field of the type of the event. This is done by the CSC compiler
16940         and we should be doing it too ;-)
16941
16942         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16943         More methods we use in code we generate.
16944
16945         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16946         is important.
16947
16948         (InitCoreTypes): Update accordingly for the above.
16949
16950         * class.cs (Event.Emit): Generate code for default accessors that we provide
16951
16952         (EmitDefaultMethod): Do the job in the above.
16953
16954         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16955         appropriate place.
16956
16957 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16958
16959         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16960         builders even if we were missing one.
16961
16962         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16963         pass the Basename as our class name instead of the Name.  The
16964         basename will be correctly composed for us.
16965
16966         * parameter.cs (Paramters): Now takes a Location argument.
16967
16968         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16969         make all the code call directly LookupType in RootContext and take
16970         this chance to pass the Location information everywhere.
16971
16972         * Everywhere: pass Location information.
16973
16974 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16975
16976         * class.cs (Constructor.Define): Updated way of detecting the
16977         length of the parameters.
16978
16979         (TypeContainer.DefineType): Use basename as the type name for
16980         nested types.
16981
16982         (TypeContainer.Define): Do not recursively define types here, as
16983         definition is taken care in order by the RootContext.
16984
16985         * tree.cs: Keep track of namespaces in a per-file basis.
16986
16987         * parameter.cs (Parameter.ComputeSignature): Update to use
16988         DeclSpace. 
16989
16990         (Parameters.GetSignature): ditto.
16991
16992         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16993         instead of a TypeContainer.
16994
16995         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16996         resolve names.  Because we need to be resolve in our context, not
16997         our parents.
16998
16999         * driver.cs: Implement response files.
17000
17001         * class.cs (TypeContainer.DefineType): If we are defined, do not
17002         redefine ourselves.
17003
17004         (Event.Emit): Emit the code for add/remove handlers.
17005         (Event.Define): Save the MethodBuilders for add/remove.
17006
17007         * typemanager.cs: Use pair here too.
17008
17009         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17010         DictionaryEntry requires the first argument to be non-null.  
17011
17012         (enum_declaration): Compute full name for registering the
17013         enumeration.
17014
17015         (delegate_declaration): Instead of using
17016         formal_parameter_list, use opt_formal_parameter_list as the list
17017         can be empty.
17018
17019         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17020         (EventParsing): New property that controls whether `add' and
17021         `remove' are returned as tokens or identifiers (for events);
17022
17023 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17024
17025         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17026         use MyEventBuilder only and let it wrap the real builder for us.
17027
17028         (MyEventBuilder): Revamp constructor etc.
17029
17030         Implement all operations that we perform on EventBuilder in precisely the same
17031         way here too.
17032
17033         (FindMembers): Update to use the EventBuilder member.
17034
17035         (Event.Emit): Update accordingly.
17036
17037 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17038
17039         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17040         by calling the appropriate methods.
17041
17042         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17043         useful.
17044
17045         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17046
17047 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17048
17049         * delegate.cs (Delegate.Populate): Check that the return type
17050         and various parameters types are indeed accessible.
17051
17052         * class.cs (Constructor.Define): Same here.
17053
17054         (Field.Define): Ditto.
17055
17056         (Event.Define): Ditto.
17057
17058         (Operator.Define): Check that the underlying Method defined itself
17059         correctly - so it's MethodBuilder should not be null.
17060
17061         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17062         expression happens to be null.
17063
17064         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17065         members but as of now we don't seem to be able to do anything really useful with it.
17066
17067         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17068         not the EventBuilder.
17069
17070 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17071
17072         * cs-tokenizer.cs: Add support for defines.
17073         Add support for #if, #elif, #else, #endif
17074
17075         (eval_var): evaluates a variable.
17076         (eval): stubbed for evaluating functions.
17077
17078         * cs-parser.jay: Pass the defines information
17079
17080         * driver.cs: Add --define command line option.
17081
17082         * decl.cs: Move MemberCore here.
17083
17084         Make it the base class for DeclSpace.  This allows us to catch and
17085         report 108 and 109 for everything now.
17086
17087         * class.cs (TypeContainer.Define): Extract all the members
17088         before populating and emit the warning 108 (new keyword required
17089         to override) instead of having each member implement this.
17090
17091         (MemberCore.Define): New abstract method, we will be using this in
17092         the warning reporting engine in Populate.
17093
17094         (Operator.Define): Adjust to new MemberCore protocol. 
17095
17096         * const.cs (Const): This does not derive from Expression, it is a
17097         temporary object we use to create fields, it is a MemberCore. 
17098
17099         * class.cs (Method.Define): Allow the entry point to be in a
17100         specific class.
17101
17102         * driver.cs: Rewrite the argument handler to clean it up a bit.
17103
17104         * rootcontext.cs: Made it just an auxiliary namespace feature by
17105         making everything static.
17106
17107         * driver.cs: Adapt code to use RootContext type name instead of
17108         instance variable.
17109
17110         * delegate.cs: Remove RootContext argument.
17111
17112         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17113         argument. 
17114
17115         * class.cs (Event.Define): The lookup can fail.
17116
17117         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17118
17119         * expression.cs: Resolve the this instance before invoking the code.
17120
17121 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17122
17123         * cs-parser.jay: Add a production in element_access that allows
17124         the thing to become a "type" reference.  This way we can parse
17125         things like "(string [])" as a type.
17126
17127         Note that this still does not handle the more complex rules of
17128         casts. 
17129
17130
17131         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17132
17133         * ecore.cs: (CopyNewMethods): new utility function used to
17134         assemble the list of methods from running FindMembers.
17135
17136         (MemberLookup): Rework FindMembers so that 
17137
17138 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17139
17140         * class.cs (TypeContainer): Remove Delegates who fail to be
17141         defined.
17142
17143         * delegate.cs (Populate): Verify that we dont get null return
17144         values.   TODO: Check for AsAccessible.
17145
17146         * cs-parser.jay: Use basename to emit error 574 (destructor should
17147         have the same name as container class), not the full name.
17148
17149         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17150         possible representation.  
17151
17152         Also implements integer type suffixes U and L.
17153
17154 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17155
17156         * expression.cs (ArrayCreation.DoResolve): We need to do the
17157         argument resolution *always*.
17158
17159         * decl.cs: Make this hold the namespace.  Hold the root context as
17160         well.
17161         (LookupType): Move here.
17162
17163         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17164
17165         * location.cs (Row, Name): Fixed the code, it was always returning
17166         references to the first file.
17167
17168         * interface.cs: Register properties defined through interfaces.
17169
17170         * driver.cs: Add support for globbing on the command line
17171
17172         * class.cs (Field): Make it derive from MemberCore as well.
17173         (Event): ditto.
17174
17175 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17176
17177         * class.cs (Event::Define): Check that the type of the event is a delegate
17178         type else flag error #66.
17179
17180         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17181         same.
17182
17183         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17184         values of EntryPoint, CharSet etc etc.
17185
17186         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17187
17188         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17189         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17190         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17191         which needs this to do its work.
17192
17193         * ../errors/cs0066.cs : Add.
17194
17195 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17196
17197         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17198         helper functions.
17199
17200         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17201         clears out the parameters field.
17202         (MemberSignatureCompare): Cleanup
17203
17204         (MemberCore): New base class used to share code between MethodCore
17205         and Property.
17206
17207         (RegisterRequiredImplementations) BindingFlags.Public requires
17208         either BindingFlags.Instace or Static.  Use instance here.
17209
17210         (Property): Refactored code to cope better with the full spec.
17211
17212         * parameter.cs (GetParameterInfo): Return an empty array instead
17213         of null on error.
17214
17215         * class.cs (Property): Abstract or extern properties have no bodies.
17216
17217         * parameter.cs (GetParameterInfo): return a zero-sized array.
17218
17219         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17220         method modifier validation to the typecontainer so we can reuse
17221         this on properties.
17222
17223         (MethodCore.ParameterTypes): return an empty sized array of types.
17224
17225         (Property.Define): Test property modifier validity.
17226
17227         Add tests for sealed/override too.
17228
17229         (Method.Emit): abstract or extern methods have no bodies.
17230
17231 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17232
17233         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17234         thing.
17235
17236         (Method::Define, ::Emit): Modify accordingly.
17237
17238         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17239
17240         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17241
17242         * makefile: Pass in /unsafe.
17243
17244 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17245
17246         * class.cs (MakeKey): Kill routine.
17247
17248         * class.cs (TypeContainer.Define): Correctly define explicit
17249         method implementations (they require the full interface name plus
17250         the method name).
17251
17252         * typemanager.cs: Deply the PtrHashtable here and stop using the
17253         lame keys.  Things work so much better.
17254
17255         This of course broke everyone who depended on `RegisterMethod' to
17256         do the `test for existance' test.  This has to be done elsewhere.
17257
17258         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17259         the object stupid Equals method (because, that like fails all over
17260         the place).  We still do not use it.
17261
17262         * class.cs (TypeContainer.SetRequiredInterface,
17263         TypeContainer.RequireMethods): Killed these two routines and moved
17264         all the functionality to RegisterRequiredImplementations.
17265
17266         (TypeContainer.RegisterRequiredImplementations): This routine now
17267         registers all the implementations required in an array for the
17268         interfaces and abstract methods.  We use an array of structures
17269         which can be computed ahead of time to reduce memory usage and we
17270         also assume that lookups are cheap as most classes will not
17271         implement too many interfaces.
17272
17273         We also avoid creating too many MethodSignatures.
17274
17275         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17276         clear the "pending" bit if we find that there are problems with
17277         the declaration.
17278
17279         (TypeContainer.VerifyPendingMethods): Update to report errors of
17280         methods that look like implementations but are not.
17281
17282         (TypeContainer.Define): Add support for explicit interface method
17283         implementation. 
17284
17285 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17286
17287         * typemanager.cs: Keep track of the parameters here instead of
17288         being a feature of the TypeContainer.
17289
17290         * class.cs: Drop the registration of parameters here, as
17291         InterfaceMethods are also interface declarations.
17292
17293         * delegate.cs: Register methods with the TypeManager not only with
17294         the TypeContainer.  This code was buggy.
17295
17296         * interface.cs: Full registation here.
17297
17298 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17299
17300         * expression.cs: Remove reducer for binary expressions, it can not
17301         be done this way.
17302
17303         * const.cs: Put here the code that used to go into constant.cs
17304
17305         * constant.cs: Put here the code for constants, this is a new base
17306         class for Literals.
17307
17308         * literal.cs: Make Literal derive from Constant.
17309
17310 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17311
17312         * statement.cs (Return.Emit): Report error 157 if the user
17313         attempts to return from a finally block.
17314
17315         (Return.Emit): Instead of emitting a return, jump to the end of
17316         the function.
17317
17318         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17319         LocalBuilder to store the result of the function.  ReturnLabel is
17320         the target where we jump.
17321
17322
17323 2001-12-09  Radek Doulik  <rodo@ximian.com>
17324
17325         * cs-parser.jay: remember alias in current namespace
17326
17327         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17328         namespaces
17329
17330         * class.cs (LookupAlias): lookup alias in my_namespace
17331
17332         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17333         aliases hashtable
17334         (LookupAlias): lookup alias in this and if needed in parent
17335         namespaces
17336
17337 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17338
17339         * support.cs: 
17340
17341         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17342         making things static.  I need this to avoid passing the
17343         TypeContainer when calling ParameterType.
17344
17345         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17346         that did string manipulation to compute the type and then call
17347         GetType.  Use Parameter.ParameterType instead.
17348
17349         * cs-tokenizer.cs: Consume the suffix for floating values.
17350
17351         * expression.cs (ParameterReference): figure out whether this is a
17352         reference parameter or not.  Kill an extra variable by computing
17353         the arg_idx during emission.
17354
17355         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17356         function that returns whether a parameter is an out/ref value or not.
17357
17358         (Parameter.ParameterType): The type of the parameter (base,
17359         without ref/out applied).
17360
17361         (Parameter.Resolve): Perform resolution here.
17362         (Parameter.ExternalType): The full type (with ref/out applied).
17363
17364         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17365         support for expressions on the using statement.
17366
17367 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * statement.cs (Using.EmitLocalVariableDecls): Split the
17370         localvariable handling of the using statement.
17371
17372         (Block.EmitMeta): Keep track of variable count across blocks.  We
17373         were reusing slots on separate branches of blocks.
17374
17375         (Try.Emit): Emit the general code block, we were not emitting it. 
17376
17377         Check the type of the declaration to be an IDisposable or
17378         something that can be implicity converted to it. 
17379
17380         Emit conversions if required.
17381
17382         * ecore.cs (EmptyExpression): New utility class.
17383         (Expression.ImplicitConversionExists): New utility function.
17384
17385 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17386
17387         * statement.cs (Using): Implement.
17388
17389         * expression.cs (LocalVariableReference): Support read only variables.
17390
17391         * statement.cs: Remove the explicit emit for the Leave opcode.
17392         (VariableInfo): Add a readonly field.
17393
17394 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17395
17396         * ecore.cs (ConvCast): new class used to encapsulate the various
17397         explicit integer conversions that works in both checked and
17398         unchecked contexts.
17399
17400         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17401         properly generate the overflow opcodes.
17402
17403 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17404
17405         * statement.cs: The correct type for the EmptyExpression is the
17406         element_type, not the variable type.  Ravi pointed this out.
17407
17408 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17409
17410         * class.cs (Method::Define): Handle PInvoke methods specially
17411         by using DefinePInvokeMethod instead of the usual one.
17412
17413         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17414         above to do the task of extracting information and defining the method.
17415
17416 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17417
17418         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17419         of the condition for string type.
17420
17421         (Emit): Move that here. 
17422
17423         (ArrayCreation::CheckIndices): Keep string literals in their expression
17424         form.
17425
17426         (EmitDynamicInitializers): Handle strings appropriately.
17427
17428 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17429
17430         * codegen.cs (EmitContext): Replace multiple variables with a
17431         single pointer to the current Switch statement.
17432
17433         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17434         EmitContext.
17435
17436 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17437
17438         * statement.cs 
17439
17440         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17441         default'.
17442
17443         (Foreach.Emit): Foreach on arrays was not setting
17444         up the loop variables (for break/continue).
17445
17446         (GotoCase): Semi-implented.
17447
17448 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17449
17450         * attribute.cs (CheckAttribute): Handle system attributes by using
17451         Attribute.GetAttributes to examine information we need.
17452
17453         (GetValidPlaces): Same here.
17454
17455         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17456
17457         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17458
17459         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17460
17461         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17462
17463         (Method::Emit): Handle the case when we are a PInvoke method.
17464
17465 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17466
17467         * expression.cs: Use ResolveWithSimpleName on compound names.
17468
17469 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17470
17471         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17472         before trying to reduce it.
17473
17474         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17475
17476         * constant.cs (LookupConstantValue): Implement.
17477
17478         (EmitConstant): Use the above in emitting the constant.
17479
17480         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17481         that are user-defined by doing a LookupConstantValue on them.
17482
17483         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17484         too, like above.
17485
17486 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17487
17488         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17489
17490         (BaseAccess.DoResolve): Implement.
17491
17492         (MemberAccess.DoResolve): Split this routine into a
17493         ResolveMemberAccess routine that can be used independently
17494
17495 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17496
17497         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17498         As that share bits of the implementation.  Is returns a boolean,
17499         while As returns the Type that is being probed.
17500
17501 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17502
17503         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17504         instead of a Literal - much easier.
17505
17506         (EnumInTransit): Remove - utterly useless :-)
17507
17508         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17509
17510         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17511
17512         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17513         chain when we have no associated expression.
17514
17515 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17516
17517         * constant.cs (Define): Use Location while reporting the errror.
17518
17519         Also emit a warning when 'new' is used and there is no inherited
17520         member to hide.
17521
17522         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17523         populated.
17524
17525         (LookupEnumValue): Implement to lookup an enum member's value and define it
17526         if necessary.
17527
17528         (Populate): Re-write accordingly to use the above routine.
17529
17530 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17531
17532         * expression.cs (This): Fix prototype for DoResolveLValue to
17533         override the base class DoResolveLValue.
17534
17535         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17536         declarations) 
17537
17538         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17539         (we need to load the address of the field here).  This fixes
17540         test-22. 
17541
17542         (FieldExpr.DoResolveLValue): Call the DoResolve
17543         function to initialize the Instance expression.
17544
17545         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17546         correctly the GetEnumerator operation on a value type.
17547
17548         * cs-parser.jay: Add more simple parsing error catches.
17549
17550         * statement.cs (Switch): Add support for string switches.
17551         Handle null specially.
17552
17553         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17554
17555 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17556
17557         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17558
17559         (declare_local_constant): New helper function.
17560
17561         * statement.cs (AddConstant): Keep a separate record of constants
17562
17563         (IsConstant): Implement to determine if a variable is a constant.
17564
17565         (GetConstantExpression): Implement.
17566
17567         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17568
17569         * statement.cs (IsVariableDefined): Re-write.
17570
17571 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17572
17573         * class.cs (TypeContainer::FindMembers): Look for constants
17574         in the case when we are looking for MemberTypes.Field
17575
17576         * expression.cs (MemberAccess::DoResolve): Check that in the
17577         case we are a FieldExpr and a Literal, we are not being accessed
17578         by an instance reference.
17579
17580         * cs-parser.jay (local_constant_declaration): Implement.
17581
17582         (declaration_statement): Implement for constant declarations.
17583
17584 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17585
17586         * statement.cs (Switch): Catch double defaults.
17587
17588         (Switch): More work on the switch() statement
17589         implementation.  It works for integral values now, need to finish
17590         string support.
17591
17592
17593 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17594
17595         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17596         integer literals into other integer literals.  To be used by
17597         switch. 
17598
17599 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17600
17601         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17602         some memory.
17603
17604         (EmitDynamicInitializers): Cope with the above since we extract data
17605         directly from ArrayData now.
17606
17607         (ExpectInitializers): Keep track of whether initializers are mandatory
17608         or not.
17609
17610         (Bounds): Make it a hashtable to prevent the same dimension being 
17611         recorded for every element in that dimension.
17612
17613         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17614         from being found.
17615
17616         Also fix bug which was causing the indices to be emitted in the reverse
17617         order.
17618
17619 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17620
17621         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17622         unfinished.  They do not work, because the underlying code is
17623         sloppy.
17624
17625 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17626
17627         * cs-parser.jay: Remove bogus fixme.
17628
17629         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17630         on Switch statement.
17631
17632 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17633
17634         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17635         the same. 
17636
17637         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17638         parameter. Apparently, any expression is allowed. 
17639
17640         (ValidateInitializers): Update accordingly.
17641
17642         (CheckIndices): Fix some tricky bugs thanks to recursion.
17643
17644         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17645         I was being completely brain-dead.
17646
17647         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17648         and re-write acordingly.
17649
17650         (DelegateInvocation): Re-write accordingly.
17651
17652         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17653
17654         (MakeByteBlob): Handle types more correctly.
17655
17656         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17657         initialization from expressions but it is incomplete because I am a complete
17658         Dodo :-|
17659
17660 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17661
17662         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17663         on If.  Basically, we have to return `true' (ie, we do return to
17664         our caller) only if both branches of the if return.
17665
17666         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17667         short-circuit operators, handle them as short circuit operators. 
17668
17669         (Cast.DoResolve): Resolve type.
17670         (Cast.Cast): Take an expression as the target type.
17671
17672         * cs-parser.jay (cast_expression): Remove old hack that only
17673         allowed a limited set of types to be handled.  Now we take a
17674         unary_expression and we resolve to a type during semantic
17675         analysis.
17676
17677         Use the grammar productions from Rhys to handle casts (this is
17678         not complete like Rhys syntax yet, we fail to handle that corner
17679         case that C# has regarding (-x), but we will get there.
17680
17681 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17682
17683         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17684         field which is an array type.
17685
17686         * cs-parser.jay (declare_local_variables): Support array initialization too.
17687
17688         * typemanager.cs (MakeKey): Implement.
17689
17690         (everywhere): Use the above appropriately.
17691
17692         * cs-parser.jay (for_statement): Update for array initialization while
17693         declaring variables.
17694
17695         * ecore.cs : The error message was correct, it's the variable's names that
17696         were misleading ;-) Make the code more readable.
17697
17698         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17699         the correct type etc.
17700
17701         (ConvertExplicit): Handle Enum types by examining the underlying type.
17702
17703 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17704
17705         * parameter.cs (GetCallingConvention): Always return
17706         CallingConventions.Standard for now.
17707
17708 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17709
17710         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17711         and `r' after calling DoNumericPromotions.
17712
17713         * ecore.cs: Fix error message (the types were in the wrong order).
17714
17715         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17716         BindingFlags.Instance as well 
17717
17718         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17719         implicit int literal conversion in an empty cast so that we
17720         propagate the right type upstream.
17721
17722         (UnboxCast): new class used to unbox value types.
17723         (Expression.ConvertExplicit): Add explicit type conversions done
17724         by unboxing.
17725
17726         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17727         the target type before applying the implicit LongLiterals to ULong
17728         literal cast.
17729
17730 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17731
17732         * cs-parser.jay (for_statement): Reworked the way For works: now
17733         we declare manually any variables that are introduced in
17734         for_initializer to solve the problem of having out-of-band code
17735         emition (that is what got for broken).
17736
17737         (declaration_statement): Perform the actual variable declaration
17738         that used to be done in local_variable_declaration here.
17739
17740         (local_variable_declaration): Do not declare anything, just pass
17741         the information on a DictionaryEntry
17742
17743 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17744
17745         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17746         re-write of the logic to now make it recursive.
17747
17748         (UpdateIndices): Re-write accordingly.
17749
17750         Store element data in a separate ArrayData list in the above methods.
17751
17752         (MakeByteBlob): Implement to dump the array data into a byte array.
17753
17754 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17755
17756         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17757         into CheckIndices.
17758
17759         * constant.cs (Define): Implement.
17760
17761         (EmitConstant): Re-write fully.
17762
17763         Pass in location info.
17764
17765         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17766         respectively.
17767
17768         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17769         DictionaryEntry since we need location info too.
17770
17771         (constant_declaration): Update accordingly.
17772
17773         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17774         code into another method : UpdateIndices.
17775
17776 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17777
17778         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17779         some type checking etc.
17780
17781 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17782
17783         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17784         bits to provide dimension info if the user skips doing that.
17785
17786         Update second constructor to store the rank correctly.
17787
17788 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17789
17790         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17791         and try to implement.
17792
17793         * ../errors/cs0150.cs : Add.
17794
17795         * ../errors/cs0178.cs : Add.
17796
17797 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17798
17799         * statement.cs: Implement foreach on multi-dimensional arrays. 
17800
17801         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17802         name of the params argument.
17803
17804         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17805         initializing the array.
17806
17807         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17808         we can use this elsewhere.
17809
17810         * statement.cs: Finish implementation of foreach for single
17811         dimension arrays.
17812
17813         * cs-parser.jay: Use an out-of-band stack to pass information
17814         around, I wonder why I need this.
17815
17816         foreach_block: Make the new foreach_block the current_block.
17817
17818         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17819         function used to return a static Parameters structure.  Used for
17820         empty parameters, as those are created very frequently.
17821
17822         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17823
17824 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17825
17826         * interface.cs : Default modifier is private, not public. The
17827         make verify test passes again.
17828
17829 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17830
17831         * support.cs (ReflectionParameters): Fix logic to determine
17832         whether the last parameter is a params one. Test 9 passes again.
17833
17834         * delegate.cs (Populate): Register the builders we define with
17835         RegisterParameterForBuilder. Test 19 passes again.
17836
17837         * cs-parser.jay (property_declaration): Reference $6 instead
17838         of $$ to get at the location.
17839
17840         (indexer_declaration): Similar stuff.
17841
17842         (attribute): Ditto.
17843
17844         * class.cs (Property): Register parameters for the Get and Set methods
17845         if they exist. Test 23 passes again.
17846
17847         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17848         call to EmitArguments as we are sure there aren't any params arguments. 
17849         Test 32 passes again.
17850
17851         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17852         IndexOutOfRangeException. 
17853
17854         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17855         Test 33 now passes again.
17856
17857 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17858
17859         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17860         broke a bunch of things.  Will have to come up with a better way
17861         of tracking locations.
17862
17863         * statement.cs: Implemented foreach for single dimension arrays.
17864
17865 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17866
17867         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17868         an error.  This removes the lookup from the critical path.
17869
17870         * cs-parser.jay: Removed use of temporary_loc, which is completely
17871         broken. 
17872
17873 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17874
17875         * support.cs (ReflectionParameters.ParameterModifier): Report
17876         whether the argument is a PARAMS argument or not.
17877
17878         * class.cs: Set the attribute `ParamArrayAttribute' on the
17879         parameter argument.
17880
17881         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17882         and cons_param_array_attribute (ConstructorInfo for
17883         ParamArrayAttribute)., 
17884
17885         * codegen.cs: Emit the return using the `Return' statement, that
17886         way we can report the error correctly for missing return values. 
17887
17888         * class.cs (Method.Emit): Clean up.
17889
17890         * expression.cs (Argument.Resolve): Take another argument: the
17891         location where this argument is used.  Notice that this is not
17892         part of the "Argument" class as to reduce the size of the
17893         structure (we know the approximate location anyways).
17894
17895         Test if the argument is a variable-reference, if not, then
17896         complain with a 206.
17897
17898         (Argument.Emit): Emit addresses of variables.
17899
17900         (Argument.FullDesc): Simplify.
17901
17902         (Invocation.DoResolve): Update for Argument.Resolve.
17903
17904         (ElementAccess.DoResolve): ditto.
17905
17906         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17907         method should be virtual, as this method is always virtual.
17908
17909         (NewDelegate.DoResolve): Update for Argument.Resolve.
17910
17911         * class.cs (ConstructorInitializer.DoResolve): ditto.
17912
17913         * attribute.cs (Attribute.Resolve): ditto.
17914
17915 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17916
17917         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17918
17919         * expression.cs (ParameterReference): Drop IStackStorage and implement
17920         IAssignMethod instead. 
17921
17922         (LocalVariableReference): ditto.
17923
17924         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17925         IAssignMethod instead. 
17926
17927 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17928
17929         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17930         enumerations that are used in heavily used structures derive from
17931         byte in a laughable and pathetic attempt to reduce memory usage.
17932         This is the kind of pre-optimzations that you should not do at
17933         home without adult supervision.
17934
17935         * expression.cs (UnaryMutator): New class, used to handle ++ and
17936         -- separatedly from the other unary operators.  Cleans up the
17937         code, and kills the ExpressionStatement dependency in Unary.
17938
17939         (Unary): Removed `method' and `Arguments' from this class, making
17940         it smaller, and moving it all to SimpleCall, so I can reuse this
17941         code in other locations and avoid creating a lot of transient data
17942         strucutres when not required.
17943
17944         * cs-parser.jay: Adjust for new changes.
17945
17946 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17947
17948         * enum.cs (Enum.Populate): If there is a failure during
17949         definition, return
17950
17951         * cs-parser.jay (opt_enum_base): we used to catch type errors
17952         here, but this is really incorrect.  The type error should be
17953         catched during semantic analysis.
17954
17955 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17956
17957         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17958         current_local_parameters as expected since I, in my stupidity, had forgotten
17959         to do this :-)
17960
17961         * attribute.cs (GetValidPlaces): Fix stupid bug.
17962
17963         * class.cs (Method::Emit): Perform check on applicability of attributes.
17964
17965         (Constructor::Emit): Ditto.
17966
17967         (Field::Emit): Ditto.
17968
17969         (Field.Location): Store location information.
17970
17971         (Property, Event, Indexer, Operator): Ditto.
17972
17973         * cs-parser.jay (field_declaration): Pass in location for each field.
17974
17975         * ../errors/cs0592.cs : Add.
17976
17977 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17978
17979         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17980
17981         (InitCoreTypes): Update accordingly.
17982
17983         (RegisterAttrType, LookupAttr): Implement.
17984
17985         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17986         info about the same.
17987
17988         (Resolve): Update to populate the above as necessary.
17989
17990         (Error592): Helper.
17991
17992         (GetValidPlaces): Helper to the above.
17993
17994         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17995
17996         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17997
17998 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17999
18000         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18001
18002         * ../errors/cs0617.cs : Add.
18003
18004 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18005
18006         * enum.cs (Emit): Rename to Populate to be more consistent with what
18007         we expect it to do and when exactly it is called.
18008
18009         * class.cs, rootcontext.cs : Update accordingly.
18010
18011         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18012         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18013
18014         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18015
18016         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18017         of a fieldinfo using the above, when dealing with a FieldBuilder.
18018
18019 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18020
18021         * ../errors/cs0031.cs : Add.
18022
18023         * ../errors/cs1008.cs : Add.
18024
18025         * ../errrors/cs0543.cs : Add.
18026
18027         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18028         enum type.
18029
18030         (FindMembers): Implement.
18031
18032         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18033         enums and delegates too.
18034
18035         (enum_types): Rename to builder_to_enum.
18036
18037         (delegate_types): Rename to builder_to_delegate.
18038
18039         * delegate.cs (FindMembers): Implement.
18040
18041 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18042
18043         * typemanager.cs (IsEnumType): Implement.
18044
18045         * enum.cs (Emit): Re-write parts to account for the underlying type
18046         better and perform checking etc.
18047
18048         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18049         of the underlying type.
18050
18051         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18052         value
18053
18054         * enum.cs (error31): Helper to report error #31.
18055
18056         * cs-parser.jay (enum_declaration): Store location of each member too.
18057
18058         * enum.cs (member_to_location): New hashtable. 
18059
18060         (AddEnumMember): Update location hashtable.
18061
18062         (Emit): Use the location of each member while reporting errors.
18063
18064 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18065
18066         * cs-parser.jay: A for_initializer if is a
18067         local_variable_declaration really ammount to have an implicit
18068         block with the variable declaration and no initializer for for.
18069
18070         * statement.cs (For.Emit): Cope with null initializers.
18071
18072         This fixes the infinite loop on for initializers.
18073
18074 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18075
18076         * enum.cs: More cleanup.
18077
18078         * ecore.cs: Remove dead code.
18079
18080         * class.cs (Property.Emit): More simplification.
18081         (Event.Emit): ditto.
18082
18083         Reworked to have less levels of indentation.
18084
18085 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18086
18087         * class.cs (Property): Emit attributes.
18088
18089         (Field): Ditto.
18090
18091         (Event): Ditto.
18092
18093         (Indexer): Ditto.
18094
18095         (Operator): Ditto.
18096
18097         * enum.cs (Emit): Ditto.
18098
18099         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18100         Enums too.
18101
18102         * class.cs (Field, Event, etc.): Move attribute generation into the
18103         Emit method everywhere.
18104
18105         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18106         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18107         as we had no way of defining nested enums !
18108
18109         * rootcontext.cs : Adjust code accordingly.
18110
18111         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18112
18113 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18114
18115         * expression.cs (EvalConstantExpression): Move into ecore.cs
18116
18117         * enum.cs (Enum): Rename some members and make them public and readonly
18118         according to our convention.
18119
18120         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18121         nothing else.
18122
18123         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18124
18125         (Enum::Emit): Write a simple version for now which doesn't try to compute
18126         expressions. I shall modify this to be more robust in just a while.
18127
18128         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18129
18130         (TypeContainer::CloseType): Create the Enum types too.
18131
18132         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18133
18134         * expression.cs (EvalConstantExpression): Get rid of completely.
18135
18136         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18137         user-defined values and other cases.
18138
18139         (IsValidEnumLiteral): Helper function.
18140
18141         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18142         out there in the case we had a literal FieldExpr.
18143
18144         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18145
18146         (Literalize): Revamp a bit to take two arguments.
18147
18148         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18149
18150 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18151
18152         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18153
18154         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18155
18156         (Resolve): Use the above to ensure we have proper initializers.
18157
18158 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18159
18160         * expression.cs (Expression::EvalConstantExpression): New method to 
18161         evaluate constant expressions.
18162
18163         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18164
18165 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18166
18167         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18168         in an array.
18169
18170         (Binary.ResolveOperator): Handle operator != (object a, object b)
18171         and operator == (object a, object b);
18172
18173         (Binary.DoNumericPromotions): Indicate whether the numeric
18174         promotion was possible.
18175
18176         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18177         Implement.  
18178
18179         Made the ArrayAccess implement interface IAssignMethod instead of
18180         IStackStore as the order in which arguments are passed reflects
18181         this.
18182
18183         * assign.cs: Instead of using expr.ExprClass to select the way of
18184         assinging, probe for the IStackStore/IAssignMethod interfaces.
18185
18186         * typemanager.cs: Load InitializeArray definition.
18187
18188         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18189         static data that can be used to initialize arrays. 
18190
18191 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18192
18193         * expression.cs: Handle operator== and operator!= for booleans.
18194
18195         (Conditioal.Reduce): Implement reducer for the ?: operator.
18196
18197         (Conditional.Resolve): Implement dead code elimination.
18198
18199         (Binary.Resolve): Catch string literals and return a new
18200         concatenated string.
18201
18202         (Unary.Reduce): Implement reduction of unary expressions.
18203
18204         * ecore.cs: Split out the expression core handling here.
18205
18206         (Expression.Reduce): New method used to perform constant folding
18207         and CSE.  This is needed to support constant-expressions. 
18208
18209         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18210         targets, and optimize for !x.
18211
18212 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18213
18214         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18215         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18216         set custom atttributes.
18217
18218         * literal.cs (Literal::GetValue): New abstract method to return the actual
18219         value of the literal, cast as an object.
18220
18221         (*Literal): Implement GetValue method.
18222
18223         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18224         expressions to the arraylist but objects of type Argument.
18225
18226         * class.cs (TypeContainer::Emit): Emit our attributes too.
18227
18228         (Method::Emit, Constructor::Emit): Ditto.
18229
18230         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18231         to be ignoring earlier.
18232
18233 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18234
18235         * attribute.cs (AttributeSection::Define): Implement to do the business
18236         of constructing a CustomAttributeBuilder.
18237
18238         (Attribute): New trivial class. Increases readability of code.  
18239
18240         * cs-parser.jay : Update accordingly.
18241
18242         (positional_argument_list, named_argument_list, named_argument): New rules
18243
18244         (attribute_arguments): Use the above so that we are more correct.
18245
18246 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18247
18248         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18249         to perform all checks for a method with a params parameter.
18250
18251         (Invocation::OverloadResolve): Update to use the above method and therefore
18252         cope correctly with params method invocations.
18253
18254         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18255         params too.
18256
18257         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18258         constructors in our parent too because we can't afford to miss out on 
18259         protected ones ;-)
18260
18261         * attribute.cs (AttributeSection): New name for the class Attribute
18262
18263         Other trivial changes to improve readability.
18264
18265         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18266         use the new class names.
18267
18268 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18269
18270         * class.cs (Method::Define): Complete definition for params types too
18271
18272         (Indexer::Define): Ditto.
18273
18274         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18275         Cope everywhere with a request for info about the array parameter.
18276
18277 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18278
18279         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18280
18281         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18282         local_variable_type to extract the string corresponding to the type.
18283
18284         (local_variable_type): Fixup the action to use the new helper method.
18285
18286         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18287         go.
18288
18289         * expression.cs : Clean out code which uses the above.
18290
18291 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18292
18293         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18294         and bale out if necessary by returning a false.
18295
18296         (RegisterProperty): Ditto.
18297
18298         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18299         and print out appropriate error messages.
18300
18301         * interface.cs (everywhere): Ditto.
18302
18303         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18304         location to constructor.
18305
18306         * class.cs (Property, Event, Indexer): Update accordingly.
18307
18308         * ../errors/cs111.cs : Added.
18309
18310         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18311         of a method, as laid down by the spec.
18312
18313         (Invocation::OverloadResolve): Use the above method.
18314
18315 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18316
18317         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18318         now take a TypeContainer and a Parameters object.
18319
18320         (ParameterData): Modify return type of ParameterModifier method to be 
18321         Parameter.Modifier and not a string.
18322
18323         (ReflectionParameters, InternalParameters): Update accordingly.
18324
18325         * expression.cs (Argument::GetParameterModifier): Same here.
18326
18327         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18328         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18329         symbol in it at all so maybe this is only for now.
18330
18331 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18332
18333         * support.cs (InternalParameters): Constructor now takes an extra argument 
18334         which is the actual Parameters class.
18335
18336         (ParameterDesc): Update to provide info on ref/out modifiers.
18337
18338         * class.cs (everywhere): Update call to InternalParameters to pass in
18339         the second argument too.
18340
18341         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18342         to return the modifier info [ref/out etc]
18343
18344         (InternalParameters, ReflectionParameters): Implement the above.
18345
18346         * expression.cs (Argument::ParameterModifier): Similar function to return
18347         info about the argument's modifiers.
18348
18349         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18350         too.
18351
18352         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18353         a new SetFormalParameters object which we pass to InternalParameters.
18354
18355 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18356
18357         * expression.cs (NewArray): Merge into the ArrayCreation class.
18358
18359 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18360
18361         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18362         NewUserdefinedArray into one as there wasn't much of a use in having
18363         two separate ones.
18364
18365         * expression.cs (Argument): Change field's name to ArgType from Type.
18366
18367         (Type): New readonly property which returns the proper type, taking into 
18368         account ref/out modifiers.
18369
18370         (everywhere): Adjust code accordingly for the above.
18371
18372         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18373         whether we are emitting for a ref or out parameter.
18374
18375         * expression.cs (Argument::Emit): Use the above field to set the state.
18376
18377         (LocalVariableReference::Emit): Update to honour the flag and emit the
18378         right stuff.
18379
18380         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18381
18382         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18383
18384         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18385
18386         (ReflectionParameters, InternalParameters): Implement the above method.
18387
18388         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18389         reporting errors.
18390
18391         (Invocation::FullMethodDesc): Ditto. 
18392
18393 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18394
18395         * cs-parser.jay: Add extra production for the second form of array
18396         creation. 
18397
18398         * expression.cs (ArrayCreation): Update to reflect the above
18399         change. 
18400
18401         * Small changes to prepare for Array initialization.
18402
18403 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18404
18405         * typemanager.cs (ImplementsInterface): interface might be null;
18406         Deal with this problem;
18407
18408         Also, we do store negative hits on the cache (null values), so use
18409         this instead of calling t.GetInterfaces on the type everytime.
18410
18411 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18412
18413         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18414
18415         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18416         split functionality out into different classes.
18417
18418         (New::FormArrayType): Move into NewBuiltinArray.
18419
18420         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18421         quite useless.
18422
18423         (NewBuiltinArray): New class to handle creation of built-in arrays.
18424
18425         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18426         account creation of one-dimensional arrays.
18427
18428         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18429
18430         (NewUserdefinedArray::DoResolve): Implement.
18431
18432         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18433
18434         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18435         we maintain inside the TypeManager. This is necessary to perform lookups on the
18436         module builder.
18437
18438         (LookupType): Update to perform GetType on the module builders too.     
18439
18440         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18441
18442         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18443
18444 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18445
18446         * expression.cs (New::DoResolve): Implement guts of array creation.
18447
18448         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18449
18450 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * expression.cs: Fix bug I introduced lsat night that broke
18453         Delegates. 
18454
18455         (Expression.Resolve): Report a 246 error (can not resolve name)
18456         if we find a SimpleName in the stream.
18457
18458         (Expression.ResolveLValue): Ditto.
18459
18460         (Expression.ResolveWithSimpleName): This function is a variant of
18461         ResolveName, this one allows SimpleNames to be returned without a
18462         warning.  The only consumer of SimpleNames is MemberAccess
18463
18464 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18465
18466         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18467         might arrive here.  I have my doubts that this is correct.
18468
18469         * statement.cs (Lock): Implement lock statement.
18470
18471         * cs-parser.jay: Small fixes to support `lock' and `using'
18472
18473         * cs-tokenizer.cs: Remove extra space
18474
18475         * driver.cs: New flag --checked, allows to turn on integer math
18476         checking. 
18477
18478         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18479         Threading.Monitor.Exit 
18480
18481 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18482
18483         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18484         Expression Class to be IndexerAccess.
18485
18486         Notice that Indexer::DoResolve sets the eclass to Value.
18487
18488 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18489
18490         * class.cs (TypeContainer::Emit): Emit code for indexers.
18491
18492         * assign.cs (IAssignMethod): New interface implemented by Indexers
18493         and Properties for handling assignment.
18494
18495         (Assign::Emit): Simplify and reuse code. 
18496
18497         * expression.cs (IndexerAccess, PropertyExpr): Implement
18498         IAssignMethod, clean up old code. 
18499
18500 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18501
18502         * typemanager.cs (ImplementsInterface): New method to determine if a type
18503         implements a given interface. Provides a nice cache too.
18504
18505         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18506         method.
18507
18508         (ConvertReferenceExplicit): Ditto.
18509
18510         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18511         various methods, with correct names etc.
18512
18513         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18514         Operator.UnaryNegation.
18515
18516         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18517         we have a unary plus or minus operator.
18518
18519         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18520         UnaryMinus.
18521
18522         * everywhere : update accordingly.
18523
18524         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18525         respectively.
18526
18527         * class.cs (Method::Define): For the case where we are implementing a method
18528         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18529         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18530
18531 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18532
18533         * interface.cs (FindMembers): Implement to work around S.R.E
18534         lameness.
18535
18536         * typemanager.cs (IsInterfaceType): Implement.
18537
18538         (FindMembers): Update to handle interface types too.
18539
18540         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18541         use IsAssignableFrom as that is not correct - it doesn't work.
18542
18543         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18544         and accordingly override EmitStatement.
18545
18546         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18547         using the correct logic :-)
18548
18549 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18550
18551         * ../errors/cs-11.cs : Add to demonstrate error -11 
18552
18553 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18554
18555         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18556         then pass this as a hint to ResolveLValue.
18557
18558         * expression.cs (FieldExpr): Add Location information
18559
18560         (FieldExpr::LValueResolve): Report assignment to readonly
18561         variable. 
18562
18563         (Expression::ExprClassFromMemberInfo): Pass location information.
18564
18565         (Expression::ResolveLValue): Add new method that resolves an
18566         LValue. 
18567
18568         (Expression::DoResolveLValue): Default invocation calls
18569         DoResolve. 
18570
18571         (Indexers): New class used to keep track of indexers in a given
18572         Type. 
18573
18574         (IStackStore): Renamed from LValue, as it did not really describe
18575         what this did.  Also ResolveLValue is gone from this interface and
18576         now is part of Expression.
18577
18578         (ElementAccess): Depending on the element access type
18579
18580         * typemanager.cs: Add `indexer_name_type' as a Core type
18581         (System.Runtime.CompilerServices.IndexerNameAttribute)
18582
18583         * statement.cs (Goto): Take a location.
18584
18585 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18586
18587         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18588         if two delegates are compatible.
18589
18590         (NewDelegate::DoResolve): Update to take care of the case when
18591         we instantiate a delegate from another delegate.
18592
18593         * typemanager.cs (FindMembers): Don't even try to look up members
18594         of Delegate types for now.
18595
18596 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18597
18598         * delegate.cs (NewDelegate): New class to take care of delegate
18599         instantiation.
18600
18601         * expression.cs (New): Split the delegate related code out into 
18602         the NewDelegate class.
18603
18604         * delegate.cs (DelegateInvocation): New class to handle delegate 
18605         invocation.
18606
18607         * expression.cs (Invocation): Split out delegate related code into
18608         the DelegateInvocation class.
18609
18610 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18611
18612         * expression.cs (New::DoResolve): Implement delegate creation fully
18613         and according to the spec.
18614
18615         (New::DoEmit): Update to handle delegates differently.
18616
18617         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18618         because of which we were printing out arguments in reverse order !
18619
18620         * delegate.cs (VerifyMethod): Implement to check if the given method
18621         matches the delegate.
18622
18623         (FullDelegateDesc): Implement.
18624
18625         (VerifyApplicability): Implement.
18626
18627         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18628         delegate invocations too.
18629
18630         (Invocation::Emit): Ditto.
18631
18632         * ../errors/cs1593.cs : Added.
18633
18634         * ../errors/cs1594.cs : Added.
18635
18636         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18637
18638 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18639
18640         * typemanager.cs (intptr_type): Core type for System.IntPtr
18641
18642         (InitCoreTypes): Update for the same.
18643
18644         (iasyncresult_type, asynccallback_type): Ditto.
18645
18646         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18647         correct.
18648
18649         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18650         too.
18651
18652         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18653         the builders for the 4 members of a delegate type :-)
18654
18655         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18656         type.
18657
18658         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18659
18660         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18661
18662 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18663
18664         * statement.cs (Break::Emit): Implement.   
18665         (Continue::Emit): Implement.
18666
18667         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18668         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18669         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18670         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18671         end loop
18672
18673         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18674         properties that track the label for the current loop (begin of the
18675         loop and end of the loop).
18676
18677 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18678
18679         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18680         use of emitting anything at all.
18681
18682         * class.cs, rootcontext.cs : Get rid of calls to the same.
18683
18684         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18685
18686         (Populate): Define the constructor correctly and set the implementation
18687         attributes.
18688
18689         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18690         have been defined.
18691
18692         (AddDelegateType): Implement.
18693
18694         (IsDelegateType): Implement helper method.
18695
18696         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18697
18698         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18699         and accordingly handle it.
18700
18701         * delegate.cs (Populate): Take TypeContainer argument.
18702         Implement bits to define the Invoke method. However, I still haven't figured out
18703         how to take care of the native int bit :-(
18704
18705         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18706         Qualify the name of the delegate, not its return type !
18707
18708         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18709         conversion.
18710
18711         (StandardConversionExists): Checking for array types turns out to be recursive.
18712
18713         (ConvertReferenceExplicit): Implement array conversion.
18714
18715         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18716
18717 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18718
18719         * cs-parser.jay (delegate_declaration): Store the fully qualified
18720         name as it is a type declaration.
18721
18722         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18723         readonly.
18724
18725         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18726         as TypeContainer::DefineType.
18727
18728         (Populate): Method in which all the definition of the various methods (Invoke)
18729         etc is done.
18730
18731         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18732         see.
18733
18734         (CloseDelegate): Finally creates the delegate.
18735
18736         * class.cs (TypeContainer::DefineType): Update to define delegates.
18737         (Populate, Emit and CloseType): Do the same thing here too.
18738
18739         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18740         delegates in all these operations.
18741
18742 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18743
18744         * expression.cs: LocalTemporary: a new expression used to
18745         reference a temporary that has been created.
18746
18747         * assign.cs: Handle PropertyAccess back here, so that we can
18748         provide the proper semantic access to properties.
18749
18750         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18751         a few more explicit conversions. 
18752
18753         * modifiers.cs: `NEW' modifier maps to HideBySig.
18754
18755         * expression.cs (PropertyExpr): Make this into an
18756         ExpressionStatement, and support the EmitStatement code path. 
18757
18758         Perform get/set error checking, clean up the interface.
18759
18760         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18761         them into toplevel access objects.
18762
18763 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18764
18765         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18766         SRE.
18767
18768         * typemanager.cs: Keep track here of our PropertyBuilders again to
18769         work around lameness in SRE.
18770
18771 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18772
18773         * expression.cs (LValue::LValueResolve): New method in the
18774         interface, used to perform a second resolution pass for LValues. 
18775
18776         (This::DoResolve): Catch the use of this in static methods.
18777
18778         (This::LValueResolve): Implement.
18779
18780         (This::Store): Remove warning, assigning to `this' in structures
18781         is 
18782
18783         (Invocation::Emit): Deal with invocation of
18784         methods on value types.  We need to pass the address to structure
18785         methods rather than the object itself.  (The equivalent code to
18786         emit "this" for structures leaves the entire structure on the
18787         stack instead of a pointer to it). 
18788
18789         (ParameterReference::DoResolve): Compute the real index for the
18790         argument based on whether the method takes or not a `this' pointer
18791         (ie, the method is static).
18792
18793         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18794         value types returned from functions when we need to invoke a
18795         method on the sturcture.
18796
18797
18798 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18799
18800         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18801         defining the type in the Modulebuilder or Typebuilder. This is to take
18802         care of nested types which need to be defined on the TypeBuilder using
18803         DefineNestedMethod.
18804
18805         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18806         methods in RootContext, only ported to be part of TypeContainer.
18807
18808         (TypeContainer::GetInterfaceOrClass): Ditto.
18809
18810         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18811
18812         * interface.cs (Interface::DefineInterface): New method. Does exactly
18813         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18814         too.
18815
18816         (Interface::GetInterfaces): Move from RootContext here and port.
18817
18818         (Interface::GetInterfaceByName): Same here.
18819
18820         * rootcontext.cs (ResolveTree): Re-write.
18821
18822         (PopulateTypes): Re-write.
18823
18824         * class.cs (TypeContainer::Populate): Populate nested types too.
18825         (TypeContainer::Emit): Emit nested members too.
18826
18827         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18828         instead just use the name argument passed in as it is already fully
18829         qualified.
18830
18831         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18832         to TypeContainer mapping to see if a type is user-defined.
18833
18834         * class.cs (TypeContainer::CloseType): Implement. 
18835
18836         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18837         the default constructor.
18838
18839         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18840         twice.
18841
18842         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18843
18844         * interface.cs (CloseType): Create the type here.
18845
18846         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18847         the hierarchy.
18848
18849         Remove all the methods which are now in TypeContainer.
18850
18851 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18852
18853         * delegate.cs (Define): Re-write bits to define the delegate
18854         correctly.
18855
18856 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18859
18860         * expression.cs (ImplicitReferenceConversion): handle null as well
18861         as a source to convert to any reference type.
18862
18863         * statement.cs (Return): Perform any implicit conversions to
18864         expected return type.  
18865
18866         Validate use of return statement.  
18867
18868         * codegen.cs (EmitContext): Pass the expected return type here.
18869
18870         * class.cs (Method, Constructor, Property): Pass expected return
18871         type to EmitContext.
18872
18873 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18874
18875         * expression.cs: Make DoResolve take an EmitContext instead of a
18876         TypeContainer.
18877
18878         Replaced `l' and `location' for `loc', for consistency.
18879
18880         (Error, Warning): Remove unneeded Tc argument.
18881
18882         * assign.cs, literal.cs, constant.cs: Update to new calling
18883         convention. 
18884
18885         * codegen.cs: EmitContext now contains a flag indicating whether
18886         code is being generated in a static method or not.
18887
18888         * cs-parser.jay: DecomposeQI, new function that replaces the old
18889         QualifiedIdentifier.  Now we always decompose the assembled
18890         strings from qualified_identifier productions into a group of
18891         memberaccesses.
18892
18893 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18894
18895         * rootcontext.cs: Deal with field-less struct types correctly now
18896         by passing the size option to Define Type.
18897
18898         * class.cs: Removed hack that created one static field. 
18899
18900 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18901
18902         * statement.cs: Moved most of the code generation here. 
18903
18904 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18905
18906         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18907         seem very right.
18908
18909         (ElementAccess): Remove useless bits for now - keep checks as the spec
18910         says.
18911
18912 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18913
18914         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18915         and start performing checks according to the spec.
18916
18917 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18918
18919         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18920         rank_specifiers instead.
18921
18922         (rank_specifiers): Change the order in which the rank specifiers are stored
18923
18924         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18925
18926         * expression.cs (ElementAccess): Implement the LValue interface too.
18927
18928 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18929
18930         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18931         except that user defined conversions are not included.
18932
18933         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18934         perform the conversion of the return type, if necessary.
18935
18936         (New::DoResolve): Check whether we are creating an array or an object
18937         and accordingly do the needful.
18938
18939         (New::Emit): Same here.
18940
18941         (New::DoResolve): Implement guts of array creation.
18942
18943         (New::FormLookupType): Helper function.
18944
18945 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18946
18947         * codegen.cs: Removed most of the code generation here, and move the
18948         corresponding code generation bits to the statement classes. 
18949
18950         Added support for try/catch/finalize and throw.
18951
18952         * cs-parser.jay: Added support for try/catch/finalize.
18953
18954         * class.cs: Catch static methods having the flags override,
18955         virtual or abstract.
18956
18957         * expression.cs (UserCast): This user cast was not really doing
18958         what it was supposed to do.  Which is to be born in fully resolved
18959         state.  Parts of the resolution were being performed at Emit time! 
18960
18961         Fixed this code.
18962
18963 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18964
18965         * expression.cs: Implicity convert the result from UserCast.
18966
18967 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18968
18969         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18970         prevented it from working correctly. 
18971
18972         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18973         merely ConvertImplicit.
18974
18975 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18976
18977         * typemanager.cs: Make the LookupTypeContainer function static,
18978         and not per-instance.  
18979
18980         * class.cs: Make static FindMembers (the one that takes a Type
18981         argument). 
18982
18983         * codegen.cs: Add EmitForeach here.
18984
18985         * cs-parser.jay: Make foreach a toplevel object instead of the
18986         inline expansion, as we need to perform semantic analysis on it. 
18987
18988 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18989
18990         * expression.cs (Expression::ImplicitUserConversion): Rename to
18991         UserDefinedConversion.
18992
18993         (Expression::UserDefinedConversion): Take an extra argument specifying 
18994         whether we look for explicit user conversions too.
18995
18996         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18997
18998         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18999
19000         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19001         with the appropriate arguments.
19002
19003         * cs-parser.jay (cast_expression): Record location too.
19004
19005         * expression.cs (Cast): Record location info.
19006
19007         (Expression::ConvertExplicit): Take location argument.
19008
19009         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19010         to determine if we are doing explicit conversions.
19011
19012         (UserCast::Emit): Update accordingly.
19013
19014         (Expression::ConvertExplicit): Report an error if everything fails.
19015
19016         * ../errors/cs0030.cs : Add.
19017
19018 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19019
19020         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19021         virtual and newslot bits. 
19022
19023         * class.cs (TypeContainer::RegisterRequiredImplementations):
19024         Record methods we need.
19025
19026         (TypeContainer::MakeKey): Helper function to make keys for
19027         MethodBases, since the Methodbase key is useless.
19028
19029         (TypeContainer::Populate): Call RegisterRequiredImplementations
19030         before defining the methods.   
19031
19032         Create a mapping for method_builders_to_methods ahead of time
19033         instead of inside a tight loop.
19034
19035         (::RequireMethods):  Accept an object as the data to set into the
19036         hashtable so we can report interface vs abstract method mismatch.
19037
19038 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19039
19040         * report.cs: Make all of it static.
19041
19042         * rootcontext.cs: Drop object_type and value_type computations, as
19043         we have those in the TypeManager anyways.
19044
19045         Drop report instance variable too, now it is a global.
19046
19047         * driver.cs: Use try/catch on command line handling.
19048
19049         Add --probe option to debug the error reporting system with a test
19050         suite. 
19051
19052         * report.cs: Add support for exiting program when a probe
19053         condition is reached.
19054
19055 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19056
19057         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19058         we do a forcible conversion regardless of type, to check if 
19059         ForceConversion returns a null.
19060
19061         (Binary::error19): Use location to report error.
19062
19063         (Unary::error23): Use location here too.
19064
19065         * ../errors/cs0019.cs : Check in.
19066
19067         * ../errors/cs0023.cs : Check in.
19068
19069         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19070         case of a non-null MethodInfo object with a length of 0 !
19071
19072         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19073         an applicable member - according to the spec :-)
19074         Also fix logic to find members in base types.
19075
19076         (Unary::ResolveOperator): Same here.
19077
19078         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19079         as I was getting thoroughly confused between this and error19 :-)
19080
19081         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19082         (::FindMostEncompassedType): Implement.
19083         (::FindMostEncompassingType): Implement.
19084         (::StandardConversionExists): Implement.
19085
19086         (UserImplicitCast): Re-vamp. We now need info about most specific
19087         source and target types so that we can do the necessary conversions.
19088
19089         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19090         mathematical union with no duplicates.
19091
19092 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19093
19094         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19095         in order from base classes to child classes, so that we can in
19096         child classes look up in our parent for method names and
19097         attributes (required for handling abstract, virtual, new, override
19098         constructs: we need to instrospect our base class, and if we dont
19099         populate the classes in order, the introspection might be
19100         incorrect.  For example, a method could query its parent before
19101         the parent has any methods and would determine that the parent has
19102         no abstract methods (while it could have had them)).
19103
19104         (RootContext::CreateType): Record the order in which we define the
19105         classes.
19106
19107 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19108
19109         * class.cs (TypeContainer::Populate): Also method definitions can
19110         fail now, keep track of this.
19111
19112         (TypeContainer::FindMembers): Implement support for
19113         DeclaredOnly/noDeclaredOnly flag.
19114
19115         (Constructor::Emit) Return the ConstructorBuilder.
19116
19117         (Method::Emit) Return the MethodBuilder. 
19118         Check for abstract or virtual methods to be public.
19119
19120         * rootcontext.cs (RootContext::CreateType): Register all the
19121         abstract methods required for the class to be complete and the
19122         interface methods that must be implemented. 
19123
19124         * cs-parser.jay: Report error 501 (method requires body if it is
19125         not marked abstract or extern).
19126
19127         * expression.cs (TypeOf::Emit): Implement.
19128
19129         * typemanager.cs: runtime_handle_type, new global type.
19130
19131         * class.cs (Property::Emit): Generate code for properties.
19132
19133 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19134
19135         * expression.cs (Unary::ResolveOperator): Find operators on base type
19136         too - we now conform exactly to the spec.
19137
19138         (Binary::ResolveOperator): Same here.
19139
19140         * class.cs (Operator::Define): Fix minor quirk in the tests.
19141
19142         * ../errors/cs0215.cs : Added.
19143
19144         * ../errors/cs0556.cs : Added.
19145
19146         * ../errors/cs0555.cs : Added.
19147
19148 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19149
19150         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19151         single integer which is really efficient
19152
19153 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19154
19155         *  expression.cs (Expression::ImplicitUserConversion): Use location
19156         even in the case when we are examining True operators.
19157  
19158         * class.cs (Operator::Define): Perform extensive checks to conform
19159         with the rules for operator overloading in the spec.
19160
19161         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19162         some of the other conversions mentioned in the spec.
19163
19164         * typemanager.cs (array_type): New static member for the System.Array built-in
19165         type.
19166
19167         (cloneable_interface): For System.ICloneable interface.
19168
19169         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19170         we start resolving the tree and populating types.
19171
19172         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19173  
19174 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19175
19176         * expression.cs (Expression::ExprClassFromMemberInfo,
19177         Expression::Literalize): Create literal expressions from
19178         FieldInfos which are literals.
19179
19180         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19181         type casts, because they were wrong.  The test suite in tests
19182         caught these ones.
19183
19184         (ImplicitNumericConversion): ushort to ulong requires a widening
19185         cast. 
19186
19187         Int32 constant to long requires widening cast as well.
19188
19189         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19190         for integers because the type on the stack is not i4.
19191
19192 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19193
19194         * expression.cs (report118): require location argument. 
19195
19196         * parameter.cs: Do not dereference potential null value.
19197
19198         * class.cs: Catch methods that lack the `new' keyword when
19199         overriding a name.  Report warnings when `new' is used without
19200         anything being there to override.
19201
19202         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19203
19204         * class.cs: Only add constructor to hashtable if it is non-null
19205         (as now constructors can fail on define).
19206
19207         (TypeManager, Class, Struct): Take location arguments.
19208
19209         Catch field instance initialization in structs as errors.
19210
19211         accepting_filter: a new filter for FindMembers that is static so
19212         that we dont create an instance per invocation.
19213
19214         (Constructor::Define): Catch errors where a struct constructor is
19215         parameterless 
19216
19217         * cs-parser.jay: Pass location information for various new
19218         constructs. 
19219
19220         * delegate.cs (Delegate): take a location argument.
19221
19222         * driver.cs: Do not call EmitCode if there were problesm in the
19223         Definition of the types, as many Builders wont be there. 
19224
19225         * decl.cs (Decl::Decl): Require a location argument.
19226
19227         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19228         into integers, and find the most appropiate integer for it.
19229
19230         * literal.cs: Implement ULongLiteral.
19231
19232         * rootcontext.cs: Provide better information about the location of
19233         failure when CreateType fails.
19234
19235 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19236
19237         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19238         as well.
19239
19240         * expression.cs (Binary::CheckShiftArguments): Add missing type
19241         computation.
19242         (Binary::ResolveOperator): Add type to the logical and and logical
19243         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19244         before.
19245
19246         (Binary::DoNumericPromotions): In the case where either argument
19247         is ulong (and most signed types combined with ulong cause an
19248         error) perform implicit integer constant conversions as well.
19249
19250 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19251
19252         * expression.cs (UserImplicitCast): Method should always be
19253         non-null. 
19254         (Invocation::BetterConversion): Simplified test for IntLiteral.
19255
19256         (Expression::ImplicitNumericConversion): Split this routine out.
19257         Put the code that performs implicit constant integer conversions
19258         here. 
19259
19260         (Expression::Resolve): Become a wrapper around DoResolve so we can
19261         check eclass and type being set after resolve.
19262
19263         (Invocation::Badness): Remove this dead function
19264
19265         (Binary::ResolveOperator): Do not compute the expensive argumnets
19266         unless we have a union for it.
19267
19268         (Probe::Emit): Is needs to do an isinst and then
19269         compare against null.
19270
19271         (::CanConvert): Added Location argument.  If the Location argument
19272         is null (Location.Null), then we do not report errors.  This is
19273         used by the `probe' mechanism of the Explicit conversion.  We do
19274         not want to generate an error for something that the user
19275         explicitly requested to be casted.  But the pipeline for an
19276         explicit cast first tests for potential implicit casts.
19277
19278         So for now, if the Location is null, it means `Probe only' to
19279         avoid adding another argument.   Might have to revise this
19280         strategy later.
19281
19282         (ClassCast): New class used to type cast objects into arbitrary
19283         classes (used in Explicit Reference Conversions).
19284
19285         Implement `as' as well.
19286
19287         Reverted all the patches from Ravi below: they were broken:
19288
19289                 * The use of `level' as a mechanism to stop recursive
19290                   invocations is wrong.  That was there just to catch the
19291                   bug with a strack trace but not as a way of addressing
19292                   the problem.
19293
19294                   To fix the problem we have to *understand* what is going
19295                   on and the interactions and come up with a plan, not
19296                   just get things going.
19297
19298                 * The use of the type conversion cache that I proposed
19299                   last night had an open topic: How does this work across
19300                   protection domains.  A user defined conversion might not
19301                   be public in the location where we are applying the
19302                   conversion, a different conversion might be selected
19303                   (ie, private A->B (better) but public B->A (worse),
19304                   inside A, A->B applies, but outside it, B->A will
19305                   apply).
19306
19307                 * On top of that (ie, even if the above is solved),
19308                   conversions in a cache need to be abstract.  Ie, `To
19309                   convert from an Int to a Short use an OpcodeCast', not
19310                   `To convert from an Int to a Short use the OpcodeCast on
19311                   the variable 5' (which is what this patch was doing).
19312
19313 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19314
19315         * expression.cs (Invocation::ConversionExists): Re-write to use
19316         the conversion cache
19317
19318         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19319         cache all conversions done, not just user-defined ones.
19320
19321         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19322         to determine if a conversion exists instead of acutually trying to 
19323         perform the conversion. It's faster too.
19324
19325         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19326         and only then attempt the implicit conversion.
19327
19328 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19329
19330         * expression.cs (ConvertImplicit): Use a cache for conversions
19331         already found. Check level of recursion and bail out if necessary.
19332
19333 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19334
19335         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19336         Export standard methods that we expect for string operations.
19337
19338         * statement.cs (Block::UsageWarning): Track usage of variables and
19339         report the errors for not used variables.
19340
19341         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19342         operator. 
19343
19344 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19345
19346         * codegen.cs: remove unnneded code 
19347
19348         * expression.cs: Removed BuiltinTypeAccess class
19349
19350         Fix the order in which implicit conversions are
19351         done.  
19352
19353         The previous fixed dropped support for boxed conversions (adding a
19354         test to the test suite now)
19355
19356         (UserImplicitCast::CanConvert): Remove test for source being null,
19357         that code is broken.  We should not feed a null to begin with, if
19358         we do, then we should track the bug where the problem originates
19359         and not try to cover it up here.
19360
19361         Return a resolved expression of type UserImplicitCast on success
19362         rather than true/false.  Ravi: this is what I was talking about,
19363         the pattern is to use a static method as a "constructor" for
19364         objects. 
19365
19366         Also, do not create arguments until the very last minute,
19367         otherwise we always create the arguments even for lookups that
19368         will never be performed. 
19369
19370         (UserImplicitCast::Resolve): Eliminate, objects of type
19371         UserImplicitCast are born in a fully resolved state. 
19372
19373         * typemanager.cs (InitCoreTypes): Init also value_type
19374         (System.ValueType). 
19375
19376         * expression.cs (Cast::Resolve): First resolve the child expression.
19377
19378         (LValue): Add new method AddressOf to be used by
19379         the `&' operator.  
19380
19381         Change the argument of Store to take an EmitContext instead of an
19382         ILGenerator, because things like FieldExpr need to be able to call
19383         their children expression to generate the instance code. 
19384
19385         (Expression::Error, Expression::Warning): Sugar functions for
19386         reporting errors.
19387
19388         (Expression::MemberLookup): Accept a TypeContainer instead of a
19389         Report as the first argument.
19390
19391         (Expression::ResolvePrimary): Killed.  I still want to improve
19392         this as currently the code is just not right.
19393
19394         (Expression::ResolveMemberAccess): Simplify, but it is still
19395         wrong. 
19396
19397         (Unary::Resolve): Catch errors in AddressOf operators.
19398
19399         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19400         index to a byte for the short-version, or the compiler will choose
19401         the wrong Emit call, which generates the wrong data.
19402
19403         (ParameterReference::Emit, ::Store): same.
19404
19405         (FieldExpr::AddressOf): Implement.
19406
19407         * typemanager.cs: TypeManager: made public variable instead of
19408         property.
19409
19410         * driver.cs: document --fatal.
19411
19412         * report.cs (ErrorMessage, WarningMessage): new names for the old
19413         Error and Warning classes.
19414
19415         * cs-parser.jay (member_access): Turn built-in access to types
19416         into a normal simplename
19417
19418 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19419
19420         * expression.cs (Invocation::BetterConversion): Fix to cope
19421         with q being null, since this was introducing a bug.
19422
19423         * expression.cs (ConvertImplicit): Do built-in conversions first.
19424
19425 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19426
19427         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19428
19429 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19430
19431         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19432         I had introduced long ago (what's new ?).
19433
19434         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19435         the work of all the checking. 
19436         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19437         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19438
19439         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19440         that is the right way. 
19441
19442         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19443         overloading resolution. Use everywhere instead of cutting and pasting code.
19444
19445         (Binary::ResolveOperator): Use MakeUnionSet.
19446
19447         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19448         we have to convert to bool types. Not complete yet.
19449
19450 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19451
19452         * typemanager.cs (TypeManager::CSharpName): support ushort.
19453
19454         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19455         to provide an expression that performsn an implicit constant int
19456         conversion (section 6.1.6).
19457         (Expression::ConvertImplicitRequired): Reworked to include
19458         implicit constant expression conversions.
19459
19460         (Expression::ConvertNumericExplicit): Finished.
19461
19462         (Invocation::Emit): If InstanceExpression is null, then it means
19463         that we perform a call on this.
19464
19465 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19466
19467         * expression.cs (Unary::Emit): Remove some dead code.
19468         (Probe): Implement Resolve and Emit for `is'.
19469         (Expression::ConvertImplicitRequired): Attempt to do constant
19470         expression conversions here.  Maybe should be moved to
19471         ConvertImplicit, but I am not sure.
19472         (Expression::ImplicitLongConstantConversionPossible,
19473         Expression::ImplicitIntConstantConversionPossible): New functions
19474         that tell whether is it possible to apply an implicit constant
19475         expression conversion.
19476
19477         (ConvertNumericExplicit): Started work on explicit numeric
19478         conversions.
19479
19480         * cs-parser.jay: Update operator constants.
19481
19482         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19483         (Parameters::GetSignature): Hook up VerifyArgs here.
19484         (Parameters::VerifyArgs): Verifies that no two arguments have the
19485         same name. 
19486
19487         * class.cs (Operator): Update the operator names to reflect the
19488         ones that the spec expects (as we are just stringizing the
19489         operator names).
19490
19491         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19492         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19493         previous usage did only work for our methods.
19494         (Expression::ConvertImplicit): Handle decimal implicit numeric
19495         conversions as well.
19496         (Expression::InternalTypeConstructor): Used to invoke constructors
19497         on internal types for default promotions.
19498
19499         (Unary::Emit): Implement special handling for the pre/post
19500         increment/decrement for overloaded operators, as they need to have
19501         the same semantics as the other operators.
19502
19503         (Binary::ResolveOperator): ditto.
19504         (Invocation::ConversionExists): ditto.
19505         (UserImplicitCast::Resolve): ditto.
19506
19507 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19508
19509         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19510         operator, return after emitting body. Regression tests pass again !
19511
19512         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19513         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19514         (Invocation::OverloadResolve): Ditto.
19515         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19516
19517         * everywhere : update calls to the above methods accordingly.
19518
19519 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19520
19521         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19522
19523         * expression.cs (ExpressionStatement): New base class used for
19524         expressions that can appear in statements, so that we can provide
19525         an alternate path to generate expression that do not leave a value
19526         on the stack.
19527
19528         (Expression::Emit, and all the derivatives): We no longer return
19529         whether a value is left on the stack or not.  Every expression
19530         after being emitted leaves a single value on the stack.
19531
19532         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19533         facilties of ExpressionStatement if possible.
19534
19535         * cs-parser.jay: Update statement_expression.
19536
19537 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19538
19539         * driver.cs: Change the wording of message
19540
19541 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19542
19543         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19544         the type of the expression to the return type of the method if
19545         we have an overloaded operator match ! The regression tests pass again !
19546         (Unary::ResolveOperator): Ditto.
19547
19548         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19549         to find "op_Implicit", not "implicit" ;-)
19550         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19551         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19552
19553         * everywhere : Correct calls to the above accordingly.
19554
19555         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19556         (ConvertImplicit): Do user-defined conversion if it exists.
19557
19558 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19559
19560         * assign.cs: track location.
19561         (Resolve): Use implicit conversions on assignment.
19562
19563         * literal.cs: Oops.  Not good, Emit of short access values should
19564         pass (Bytes) or the wrong argument will be selected.
19565
19566         * expression.cs (Unary::Emit): Emit code for -expr.
19567
19568         (Unary::ResolveOperator): Handle `Substract' for non-constants
19569         (substract from zero from the non-constants).
19570         Deal with Doubles as well. 
19571
19572         (Expression::ConvertImplicitRequired): New routine that reports an
19573         error if no implicit conversion exists. 
19574
19575         (Invocation::OverloadResolve): Store the converted implicit
19576         expressions if we make them
19577
19578 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19579
19580         * class.cs (ConstructorInitializer): Take a Location argument.
19581         (ConstructorBaseInitializer): Same here.
19582         (ConstructorThisInitializer): Same here.
19583
19584         * cs-parser.jay : Update all calls accordingly.
19585
19586         * expression.cs (Unary, Binary, New): Take location argument.
19587         Update accordingly everywhere.
19588
19589         * cs-parser.jay : Update all calls to the above to take a location
19590         argument.
19591
19592         * class.cs : Ditto.
19593
19594 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19595
19596         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19597         (Invocation::BetterConversion): Same here
19598         (Invocation::ConversionExists): Ditto.
19599
19600         (Invocation::ConversionExists): Implement.
19601
19602 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19603
19604         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19605         Also take an additional TypeContainer argument.
19606
19607         * All over : Pass in TypeContainer as argument to OverloadResolve.
19608
19609         * typemanager.cs (CSharpName): Update to check for the string type and return
19610         that too.
19611
19612         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19613         a given method.
19614
19615 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19616
19617         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19618         (Invocation::BetterFunction): Implement.
19619         (Invocation::BetterConversion): Implement.
19620         (Invocation::ConversionExists): Skeleton, no implementation yet.
19621
19622         Okay, things work fine !
19623
19624 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19625
19626         * typemanager.cs: declare and load enum_type, delegate_type and
19627         void_type. 
19628
19629         * expression.cs (Expression::Emit): Now emit returns a value that
19630         tells whether a value is left on the stack or not.  This strategy
19631         might be reveted tomorrow with a mechanism that would address
19632         multiple assignments.
19633         (Expression::report118): Utility routine to report mismatches on
19634         the ExprClass.
19635
19636         (Unary::Report23): Report impossible type/operator combination
19637         utility function.
19638
19639         (Unary::IsIncrementableNumber): Whether the type can be
19640         incremented or decremented with add.
19641         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19642         complemented. 
19643         (Unary::ResolveOperator): Implement ++, !, ~,
19644
19645         (Invocation::Emit): Deal with new Emit convetion.
19646
19647         * All Expression derivatives: Updated their Emit method to return
19648         whether they leave values on the stack or not.
19649
19650         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19651         stack for expressions that are statements. 
19652
19653 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19654
19655         * expression.cs (LValue): New interface.  Must be implemented by
19656         LValue objects.
19657         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19658         LValue interface.
19659
19660         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19661         interface for generating code, simplifies the code.
19662
19663 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19664
19665         * expression.cs (everywhere): Comment out return statements in ::Resolve
19666         methods to avoid the warnings.
19667
19668 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19669
19670         * driver.cs (parse): Report error 2001 if we can not open the
19671         source file.
19672
19673         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19674         not resolve it.
19675
19676         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19677         object. 
19678
19679         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19680         otherwise nested blocks end up with the same index.
19681
19682         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19683
19684         * expression.cs:  Instead of having FIXMEs in the Resolve
19685         functions, throw exceptions so it is obvious that we are facing a
19686         bug. 
19687
19688         * cs-parser.jay (invocation_expression): Pass Location information.
19689
19690         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19691         Use a basename for those routines because .NET does not like paths
19692         on them. 
19693
19694         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19695         already defined.
19696
19697 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19698
19699         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19700         are loading the correct data types (throws an exception if not).
19701         (TypeManager::InitCoreTypes): Use CoreLookupType
19702
19703         * expression.cs (Unary::ResolveOperator): return the child
19704         expression for expressions which are just +expr.
19705         (Unary::ResolveOperator): Return negative literals for -LITERAL
19706         expressions (otherwise they are Unary {Literal}).
19707         (Invocation::Badness): Take into account `Implicit constant
19708         expression conversions'.
19709
19710         * literal.cs (LongLiteral): Implement long literal class.
19711         (IntLiteral): export the `Value' of the intliteral. 
19712
19713 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19714
19715         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19716
19717         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19718         instead of 'Operator'
19719
19720         * expression.cs (Binary::ResolveOperator): Update accordingly.
19721         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19722         and 'Minus'
19723
19724         * cs-parser.jay (unary_expression): Update to use the new names.
19725
19726         * gen-treedump.cs (GetUnary): Same here.
19727
19728         * expression.cs (Unary::Resolve): Implement.
19729         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19730         operators are found instead of making noise ;-)
19731         (Unary::ResolveOperator): New method to do precisely the same thing which
19732         Binary::ResolveOperator does for Binary expressions.
19733         (Unary.method, .Arguments): Add.
19734         (Unary::OperName): Implement.   
19735         (Unary::ForceConversion): Copy and Paste !
19736
19737         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19738         a unary operator.
19739
19740         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19741         for the inbuilt operators. Only overloading works for now ;-)
19742
19743 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19744
19745         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19746         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19747
19748         * expression.cs (This::Emit): Implement. 
19749         (This::Resolve): Implement.
19750         (TypeOf:Resolve): Implement.
19751         (Expression::ResolveSimpleName): Add an implicit this to instance
19752         field references. 
19753         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19754         Bind instance variable to Field expressions.
19755         (FieldExpr::Instance): New field used to track the expression that
19756         represents the object instance.
19757         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19758         binding 
19759         (FieldExpr::Emit): Implement.
19760
19761         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19762         the last instruction contains a return opcode to avoid generating
19763         the last `ret' instruction (this generates correct code, and it is
19764         nice to pass the peverify output).
19765
19766         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19767         initializer for static and instance variables.
19768         (Constructor::Emit): Allow initializer to be null in the case of
19769         static constructors.  Only emit initializer for instance
19770         constructors. 
19771
19772         (TypeContainer::FindMembers): Return a null array if there are no
19773         matches.
19774
19775         Also fix the code for the MemberTypes.Method branch, as it was not
19776         scanning that for operators (or tried to access null variables before).
19777
19778         * assign.cs (Assign::Emit): Handle instance and static fields. 
19779
19780         * TODO: Updated.
19781
19782         * driver.cs: Stop compilation if there are parse errors.
19783
19784         * cs-parser.jay (constructor_declaration): Provide default base
19785         initializer for non-static constructors.
19786         (constructor_declarator): Do not provide a default base
19787         initializers if none was specified.
19788         Catch the fact that constructors should not have parameters.
19789
19790         * class.cs: Do not emit parent class initializers for static
19791         constructors, that should be flagged as an error.
19792
19793 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19794
19795         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19796         Move back code into TypeContainer::Populate.
19797
19798 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19799
19800         * class.cs (TypeContainer::AddConstructor): Fix the check to
19801         compare against Name, not Basename. 
19802         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19803
19804         * cs-parser.jay : Update accordingly.
19805
19806         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19807         for methods, don't forget to look into the operators too.
19808         (RegisterMethodBuilder): Helper method to take care of this for
19809         methods, constructors and operators.
19810         (Operator::Define): Completely revamp.
19811         (Operator.OperatorMethod, MethodName): New fields.
19812         (TypeContainer::Populate): Move the registering of builders into
19813         RegisterMethodBuilder.
19814         (Operator::Emit): Re-write.
19815
19816         * expression.cs (Binary::Emit): Comment out code path to emit method
19817         invocation stuff for the case when we have a user defined operator. I am
19818         just not able to get it right !
19819
19820 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19821
19822         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19823         argument. 
19824
19825         (Expression::MemberLookup): Provide a version that allows to
19826         specify the MemberTypes and BindingFlags. 
19827
19828         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19829         so it was not fetching variable information from outer blocks.
19830
19831         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19832         Beforefieldinit as it was buggy.
19833
19834         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19835         that Ravi put here.  
19836
19837         * class.cs (Constructor::Emit): Only emit if block is not null.
19838         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19839         deal with this by semantically definining it as if the user had
19840         done it.
19841
19842         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19843         constructors as we now "emit" them at a higher level.
19844
19845         (TypeContainer::DefineDefaultConstructor): Used to define the
19846         default constructors if none was provided.
19847
19848         (ConstructorInitializer): Add methods Resolve and Emit. 
19849
19850         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19851
19852 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19853
19854         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19855         the default constructor builder with our hashtable for methodbuilders
19856         to methodcores.
19857
19858         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19859         and argument_count is 0 in which case we have a match.
19860         (Binary::ResolveOperator): More null checking and miscellaneous coding
19861         style cleanup.
19862
19863 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19864
19865         * rootcontext.cs (IsNameSpace): Compare against null.
19866
19867         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19868
19869         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19870         and Unary::Operator.
19871
19872         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19873         accordingly.
19874
19875         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19876         we have overloaded operators.
19877         (Binary::ResolveOperator): Implement the part which does the operator overload
19878         resolution.
19879
19880         * class.cs (Operator::Emit): Implement.
19881         (TypeContainer::Emit): Emit the operators we have too.
19882
19883         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19884         the case when we have a user-defined operator.
19885
19886 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19887
19888         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19889
19890 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19891
19892         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19893         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19894         (Constructor::Emit): Implement.
19895         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19896         if we have no work to do. 
19897         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19898         Emit method.
19899
19900         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19901         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19902
19903         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19904         of parent.parent.
19905
19906 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19907
19908         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19909         in the source.
19910         (Tree::RecordNamespace): Method to do what the name says ;-)
19911         (Tree::Namespaces): Property to get at the namespaces hashtable.
19912
19913         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19914         keep track.
19915
19916         * rootcontext.cs (IsNamespace): Fixed it :-)
19917
19918 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19919
19920         * class.cs (TypeContainer::FindMembers): Add support for
19921         constructors. 
19922         (MethodCore): New class that encapsulates both the shared aspects
19923         of a Constructor and a Method.  
19924         (Method, Constructor): Factored pieces into MethodCore.
19925
19926         * driver.cs: Added --fatal which makes errors throw exceptions.
19927         Load System assembly as well as part of the standard library.
19928
19929         * report.cs: Allow throwing exceptions on errors for debugging.
19930
19931         * modifiers.cs: Do not use `parent', instead use the real type
19932         container to evaluate permission settings.
19933
19934         * class.cs: Put Ravi's patch back in.  He is right, and we will
19935         have to cope with the
19936
19937 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19938
19939         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19940         FamORAssem, not FamANDAssem.
19941
19942 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19943
19944         * driver.cs: Added --parse option that only parses its input files
19945         and terminates.
19946
19947         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19948         incorrect.  IsTopLevel is not used to tell whether an object is
19949         root_types or not (that can be achieved by testing this ==
19950         root_types).  But to see if this is a top-level *class* (not
19951         necessarly our "toplevel" container). 
19952
19953 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19954
19955         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19956         parent instead of a direct call to GetType.
19957
19958 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19959
19960         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19961         Modifiers.TypeAttr. This should just be a call to that method.
19962
19963         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19964         object so that we can determine if we are top-level or not.
19965
19966         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19967         TypeContainer too.
19968
19969         * enum.cs (Enum::Define): Ditto.
19970
19971         * modifiers.cs (FieldAttr): Re-write.
19972
19973         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19974         (TypeContainer::HaveStaticConstructor): New property to provide access
19975         to precisely that info.
19976
19977         * modifiers.cs (MethodAttr): Re-write.
19978         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19979
19980         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19981         of top-level types as claimed.
19982
19983 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19984
19985         * expression.cs (MemberLookup): Fruitless attempt to lookup
19986         constructors.  Maybe I need to emit default constructors?  That
19987         might be it (currently .NET emits this for me automatically).
19988         (Invocation::OverloadResolve): Cope with Arguments == null.
19989         (Invocation::EmitArguments): new function, shared by the new
19990         constructor and us.
19991         (Invocation::Emit): Handle static and instance methods.  Emit
19992         proper call instruction for virtual or non-virtual invocations.
19993         (New::Emit): Implement.
19994         (New::Resolve): Implement.
19995         (MemberAccess:Resolve): Implement.
19996         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19997         to track instances.
19998         (FieldExpr::Resolve): Set type.
19999
20000         * support.cs: Handle empty arguments.
20001                 
20002         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20003         SimpleLookup): Auxiliary routines to help parse a qualifier
20004         identifier.  
20005
20006         Update qualifier_identifier rule.
20007
20008         * codegen.cs: Removed debugging messages.
20009
20010         * class.cs: Make this a global thing, this acts just as a "key" to
20011         objects that we might have around.
20012
20013         (Populate): Only initialize method_builders_to_methods once.
20014
20015         * expression.cs (PropertyExpr): Initialize type from the
20016         PropertyType. 
20017
20018         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20019         Resolve pattern.  Attempt to implicitly convert value to boolean.
20020         Emit code.
20021
20022         * expression.cs: Set the type for the int32/int32 argument case.
20023         (Binary::ResolveOperator): Set the return type to boolean for
20024         comparission operators
20025
20026         * typemanager.cs: Remove debugging print code.
20027
20028         (Invocation::Resolve): resolve type.
20029
20030         * class.cs: Allocate a MemberInfo of the correct size, as the code
20031         elsewhere depends on the test to reflect the correct contents.
20032
20033         (Method::) Keep track of parameters, due to System.Reflection holes
20034
20035         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20036         mapping here.
20037
20038         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20039         of the exact size and return that.
20040
20041         (Class::LookupMethodByBuilder): New function that maps
20042         MethodBuilders to its methods.  Required to locate the information
20043         on methods because System.Reflection bit us again.
20044
20045         * support.cs: New file, contains an interface ParameterData and
20046         two implementations: ReflectionParameters and InternalParameters
20047         used to access Parameter information.  We will need to grow this
20048         as required.
20049
20050         * expression.cs (Invocation::GetParameterData): implement a cache
20051         and a wrapper around the ParameterData creation for methods. 
20052         (Invocation::OverloadResolve): Use new code.
20053
20054 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20055
20056         * class.cs (TypeContainer::EmitField): Remove and move into 
20057         (Field::Define): here and modify accordingly.
20058         (Field.FieldBuilder): New member.
20059         (TypeContainer::Populate): Update accordingly.
20060         (TypeContainer::FindMembers): Implement.
20061
20062 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20063
20064         * statement.cs: (VariableInfo::VariableType): New field to be
20065         initialized with the full type once it is resolved. 
20066
20067 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20068
20069         * parameter.cs (GetParameterInfo): Use a type cache to compute
20070         things only once, and to reuse this information
20071
20072         * expression.cs (LocalVariableReference::Emit): Implement.
20073         (OpcodeCast::Emit): fix.
20074
20075         (ParameterReference::Resolve): Implement.
20076         (ParameterReference::Emit): Implement.
20077
20078         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20079         that are expressions need to stay as Expressions.
20080
20081         * typemanager.cs (CSharpName): Returns the C# name of a type if
20082         possible. 
20083
20084         * expression.cs (Expression::ConvertImplicit): New function that
20085         implements implicit type conversions.
20086
20087         (Expression::ImplicitReferenceConversion): Implements implicit
20088         reference conversions.
20089
20090         (EmptyCast): New type for transparent casts.
20091
20092         (OpcodeCast): New type for casts of types that are performed with
20093         a sequence of bytecodes.
20094
20095         (BoxedCast): New type used for casting value types into reference
20096         types.  Emits a box opcode.
20097
20098         (Binary::DoNumericPromotions): Implements numeric promotions of
20099         and computation of the Binary::Type.
20100
20101         (Binary::EmitBranchable): Optimization.
20102
20103         (Binary::Emit): Implement code emission for expressions.
20104
20105         * typemanager.cs (TypeManager): Added two new core types: sbyte
20106         and byte.
20107
20108 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20109
20110         * class.cs (TypeContainer::FindMembers): Method which does exactly
20111         what Type.FindMembers does, only we don't have to use reflection. No
20112         implementation yet.
20113
20114         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20115         typecontainer objects as we need to get at them.
20116         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20117
20118         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20119         typecontainer object.
20120
20121         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20122         of just a Report object.
20123
20124 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20125
20126         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20127         "remove_"
20128         (TypeContainer::Populate): Now define the delegates of the type too.
20129         (TypeContainer.Delegates): Property to access the list of delegates defined
20130         in the type.
20131
20132         * delegates.cs (Delegate::Define): Implement partially.
20133
20134         * modifiers.cs (TypeAttr): Handle more flags.
20135
20136 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20137
20138         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20139         and not <=
20140         (Operator::Define): Re-write logic to get types by using the LookupType method
20141         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20142         (Indexer::Define): Ditto.
20143         (Event::Define): Ditto.
20144         (Property::Define): Ditto.
20145
20146 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20147
20148         * class.cs (TypeContainer::Populate): Now define operators too. 
20149         (TypeContainer.Operators): New property to access the list of operators
20150         in a type.
20151         (Operator.OperatorMethodBuilder): New member to hold the method builder
20152         for the operator we are defining.
20153         (Operator::Define): Implement.
20154
20155 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20156
20157         * class.cs (Event::Define): Make the prefixes of the accessor methods
20158         addOn_ and removeOn_ 
20159
20160         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20161         of the location being passed in too. Ideally, this should go later since all
20162         error reporting should be done through the Report object.
20163
20164         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20165         (Populate): Iterate thru the indexers we have and define them too.
20166         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20167         for the get and set accessors.
20168         (Indexer::Define): Implement.
20169
20170 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20171
20172         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20173         my previous implementation, did not work.
20174
20175         * typemanager.cs: Add a couple of missing types (the longs).
20176
20177         * literal.cs: Use TypeManager.bool_type instead of getting it.
20178
20179         * expression.cs (EventExpr): New kind of expressions.
20180         (Expressio::ExprClassFromMemberInfo): finish
20181
20182 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20183
20184         * assign.cs: Emit stores to static fields differently.
20185
20186 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20187
20188         * Merge in changes and adjust code to tackle conflicts. Backed out my
20189         code in Assign::Resolve ;-) 
20190
20191 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20192
20193         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20194         instead Report.Error and also pass in the location.
20195         (CSharpParser::Lexer): New readonly property to return the reference
20196         to the Tokenizer object.
20197         (declare_local_variables): Use Report.Error with location instead of plain 
20198         old error.
20199         (CheckDef): Ditto.
20200
20201         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20202         (Operator.CheckBinaryOperator): Ditto.
20203
20204         * cs-parser.jay (operator_declarator): Update accordingly.
20205
20206         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20207         (CheckBinaryOperator): Same here.
20208
20209         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20210         on the name without any prefixes of namespace names etc. This is because we
20211         already might have something already fully qualified like 
20212         'System.Console.WriteLine'
20213
20214         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20215
20216 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20217
20218         * cs-tokenizer.cs (location): Return a string which also contains
20219         the file name.
20220
20221         * expression.cs (ElementAccess): New class for expressions of the
20222         type 'element access.'
20223         (BaseAccess): New class for expressions of the type 'base access.'
20224         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20225         respectively.
20226
20227         * cs-parser.jay (element_access): Implement action.
20228         (base_access): Implement actions.
20229         (checked_expression, unchecked_expression): Implement.
20230
20231         * cs-parser.jay (local_variable_type): Correct and implement.
20232         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20233
20234         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20235
20236         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20237         name and the specifiers.
20238
20239         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20240
20241         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20242         making them all public ;-)
20243
20244         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20245         class anyways.
20246
20247 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20248
20249         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20250         PropertyExprs.
20251         (FieldExpr, PropertyExprs): New resolved expressions.
20252         (SimpleName::MemberStaticCheck): Perform static checks for access
20253         to non-static fields on static methods. Maybe this should be
20254         generalized for MemberAccesses. 
20255         (SimpleName::ResolveSimpleName): More work on simple name
20256         resolution. 
20257
20258         * cs-parser.jay (primary_expression/qualified_identifier): track
20259         the parameter index.
20260
20261         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20262         (EmitContext::EmitBoolExpression): Chain to expression generation
20263         instead of temporary hack.
20264         (::EmitStatementExpression): Put generic expression code generation.
20265
20266         * assign.cs (Assign::Emit): Implement variable assignments to
20267         local variables, parameters and fields.
20268
20269 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20270
20271         * statement.cs (Block::GetVariableInfo): New method, returns the
20272         VariableInfo for a variable name in a block.
20273         (Block::GetVariableType): Implement in terms of GetVariableInfo
20274
20275         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20276         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20277
20278 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20279
20280         * cs-parser.jay (operator_declaration): Continue on my quest : update
20281         to take attributes argument.
20282         (event_declaration): Ditto.
20283         (enum_declaration): Ditto.
20284         (indexer_declaration): Ditto.
20285
20286         * class.cs (Operator::Operator): Update constructor accordingly.
20287         (Event::Event): Ditto.
20288
20289         * delegate.cs (Delegate::Delegate): Same here.
20290
20291         * enum.cs (Enum::Enum): Same here.
20292
20293 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20294
20295         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20296
20297         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20298
20299         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20300         being passed around as an arraylist.
20301         (Attributes::AddAttribute): Method to add attribute sections.
20302
20303         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20304         (struct_declaration): Update accordingly.
20305         (constant_declaration): Update.
20306         (field_declaration): Update.
20307         (method_header): Update.
20308         (fixed_parameter): Update.
20309         (parameter_array): Ditto.
20310         (property_declaration): Ditto.
20311         (destructor_declaration): Ditto.
20312
20313         * class.cs (Struct::Struct): Update constructors accordingly.
20314         (Class::Class): Ditto.
20315         (Field::Field): Ditto.
20316         (Method::Method): Ditto.
20317         (Property::Property): Ditto.
20318         (TypeContainer::OptAttribute): update property's return type.
20319
20320         * interface.cs (Interface.opt_attributes): New member.
20321         (Interface::Interface): Update to take the extra Attributes argument.
20322
20323         * parameter.cs (Parameter::Parameter): Ditto.
20324
20325         * constant.cs (Constant::Constant): Ditto.
20326
20327         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20328         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20329         the attributes as a parameter.
20330         (InterfaceProperty): Update constructor call.
20331         (InterfaceEvent): Ditto.
20332         (InterfaceMethod): Ditto.
20333         (InterfaceIndexer): Ditto.
20334
20335         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20336         pass the attributes too.
20337         (interface_event_declaration): Ditto.
20338         (interface_property_declaration): Ditto.
20339         (interface_method_declaration): Ditto.
20340         (interface_declaration): Ditto.
20341
20342 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20343
20344         * class.cs (Method::Define): Track the "static Main" definition to
20345         create an entry point. 
20346
20347         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20348         EntryPoint if we find it. 
20349
20350         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20351         (EmitContext::ig): Make this variable public.
20352
20353         * driver.cs: Make the default output file be the first file name
20354         with the .exe extension.  
20355
20356         Detect empty compilations
20357
20358         Handle various kinds of output targets.  Handle --target and
20359         rename -t to --dumper.
20360
20361         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20362         methods inherited from Expression return now an Expression.  This
20363         will is used during the tree rewriting as we resolve them during
20364         semantic analysis.
20365
20366         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20367         the spec.  Missing entirely is the information about
20368         accessability of elements of it.
20369
20370         (Expression::ExprClassFromMemberInfo): New constructor for
20371         Expressions that creates a fully initialized Expression based on
20372         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20373         a Type.
20374
20375         (Invocation::Resolve): Begin implementing resolution of invocations.
20376
20377         * literal.cs (StringLiteral):  Implement Emit.
20378
20379 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20380
20381         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20382         member.
20383
20384 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20385
20386         * cs-parser.jay (attribute_arguments): Implement actions.
20387         (attribute): Fix bug in production. Implement action.
20388         (attribute_list): Implement.
20389         (attribute_target): Implement.
20390         (attribute_target_specifier, opt_target_specifier): Implement
20391         (CheckAttributeTarget): New method to check if the attribute target
20392         is valid.
20393         (attribute_section): Implement.
20394         (opt_attributes): Implement.
20395
20396         * attribute.cs : New file to handle attributes.
20397         (Attribute): Class to hold attribute info.
20398
20399         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20400         (attribute_section): Modify production to use 2 different rules to 
20401         achieve the same thing. 1 s/r conflict down !
20402         Clean out commented, useless, non-reducing dimension_separator rules.
20403
20404         * class.cs (TypeContainer.attributes): New member to hold list
20405         of attributes for a type.
20406         (Struct::Struct): Modify to take one more argument, the attribute list.
20407         (Class::Class): Ditto.
20408         (Field::Field): Ditto.
20409         (Method::Method): Ditto.
20410         (Property::Property): Ditto.
20411
20412         * cs-parser.jay (struct_declaration): Update constructor call to
20413         pass in the attributes too.
20414         (class_declaration): Ditto.
20415         (constant_declaration): Ditto.
20416         (field_declaration): Ditto.
20417         (method_header): Ditto.
20418         (fixed_parameter): Ditto.
20419         (parameter_array): Ditto.
20420         (property_declaration): Ditto.
20421
20422         * constant.cs (Constant::Constant): Update constructor similarly.
20423         Use System.Collections.
20424
20425         * parameter.cs (Parameter::Parameter): Update as above.
20426
20427 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20428
20429         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20430         (TypeContainer.delegates): New member to hold list of delegates.
20431
20432         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20433         this time as I seem to be on crack ;-)
20434
20435 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20436
20437         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20438         tell whether an identifier represents a namespace.
20439
20440         * expression.cs (NamespaceExpr): A namespace expression, used only
20441         temporarly during expression resolution.
20442         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20443         utility functions to resolve names on expressions.
20444
20445 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20446
20447         * codegen.cs: Add hook for StatementExpressions. 
20448
20449         * class.cs: Fix inverted test for static flag in methods.
20450
20451 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20452
20453         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20454         to make it coincide with MS' number.
20455         (Operator::CheckBinaryOperator): Ditto.
20456
20457         * ../errors/errors.txt : Remove error numbers added earlier.
20458
20459         * ../errors/cs1019.cs : Test case for error # 1019
20460
20461         * ../errros/cs1020.cs : Test case for error # 1020
20462
20463         * cs-parser.jay : Clean out commented cruft.
20464         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20465         used anywhere - non-reducing rule.
20466         (namespace_declarations): Non-reducing rule - comment out.
20467
20468         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20469         with TypeContainer::AddEnum.
20470
20471         * delegate.cs : New file for delegate handling classes.
20472         (Delegate): Class for declaring delegates.
20473
20474         * makefile : Update.
20475
20476         * cs-parser.jay (delegate_declaration): Implement.
20477
20478 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20479
20480         * class.cs (Event::Define): Implement.
20481         (Event.EventBuilder): New member.
20482
20483         * class.cs (TypeContainer::Populate): Update to define all enums and events
20484         we have.
20485         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20486         readonly fields for all these cases ?
20487
20488 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20489
20490         * class.cs (Property): Revamp to use the convention of making fields readonly.
20491         Accordingly modify code elsewhere.
20492
20493         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20494         the Define method of the Property class.
20495
20496         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20497         trivial bug.
20498         (TypeContainer::Populate): Update to define all the properties we have. Also
20499         define all enumerations.
20500
20501         * enum.cs (Define): Implement.
20502
20503 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20504
20505         * cs-parser.jay (overloadable_operator): The semantic value is an
20506         enum of the Operator class.
20507         (operator_declarator): Implement actions.
20508         (operator_declaration): Implement.
20509
20510         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20511         validity of definitions.
20512         (Operator::CheckBinaryOperator): Static method to check for binary operators
20513         (TypeContainer::AddOperator): New method to add an operator to a type.
20514
20515         * cs-parser.jay (indexer_declaration): Added line to actually call the
20516         AddIndexer method so it gets added ;-)
20517
20518         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20519         already taken care of by the MS compiler ?  
20520
20521 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20522
20523         * class.cs (Operator): New class for operator declarations.
20524         (Operator::OpType): Enum for the various operators.
20525
20526 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20527
20528         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20529         ostensibly handle this in semantic analysis.
20530
20531         * cs-parser.jay (general_catch_clause): Comment out
20532         (specific_catch_clauses, specific_catch_clause): Ditto.
20533         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20534         (catch_args, opt_catch_args): New productions.
20535         (catch_clause): Rewrite to use the new productions above
20536         (catch_clauses): Modify accordingly.
20537         (opt_catch_clauses): New production to use in try_statement
20538         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20539         and re-write the code in the actions to extract the specific and
20540         general catch clauses by being a little smart ;-)
20541
20542         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20543         Hooray, try and catch statements parse fine !
20544
20545 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20546
20547         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20548         string from the hashtable of variables.
20549
20550         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20551         I end up making that mistake ;-)
20552         (catch_clauses): Fixed gross error which made Key and Value of the 
20553         DictionaryEntry the same : $1 !!
20554
20555 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20556
20557         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20558
20559         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20560         when the add and remove accessors are specified. 
20561
20562 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20563
20564         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20565         information about indexer_declarator.
20566         (indexer_declarator): Implement actions.
20567         (parsing_indexer): New local boolean used to keep track of whether
20568         we are parsing indexers or properties. This is necessary because 
20569         implicit_parameters come into picture even for the get accessor in the 
20570         case of an indexer.
20571         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20572
20573         * class.cs (Indexer): New class for indexer declarations.
20574         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20575         (TypeContainer::indexers): New member to hold list of indexers for the
20576         type.
20577
20578 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20579
20580         * cs-parser.jay (add_accessor_declaration): Implement action.
20581         (remove_accessor_declaration): Implement action.
20582         (event_accessors_declaration): Implement
20583         (variable_declarators): swap statements for first rule - trivial.
20584
20585         * class.cs (Event): New class to hold information about event
20586         declarations.
20587         (TypeContainer::AddEvent): New method to add an event to a type
20588         (TypeContainer::events): New member to hold list of events.
20589
20590         * cs-parser.jay (event_declaration): Implement actions.
20591
20592 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20593
20594         * cs-parser.jay (dim_separators): Implement. Make it a string
20595         concatenating all the commas together, just as they appear.
20596         (opt_dim_separators): Modify accordingly
20597         (rank_specifiers): Update accordingly. Basically do the same
20598         thing - instead, collect the brackets here.
20599         (opt_rank_sepcifiers): Modify accordingly.
20600         (array_type): Modify to actually return the complete type string
20601         instead of ignoring the rank_specifiers.
20602         (expression_list): Implement to collect the expressions
20603         (variable_initializer): Implement. We make it a list of expressions
20604         essentially so that we can handle the array_initializer case neatly too.
20605         (variable_initializer_list): Implement.
20606         (array_initializer): Make it a list of variable_initializers
20607         (opt_array_initializer): Modify accordingly.
20608
20609         * expression.cs (New::NType): Add enumeration to help us
20610         keep track of whether we have an object/delegate creation
20611         or an array creation.
20612         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20613         members to hold data about array creation.
20614         (New:New): Modify to update NewType
20615         (New:New): New Overloaded contructor for the array creation
20616         case.
20617
20618         * cs-parser.jay (array_creation_expression): Implement to call
20619         the overloaded New constructor.
20620
20621 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20622
20623         * class.cs (TypeContainer::Constructors): Return member
20624         constructors instead of returning null.
20625
20626 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20627
20628         * typemanager.cs (InitCoreTypes): Initialize the various core
20629         types after we have populated the type manager with the user
20630         defined types (this distinction will be important later while
20631         compiling corlib.dll)
20632
20633         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20634         on Expression Classification.  Now all expressions have a method
20635         `Resolve' and a method `Emit'.
20636
20637         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20638         generation from working.     Also add some temporary debugging
20639         code. 
20640
20641 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20642
20643         * codegen.cs: Lots of code generation pieces.  This is only the
20644         beginning, will continue tomorrow with more touches of polish.  We
20645         handle the fundamentals of if, while, do, for, return.  Others are
20646         trickier and I need to start working on invocations soon.
20647
20648         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20649         s.InitStatement. 
20650
20651         * codegen.cs (EmitContext): New struct, used during code
20652         emission to keep a context.   Most of the code generation will be
20653         here. 
20654
20655         * cs-parser.jay: Add embedded blocks to the list of statements of
20656         this block.  So code generation proceeds in a top down fashion.
20657
20658 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20659
20660         * statement.cs: Add support for multiple child blocks.
20661
20662 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20663
20664         * codegen.cs (EmitCode): New function, will emit the code for a
20665         Block of code given a TypeContainer and its ILGenerator. 
20666
20667         * statement.cs (Block): Standard public readonly optimization.
20668         (Block::Block constructors): Link children. 
20669         (Block::Child): Child Linker.
20670         (Block::EmitVariables): Emits IL variable declarations.
20671
20672         * class.cs: Drop support for MethodGroups here, delay until
20673         Semantic Analysis.
20674         (Method::): Applied the same simplification that I did before, and
20675         move from Properties to public readonly fields.
20676         (Method::ParameterTypes): Returns the parameter types for the
20677         function, and implements a cache that will be useful later when I
20678         do error checking and the semantic analysis on the methods is
20679         performed.
20680         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20681         and made a method, optional argument tells whether this is a class
20682         or a structure to apply the `has-this' bit.
20683         (Method::GetCallingConvention): Implement, returns the calling
20684         convention. 
20685         (Method::Define): Defines the type, a second pass is performed
20686         later to populate the methods.
20687
20688         (Constructor::ParameterTypes): implement a cache similar to the
20689         one on Method::ParameterTypes, useful later when we do semantic
20690         analysis. 
20691
20692         (TypeContainer::EmitMethod):  New method.  Emits methods.
20693
20694         * expression.cs: Removed MethodGroup class from here.
20695
20696         * parameter.cs (Parameters::GetCallingConvention): new method.
20697
20698 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20699
20700         * class.cs (TypeContainer::Populate): Drop RootContext from the
20701         argument. 
20702
20703         (Constructor::CallingConvention): Returns the calling convention.
20704         (Constructor::ParameterTypes): Returns the constructor parameter
20705         types. 
20706
20707         (TypeContainer::AddConstructor): Keep track of default constructor
20708         and the default static constructor.
20709
20710         (Constructor::) Another class that starts using `public readonly'
20711         instead of properties. 
20712
20713         (Constructor::IsDefault): Whether this is a default constructor. 
20714
20715         (Field::) use readonly public fields instead of properties also.
20716
20717         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20718         track of static constructors;  If none is used, turn on
20719         BeforeFieldInit in the TypeAttributes. 
20720
20721         * cs-parser.jay (opt_argument_list): now the return can be null
20722         for the cases where there are no arguments. 
20723
20724         (constructor_declarator): If there is no implicit `base' or
20725         `this', then invoke the default parent constructor. 
20726
20727         * modifiers.cs (MethodAttr): New static function maps a set of
20728         modifiers flags into a MethodAttributes enum
20729         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20730         MethodAttr, TypeAttr to represent the various mappings where the
20731         modifiers are used.
20732         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20733
20734 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20735
20736         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20737         method arguments.
20738
20739         * interface.cs (PopulateIndexer): Implemented the code generator
20740         for interface indexers.
20741
20742 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20743
20744         * interface.cs (InterfaceMemberBase): Now we track the new status
20745         here.  
20746
20747         (PopulateProperty): Implement property population.  Woohoo!  Got
20748         Methods and Properties going today. 
20749
20750         Removed all the properties for interfaces, and replaced them with
20751         `public readonly' fields. 
20752
20753 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20754
20755         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20756         initialize their hashtables/arraylists only when they are needed
20757         instead of doing this always.
20758
20759         * parameter.cs: Handle refs and out parameters.
20760
20761         * cs-parser.jay: Use an ArrayList to construct the arguments
20762         instead of the ParameterCollection, and then cast that to a
20763         Parameter[] array.
20764
20765         * parameter.cs: Drop the use of ParameterCollection and use
20766         instead arrays of Parameters.
20767
20768         (GetParameterInfo): Use the Type, not the Name when resolving
20769         types. 
20770
20771 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20772
20773         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20774         and instead use public readonly fields.
20775
20776         * class.cs: Put back walking code for type containers.
20777
20778 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20779
20780         * class.cs (MakeConstant): Code to define constants.
20781
20782         * rootcontext.cs (LookupType): New function.  Used to locate types 
20783
20784
20785 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20786
20787         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20788         this System.Reflection code is.  Kudos to Microsoft
20789
20790         * typemanager.cs: Implement a type cache and avoid loading all
20791         types at boot time.  Wrap in LookupType the internals.  This made
20792         the compiler so much faster.  Wow.  I rule!
20793
20794         * driver.cs: Make sure we always load mscorlib first (for
20795         debugging purposes, nothing really important).
20796
20797         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20798         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20799
20800         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20801         on namespaces that have been imported using the `using' keyword.
20802
20803         * class.cs (TypeContainer::TypeAttr): Virtualize.
20804         (Class::TypeAttr): Return attributes suitable for this bad boy.
20805         (Struct::TypeAttr): ditto.
20806         Handle nested classes.
20807         (TypeContainer::) Remove all the type visiting code, it is now
20808         replaced with the rootcontext.cs code
20809
20810         * rootcontext.cs (GetClassBases): Added support for structs. 
20811
20812 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20813
20814         * interface.cs, statement.cs, class.cs, parameter.cs,
20815         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20816         Drop use of TypeRefs, and use strings instead.
20817
20818 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20819
20820         * rootcontext.cs: 
20821
20822         * class.cs (Struct::Struct): set the SEALED flags after
20823         checking the modifiers.
20824         (TypeContainer::TypeAttr): new property, returns the
20825         TypeAttributes for a class.  
20826
20827         * cs-parser.jay (type_list): Oops, list production was creating a
20828         new list of base types.
20829
20830         * rootcontext.cs (StdLib): New property.
20831         (GetInterfaceTypeByName): returns an interface by type name, and
20832         encapsulates error handling here.
20833         (GetInterfaces): simplified.
20834         (ResolveTree): Encapsulated all the tree resolution here.
20835         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20836         types. 
20837
20838         * driver.cs: Add support for --nostdlib, to avoid loading the
20839         default assemblies.
20840         (Main): Do not put tree resolution here. 
20841
20842         * rootcontext.cs: Beginning of the class resolution.
20843
20844 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20845
20846         * rootcontext.cs: Provide better error reporting. 
20847
20848         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20849
20850         * rootcontext.cs (CreateInterface): Handle the case where there
20851         are no parent interfaces.
20852
20853         (CloseTypes): Routine to flush types at the end.
20854         (CreateInterface): Track types.
20855         (GetInterfaces): Returns an array of Types from the list of
20856         defined interfaces.
20857
20858         * typemanager.c (AddUserType): Mechanism to track user types (puts
20859         the type on the global type hash, and allows us to close it at the
20860         end). 
20861
20862 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20863
20864         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20865         RecordInterface instead.
20866
20867         * cs-parser.jay: Updated to reflect changes above.
20868
20869         * decl.cs (Definition): Keep track of the TypeBuilder type that
20870         represents this type here.  Not sure we will use it in the long
20871         run, but wont hurt for now.
20872
20873         * driver.cs: Smaller changes to accomodate the new code.
20874
20875         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20876         when done. 
20877
20878         * rootcontext.cs (CreateInterface):  New method, used to create
20879         the System.TypeBuilder type for interfaces.
20880         (ResolveInterfaces): new entry point to resolve the interface
20881         hierarchy. 
20882         (CodeGen): Property, used to keep track of the code generator.
20883
20884 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20885
20886         * cs-parser.jay: Add a second production for delegate_declaration
20887         with `VOID'.
20888
20889         (enum_body): Put an opt_comma here instead of putting it on
20890         enum_body or enum_member_declarations so we can handle trailing
20891         commas on enumeration members.  Gets rid of a shift/reduce.
20892
20893         (type_list): Need a COMMA in the middle.
20894
20895         (indexer_declaration): Tell tokenizer to recognize get/set
20896
20897         * Remove old targets.
20898
20899         * Re-add the parser target.
20900
20901 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20902
20903         * cs-parser.jay: Add precendence rules for a number of operators
20904         ot reduce the number of shift/reduce conflicts in the grammar.
20905
20906 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20907
20908         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20909         and put it here.
20910
20911         Get rid of old crufty code.
20912
20913         * rootcontext.cs: Use this to keep track of the parsed
20914         representation and the defined types available to the program. 
20915
20916         * gen-treedump.cs: adjust for new convention.
20917
20918         * type.cs: Split out the type manager, and the assembly builder
20919         from here. 
20920
20921         * typemanager.cs: the type manager will live here now.
20922
20923         * cil-codegen.cs: And the code generator here. 
20924
20925 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20926
20927         * makefile: Fixed up for easy making.
20928
20929 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20930
20931         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20932         the 
20933
20934         (unary_expression): Expand pre_increment_expression and
20935         post_decrement_expression to reduce a shift/reduce.
20936
20937 2001-07-11  Simon Cozens
20938
20939         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20940
20941         Improve allow_keyword_as_indent name.
20942
20943 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20944
20945         * Adjustments for Beta2. 
20946
20947 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20948
20949         * decl.cs: Added `Define' abstract method.
20950         (InTransit): new property, used to catch recursive definitions. 
20951
20952         * interface.cs: Implement `Define'. 
20953
20954         * modifiers.cs: Map Modifiers.constants to
20955         System.Reflection.TypeAttribute flags.
20956
20957         * class.cs: Keep track of types and user-defined types.
20958         (BuilderInit): New method for creating an assembly
20959         (ResolveType): New function to launch the resolution process, only
20960         used by interfaces for now.
20961
20962         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20963         that are inserted into the name space. 
20964
20965 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20966
20967         * ARGH.  I have screwed up my tree so many times due to the use of
20968         rsync rather than using CVS.  Going to fix this at once. 
20969
20970         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20971         load types.
20972
20973 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20974
20975         * Experiment successful: Use System.Type rather that our own
20976         version of Type.  
20977
20978 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20979
20980         * cs-parser.jay: Removed nsAliases from here.
20981
20982         Use new namespaces, handle `using XXX;' 
20983
20984         * namespace.cs: Reimplemented namespace handling, use a recursive
20985         definition of the class.  Now we can keep track of using clauses
20986         and catch invalid using clauses.
20987
20988 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20989
20990         * gen-treedump.cs: Adapted for all the renaming.
20991
20992         * expression.cs (Expression): this class now has a Type property
20993         which returns an expression Type.
20994
20995         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20996         `Type', as this has a different meaning now in the base
20997
20998 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20999
21000         * interface.cs, class.cs: Removed from all the sources the
21001         references to signature computation, as we can not do method
21002         signature computation during the parsing time, as we are not
21003         trying to solve at that point distinguishing:
21004
21005         class X {
21006                 void a (Blah x) {}
21007                 void a (NS.Blah x) {}
21008         }
21009
21010         Which depending on the context might be valid or not, as we do not
21011         know if Blah is the same thing as NS.Blah at that point.
21012
21013         * Redid everything so the code uses TypeRefs now instead of
21014         Types.  TypeRefs are just temporary type placeholders, that need
21015         to be resolved.  They initially have a pointer to a string and the
21016         current scope in which they are used.  This is used later by the
21017         compiler to resolve the reference to an actual Type. 
21018
21019         * DeclSpace is no longer a CIR.Type, and neither are
21020         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21021         are all DeclSpaces, but no Types. 
21022
21023         * type.cs (TypeRefManager): This implements the TypeRef manager,
21024         which keeps track of all the types that need to be resolved after
21025         the parsing has finished. 
21026
21027 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21028
21029         * ARGH.  We are going to have to store `foreach' as a class rather
21030         than resolving it, as we need to verify error 1579 after name
21031         resolution.   *OR* we could keep a flag that says `This request to
21032         IEnumerator comes from a foreach statement' which we can then use
21033         to generate the error.
21034
21035 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21036
21037         * class.cs (TypeContainer.AddMethod): we now add methods to the
21038         MethodGroup instead of the method hashtable.  
21039
21040         * expression.cs: Add MethodGroup abstraction, which gets us one
21041         step closer to the specification in the way we handle method
21042         declarations.  
21043
21044         * cs-parser.jay (primary_expression): qualified_identifier now
21045         tried to match up an identifier to a local variable reference or
21046         to a parameter reference.
21047
21048         current_local_parameters is now a parser global variable that
21049         points to the current parameters for the block, used during name
21050         lookup.
21051
21052         (property_declaration): Now creates an implicit `value' argument to
21053         the set accessor.
21054
21055 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21056
21057         * parameter.cs: Do not use `param' arguments as part of the
21058         signature, per the spec.
21059
21060 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21061
21062         * decl.cs: Base class for classes, structs and interfaces.  This
21063         is the "Declaration Space" 
21064
21065         * cs-parser.jay: Use CheckDef for checking declaration errors
21066         instead of having one on each function.
21067
21068         * class.cs: Factor out some code for handling error handling in
21069         accordance to the "Declarations" section in the "Basic Concepts"
21070         chapter in the ECMA C# spec.
21071
21072         * interface.cs: Make all interface member classes derive from
21073         InterfaceMemberBase.
21074
21075 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21076
21077         * Many things: all interfaces are parsed and generated in
21078         gen-treedump.  Support for member variables, constructors,
21079         destructors, properties, constants is there.
21080
21081         Beginning of the IL backend, but very little done, just there for
21082         testing purposes. 
21083
21084 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21085
21086         * cs-parser.jay: Fix labeled statement.
21087
21088         * cs-tokenizer.cs (escape): Escape " and ' always.
21089         ref_line, ref_name: keep track of the line/filename as instructed
21090         by #line by the compiler.
21091         Parse #line.
21092
21093 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21094
21095         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21096         to match the values in System.CodeDOM.
21097
21098         Divid renamed to Divide.
21099
21100         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21101         statements. 
21102         (Statements.set): remove.
21103
21104         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21105         statements. 
21106
21107         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21108         falseStatements always have valid values. 
21109
21110         * cs-parser.jay: Use System.CodeDOM now.
21111