Fix #75934.
[mono.git] / mcs / mcs / ChangeLog
1 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #75934.
4         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5         (ScopeInfo.EmitScopeType): Use it to construct field names from
6         names of captured locals.
7
8         Fix #75929.
9         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
11         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
12         (ExplicitConversion): Remove enum cases already handled by
13         implicit conversion.  Move implicit conversion check to the beginning.
14         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
15         * expression.cs (ArrayCreation.EmitDynamicInitializers):
16         Don't treat System.Enum as a struct.
17
18 2005-08-30  Jb Evain  <jbevain@gmail.com>
19
20         * attribute.cs: handles as expression in parameters.
21
22 2005-08-30  Raja R Harinath  <rharinath@novell.com>
23
24         Fix #75802.
25         * class.cs (TypeContainer.VerifyClsName): Don't use a
26         PartialContainer when verifying CLS compliance.
27         (AbstractPropertyEventMethod): Set Parent here, ...
28         (PropertyMethod): ... not here.
29
30 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
31
32         * attribute.cs : escaped attribute name should not be allowed to be
33           resolved (e.g. @class as classAttribute). Fixed bug #75930.
34
35 2005-08-29  Raja R Harinath  <rharinath@novell.com>
36
37         Fix #75927.
38         * convert.cs (ImplicitStandardConversionExists): Allow zero also
39         when converting a long constant to unsigned long.
40         * expression.cs (Invocation.OverloadResolve): Add sanity check to
41         detect where IsApplicable and VerifyArgumentsCompat disagree.
42
43 2005-08-29  Raja R Harinath  <rharinath@novell.com>
44         and Carlos Alberto Cortez  <carlos@unixmexico.org>
45
46         Fix #75848.
47         * class.cs (TypeContainer.CanElideInitializer): New helper.
48         (TypeContainer.EmitFieldInitializers): Use it to determine if we
49         can safely emitting the initializer of a field.
50
51 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
52
53         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
54           allowed inside a switch (without loop). Fixed bug #75433.
55
56 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
57
58         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
59         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
60
61 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
62
63         * driver.cs : kinda reverting the default encoding changes (not exact 
64           revert since I noticed that "codepage:reset" might not work fine).
65
66 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
67
68         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
69           Location. Now getter and setter store location correctly.
70           (errors/cs0111-12.cs now reports the expected location.)
71
72 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
73
74         * driver.cs : Use default encoding on the environment.
75           Removed (now that) extra parameter for SeekableStreamReader.
76         * support.cs : (SeekableStreamReader) third .ctor() argument for
77           StreamReader is not required (always true). preamble size could
78           be acquired in simpler and safe way.
79
80 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
81
82         * cs-parser.jay: report CS0642 at warning level 3
83           and report CS0642 for an if else statement also
84           fixes bug #74745. Patch by John Luke (and a bit
85           modified by me).
86           Removed extra CS0642 warning check for "while",
87           "for" and "fixed".
88         * statement.cs: In Block.Resolve(), CS0642 check
89           is reimplemented to check a sequence of an empty
90           statement and a block.
91
92           Both fix bug #66777.
93
94 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
95
96         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
97         detection until I fix it.
98         
99         * cs-tokenizer.cs: Changed error message.
100         
101         * cs-parser.jay: Fixed 2 error locations.
102         
103         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
104         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
105         properties.
106         
107         * enum.cs (GetSignatureForError): Fixed.
108         
109         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
110         method detection.
111         
112         * class.cs,
113         * typemanager.cs (RegisterProperty): Removed.
114         
115         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
116
117 2005-08-24  Raja R Harinath  <rharinath@novell.com>
118
119         Fix #75874.
120         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
121         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
122
123 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
124
125         * expression.cs : tiny fix is required for not warning positive ulong.
126           See test-441.cs.
127
128 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
129
130         * expression.cs : add CS0652 check for constant and integral
131           expression. Fixed bug #53974.
132
133 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
134
135         * expression.cs : in DoNumericPromotions(), check if there is implicit
136           conversion overload for string (to check CS0034). Fixed bug #52492.
137
138 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
139
140         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
141
142 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
143
144         * ecore.cs : report location when it is *not* Null.
145
146 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
147
148         * codegen.cs,
149           ecore.cs,
150           flowanalysis.cs,
151           expression.cs:
152           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
153           correctly. Fixed bug #75721.
154
155 2005-08-23  Raja R Harinath  <rharinath@novell.com>
156
157         * support.cs (SeekableStreamReader.Position): Avoid an expensive
158         loop that performs 'min (pos, char_count)'.
159
160         Fix #75862.
161         * expression.cs (Unary.ResolveOperator): Don't discard implicit
162         converted value in Operator.OnesComplement.
163
164 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
165
166         * anonymous.cs: If the anon method is pulled into a helper class,
167         it needs to be `internal' not `private'. Fixes runtime behavior on
168         msft. bug #75704
169
170 2005-08-20  Martin Baulig  <martin@ximian.com>
171
172         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
173         scope if we don't already have it.
174
175         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
176         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
177         fixes #75867.
178
179 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
180
181         Fix #75803
182         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
183         is a partial class.
184
185 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
186
187         The big constants rewrite
188         Fix #75746, #75685 and more
189         As a side effect saved 1MB for MWF ;-)
190         
191         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
192         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
193         enum based for corlib compilation.
194         
195         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
196         subtractions.
197         
198         * class.cs (FixedField.Define): Use ResolveAsConstant.
199         
200         * const.cs (IConstant): Interface constants and enums.
201         (Const.ResolveValue): New method for constant resolvning.
202         (ExternalConstant): Constants from imported assemblies.
203         
204         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
205         conversion; like enums.
206         (Constant.ToType): Converts this constant to different type.
207         (Constant.Increment): Adds 1.
208         
209         * convert.cs (ImplicitConversionRequired): Simplified.
210         
211         * cs-parser.jay: Create EnumMember directly.
212         
213         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
214         
215         * doc.cs (GenerateEnumDocComment): Removed.
216         
217         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
218         (ConvertIntLiteral): Removed.
219         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
220         
221         * enum.cs (EnumMember): Implement IConstant.
222         (Enum.IsValidEnumConstant): Removed.
223         (Enum.GetNextDefaultValue): Removed.
224         (Enum.FindMembers): Updated.
225         (Enum.GenerateDocComment): Iterate enum members.
226         
227         * expression.cs (Cast.TryReduce): Handle enums correctly.
228         (New.Constantify): Made public.
229         (MemberAccess.DoResolve): Removed contant specific if(s).
230         
231         * literal.cs (NullLiteral): Implement new abstract methods.
232         
233         * statement.cs (GotoCase.Resolve): Use new constant methods.
234         (SwitchLabel.ResolveAndReduce): Use new constant methods.
235         
236         * typemanager.cs (LookupEnum): Removed.
237         (IsEnumType): Fixed to work with corlib.
238         (RegisterConstant): Removed.
239         (LookupConstant): Removed.
240         (GetConstant): Changed to work with IConstant.
241
242 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
243
244         * location.cs : Fixed overflown (>255) column number.
245
246 2005-08-03  Raja R Harinath  <rharinath@novell.com>
247
248         First cut of the qualified-alias-member feature.
249         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
250         token.
251         * cs-parser.jay (DOUBLE_COLON): New token.
252         (namespace_or_type_name): Add rule for recognizing
253         qualified-alias-members.
254         (primary_expression): Likewise.
255         (element_access): Allow QualifiedAliasMember as a possible
256         type-bearing expression.
257         (local_variable_type, local_variable_pointer_type): Likewise.
258         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
259         aliases in the current and enclosing namespace declarations.
260         (NamespaceEntry.UsingAlias): Add CS0440 warning.
261         * decl.cs (MemberName.is_double_colon): New.
262         (MemberName.MemberName): Add new constructor for alias-member.
263         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
264         * expression.cs (QualifiedAliasMember): New expression type.
265
266 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
267
268         * location.cs : it borked when no argument was specified.
269
270 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
271
272         * location.cs : tiny ToString() format fix.
273
274 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
275
276         * statement.cs : oops, it was missing.
277
278 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
279
280         A set of fixes for precise line/column location.
281
282         * location.cs :
283           "token" field now holds a file/line "delta", a line number offset 
284           from the segment, and a column number. See also:
285           http://lists.ximian.com/pipermail/mono-devel-list/2004-
286           December/009508.html
287           Removed static IsNull. Use instance IsNull property instead.
288         * cs-tokenizer.cs :
289           For some tokens it stores Location. For Identifier it stores
290           LocatedToken which is a pair of string name and location.
291           Column numbers are adjusted only at getChar().
292         * report.cs :
293           Use Location.ToString() for reporting (it now contains column).
294         * cs-parser.jay :
295           Largely modified to use LocatedToken instead of
296           string (IDENTIFIER), and to acquire Location from some tokens.
297         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
298           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
299           codegen.cs :
300           Now MemberName holds Location. DeclSpace.ctor() receives Location
301           as a parameter. Removed extra parameters to all derived classes.
302           Replaced Location.IsNull() with instance property.
303         * assign.cs, expression.cs :
304           Added .ctor() overload that omits Location.
305         * attribute.cs :
306           Added "nameEscaped" flag that indicates the identifier was escaped
307           in the source file. This fixes bug #57047.
308
309 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
310
311         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
312         New method, looking for lo-case imported cls type.
313
314         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
315         here.
316
317         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
318
319         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
320
321         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
322         all_imported_types.
323         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
324
325         Optimized to save 3.5 MB for SWF compilation.
326
327 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
328
329         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
330         (PartialContainer.Create): Moved logic AddToContainer.
331         (PartialContainer.MarkForDuplicationCheck): Shares name.
332         
333         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
334         place.
335         
336         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
337         initialization.
338         (Namespace.GetSignatureForError): New method.
339         
340         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
341         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
342
343 2005-08-01  Raja R Harinath  <rharinath@novell.com>
344
345         Fix #75669.
346         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
347         member lookup rather than qualifier_type, since qualifier_type can
348         be null.
349
350 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
351
352         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
353         enum member.
354
355 2005-07-31  Miguel de Icaza  <miguel@novell.com>
356
357         * statement.cs: Copy the local exception into the exception
358         captured local.  Fixes 75674
359
360 2005-07-31  Raja R Harinath  <harinath@gmail.com>
361
362         Fix #75658.
363         * expression.cs (Invocation.OverloadResolve): Don't report error
364         CS1501 if error CS1502 has been reported.
365         (New.DoResolve): Delegate CS1501 reporting to
366         Invocation.OverloadResolve.
367
368         Fix #75656.
369         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
370         invariant-meaning-in-block property in an enclosing block if
371         necessary.
372
373 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
374
375         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
376         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
377         (Switch.CheckSwitch): Just save 50kb for SWF.
378
379 2005-07-27  Martin Baulig  <martin@ximian.com>
380
381         * anonymous.cs (CaptureContext.AddField): Added
382         `AnonymousContainer am' argument; compute its toplevel scope if
383         it's not already computed.  Fixes #75649.
384
385 2005-07-26  Raja R Harinath  <rharinath@novell.com>
386
387         Fix #75628.
388         * class.cs (Constructor.Emit): Reset block to null if the block
389         resolve fails.
390
391 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
392
393         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
394
395 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
396
397         * class.cs (MethodData.Define): Check whether accessor implementing
398         interface is public.
399
400         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
401
402 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
403
404         Fix #57245
405         * namespace.cs (LookupType): Moved same type check to...
406         
407         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
408         with the same name.
409
410 2005-07-21  Raja R Harinath  <rharinath@novell.com>
411
412         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
413         already found a typebuilder.
414         * class.cs (MethodCore.IsDuplicateImplementation): Compare
415         MemberNames, not strings.
416
417         * const.cs (Error_ExpressionMustBeConst): 
418         Rename from Error_EpressionMustBeConst.
419         * const.cs, class.cs, statement.cd: Update.
420
421 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
422
423         Fix #65573
424
425         * const.cs (Const.LookupConstantValue): Report missing contant expression
426         everytime.
427         (Error_EpressionMustBeConstant): Only one error method.
428
429         * class.cs, statement.c: Updated.
430
431 2005-07-20  Raja R Harinath  <rharinath@novell.com>
432
433         * statement.cs (Block.Flags): Add back HasVarargs.
434         (Block.flags): Make protected.
435         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
436
437         * typemanager.cs (types, typecontainers, user_types): Remove.
438         (UserTypes, TypeContainers): Likewise.
439         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
440         (CleanUp, Reset): Update.
441         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
442         (GetNestedType): Use Type.GetNestedType.
443         (CoreLookupType): Take two arguments, the namespace and the
444         basename of the type.  Update to use the Namespace.Lookup
445         mechanism.
446         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
447         (RealMemberLookup): Use IsNestedChildOf instead of playing with
448         string concatenation and substring matches.
449         * class.cs, enum.cs, delegate.cs: Update to changes.
450
451 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
452
453         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
454         Expression and made virtual.
455
456         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
457         (ImplicitStandardConversionExists): Fixed `byte' typo ?
458
459         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
460
461         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
462         error message.
463
464         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
465         change.
466
467 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
468
469         Fix #57707
470         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
471         AssemblyCultureAttribute is not used on executable.
472
473         * rootcontext.cs,
474         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
475
476 2005-07-16  Raja R Harinath  <rharinath@novell.com>
477
478         Fix #60638.
479         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
480         New.  Reports CS0252/CS0253.
481         Mostly taken from preliminary patch by Duncak Mak.
482         (Binary.DoResolveOperator): Store results of operator lookup.
483         Use them to detect if we need to warn about unintended reference
484         comparisons.
485
486 2005-07-15  Raja R Harinath  <rharinath@novell.com>
487
488         Fix #72969.
489         * namespace.cs (Namespace.Lookup): Add back location parameter.
490         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
491         * delegate.cs, ecore.cs, expression.cs: Update to changes.
492
493         * codegen.cs (EmitContext.DeclSpace): Make readonly.
494         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
495         (Namespace.LookupType): ... this.
496         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
497         of namespaces.
498         * typemanager.cs (LookupTypeReflection): Remove buggy code that
499         purported to handle pointers.
500         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
501         CoreLookupType.
502
503 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
504
505         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
506         type as namespace.
507
508 2005-07-15  Raja R Harinath  <rharinath@novell.com>
509
510         * namespace.cs (Namespace.Lookup): Drop location parameter.
511         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
512         (NamespaceEntry.Lookup): ... this.
513         (NamespaceEntry.Error_AmbiguousTypeReference):
514         Move here from DeclSpace.
515         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
516         names ...
517         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
518         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
519         Move to NamespaceEntry.
520         * delegate.cs, expression.cs: Update to changes.
521
522 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
523
524         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
525         CheckAttributeType and refactored.
526         (Attribute.ResolvePossibleAttributeType): Changed to reuse
527         ResolveAsTypeTerminal error handling.
528         (ResolveAsTypeTerminal): Introduced because of global attributes extra
529         handling.
530         (GetSignatureForError): Print errors in same way.
531
532         * class.cs,
533         * codegen.cs: Reflect attribute GetSignatureForError change.
534
535         * ecore.cs,
536         * expression.cs: Add silent parameter to ResolveAsTypeStep.
537
538         * namespace.cs (UsingEntry): Refactored to make fields private.
539
540         * assign.cs,
541         statement.cs: Error_UnexpectedKind has extra parameter.
542
543 2005-07-14  Raja R Harinath  <rharinath@novell.com>
544
545         * ecore.cs (IAlias): Remove.
546         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
547         that implement the interface.
548         * namespace.cs (Namespace): Likewise.
549         (Namespace.declspaces): Renamed from 'defined_names'.
550         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
551         DeclSpace instead of an IAlias.
552         * tree.cs (Tree.AddDecl): Update.
553
554 2005-07-12  Raja R Harinath  <rharinath@novell.com>
555
556         * statement.cs (Block.Flags); Remove HasVarargs.
557         (Block.HasVarargs): Move to ToplevelBlock.
558         (Block.ThisVariable, Block.AddThisVariable): Likewise.
559         (Block.Variables): Make protected.  Initialize variable hashtable
560         if necessary.
561         (Block.AddVariable): Update.
562         (Block.Resolve): Update to changes.
563         (ToplevelBlock.HasVarargs): New boolean.
564         (ToplevelBlock.ThisVariable): Move here from Block.
565         (ToplevelBlock.AddThisVariable): Likewise.
566         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
567         * expression.cs (This.ResolveBase): Update to changes.
568         (ArglistAccess.DoResolve): Likewise.
569
570 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
571
572         Fix #75321
573         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
574
575         * class.cs (TypeContainer.VerifyMembers): Distinguish between
576         not used and not used & assigned.
577         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
578
579 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
580
581         Fix #75053
582         * expression.cs (Is.DoResolve): null is never provided type.
583
584 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
585
586         Fix #52496
587         * cs-parser.jay: Less strict event error rule to catch more errors.
588
589 2005-07-08  Martin Baulig  <martin@ximian.com>
590
591         Fix test-iter-10.cs - distinguish whether we `yield' in a property
592         gettter (allowed) or setter (not allowed).
593
594         * class.cs (Accessor): Implement IIteratorContainer.
595         (Accessor.Yields): New public field.
596         (PropertyBase.PropertyMethod.Define): Handle iterators on a
597         per-accessor basis.
598
599         * cs-parser.jay
600         (get_accessor_declaration, set_accessor_declaration): Set the
601         `yields' flag on the accessor, not the property.
602         (property_declaration): Do the iterators check on a per-accessor
603         basis and not for the whole property.
604
605 2005-07-08  Martin Baulig  <martin@ximian.com>
606
607         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
608         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
609
610 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
611
612         Fix #74975
613         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
614         (ExtractSecurityPermissionSet): Cope with self referencing security
615         attributes properly.
616
617         * driver.cs (SetOutputFile): Made public property OutputFile.
618
619 2005-07-07  Raja R Harinath  <rharinath@novell.com>
620
621         Fix #75486.
622         * class.cs (TypeContainer.first_nonstatic_field): Rename from
623         has_nonstatic_fields.  Make into a FieldBase pointer.
624         (TypeContainer.AddField): Add CS0282 check.
625         (TypeContainer.EmitType): Update.
626
627 2005-07-06  Miguel de Icaza  <miguel@novell.com>
628
629         * cs-tokenizer.cs (consume_identifier): Do not create strings to
630         compare if they start with __.
631
632 2005-07-06  Raja R Harinath  <rharinath@novell.com>
633
634         * statement.cs (Switch.SwitchGoverningType): Only look at
635         UserCasts that don't need implicit standard conversions to one of
636         the allowed switch types (Fixes test-322.cs).
637         (LocalInfo.Resolve): Re-enable sanity-test.
638
639 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
640
641         * cs-tokenizer.cs (consume_identifier): Detect double undescores
642         
643         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
644         
645         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
646
647 2005-07-06  Raja R Harinath  <rharinath@novell.com>
648
649         Fix #75472.
650         * ecore.cs (SimpleName.GetSignatureForError): Add.
651         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
652         (MemberAccess.GetSignatureForError): Add.
653
654 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
655  
656         The big error and warning messages review.
657         
658         * anonymous.cs,
659         * assign.cs,
660         * attribute.cs,
661         * class.cs,
662         * codegen.cs,
663         * convert.cs,
664         * cs-parser.jay,
665         * cs-tokenizer.cs,
666         * decl.cs,
667         * delegate.cs,
668         * doc.cs,
669         * driver.cs,
670         * ecore.cs,
671         * enum.cs,
672         * expression.cs,
673         * flowanalysis.cs,
674         * iterators.cs,
675         * literal.cs,
676         * location.cs,
677         * modifiers.cs,
678         * namespace.cs,
679         * parameter.cs,
680         * pending.cs,
681         * report.cs,
682         * rootcontext.cs,
683         * statement.cs,
684         * support.cs,
685         * tree.cs,
686         * typemanager.cs: Updated.
687         
688         * class.cs: (MethodCore.SetYields): Moved here to share.
689         (PropertyMethod.Define): Moved iterator setup here.
690         
691         * iterators.cs: Add orig_method to have full access to parent
692         container.
693
694 2005-07-05  Raja R Harinath  <rharinath@novell.com>
695
696         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
697         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
698         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
699         variable of struct type.
700         * expression.cs (Unary.ResolveOperator): Update to change.
701         (Indirection.VerifyFixed): Likewise.
702         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
703         (ParameterReference.VerifyFixed): Value parameters are fixed.
704         (This.VerifyFixed): Treat 'this' as a value parameter.
705         * statement.cs (LocalInfo.IsFixed): Remove.
706
707 2005-07-01  Martin Baulig  <martin@ximian.com>
708
709         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
710         `ec.EmitThis ()' to get the correct scope.
711
712 2005-07-01  Martin Baulig  <martin@ximian.com>
713
714         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
715         instance is a ParameterReference; fixes #75299.
716
717 2005-07-01  Martin Baulig  <martin@ximian.com>
718
719         Reverted Marek's latest patch (r46725):
720         - it contains structural changes which are neither mentioned in
721           the ChangeLog nor explained anywhere; for example the additional
722           argument of EmitContext's and Iterator's .ctor's and the
723           TypeContainer.DefineMembers() change.
724         - structural changes like this should go in in seperate patches
725           and not be hidden in a huge patch which just seems to affect
726           warnings and errors.
727           a big and hard to understand patch.
728         - it breaks iterators and causes regressions, for instance in
729           test-iter-03.cs.      
730
731 2005-06-30  Raja R Harinath  <rharinath@novell.com>
732
733         Fix #75412.
734         * expression.cs (Indexers.map): Remove.
735         (Indexers.Append): Filter out inaccessible setters and getters.
736         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
737
738         Fix #75283.
739         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
740         Refactored from ...
741         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
742         (FieldExpr.Emit, PropertyExpr.Emit): Update.
743         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
744         * expression.cs (Invocation.EmitCall): Add CS0120 check.
745
746 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
747
748         Fix #75322
749         * class.cs (FieldBase.GetInitializerExpression): One more field
750         for backup.
751
752 2005-06-28  Miguel de Icaza  <miguel@novell.com>
753
754         * pending.cs: Do not define a proxy if the base method is virtual,
755         it will be picked up by the runtime (bug 75270).
756
757 2005-06-08  Martin Baulig  <martin@ximian.com>
758
759         The big Iterators rewrite :-)
760
761         * iterators.cs: Rewrite this to use the anonymous methods framework.
762
763         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
764         before the TypeContainers; see 2test-21.cs.
765
766         * class.cs
767         (TypeContainer.DefineType): Don't create a new EmitContext if we
768         already have one (this only happens if we're an Iterator).
769         (TypeContainer.Define): Also call Define() on all our iterators.
770         (Method.CreateEmitContext): Added support for iterators.
771
772         * anonymous.cs
773         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
774         (AnonymousContainer.CreateMethodHost): Moved here from
775         AnonymousMethod and made abstract.
776         (AnonymousContainer.CreateScopeType): New abstract method.
777         (AnonymousContainer.IsIterator): New public property.
778         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
779         get the ScopeTypeBuilder rather than manually defining it here. 
780         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
781         iterators here.
782
783         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
784         before RootContext.DefineTypes().
785
786         * codegen.cs (EmitContext.RemapToProxy): Removed.
787         (EmitContext.CurrentAnonymousMethod): Changed type from
788         AnonymousMethod -> AnonymousContainer.
789         (EmitContext.ResolveTopBlock): Protect from being called twice.
790         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
791         (EmitContext.EmitThis): Removed the iterators hacks; use the
792         anonymous methods framework for that.
793
794         * statement.cs
795         (ToplevelBlock.Container): Make this a property, not a field.
796         (ToplevelBlock.ReParent): New public method; move the
797         ToplevelBlock into a new container.
798         (Foreach.TemporaryVariable): Simplify.
799
800 2005-06-05  Martin Baulig  <martin@ximian.com>
801
802         * statement.cs (LocalInfo.CompilerGenerated): New flag.
803         (Block.AddTemporaryVariable): New public method; creates a new
804         `LocalInfo' for a temporary variable.
805         (Block.EmitMeta): Create the LocalBuilders for all the temporary
806         variables here.
807         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
808         non-iterator variables.
809
810 2005-06-05  Martin Baulig  <martin@ximian.com>
811
812         * statement.cs (Foreach.TemporaryVariable): Create the
813         LocalBuilder in the Emit phase and not in Resolve since in some
814         situations, we don't have an ILGenerator during Resolve; see
815         2test-19.cs for an example.
816
817 2005-06-04  Martin Baulig  <martin@ximian.com>
818
819         **** Merged r45395 from GCS ****
820
821         The big Foreach rewrite - Part II.
822
823         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
824         with `PropertyInfo ienumerator_getcurrent'.
825
826         * codegen.cs (VariableStorage): Removed.
827
828         * statement.cs
829         (Foreach): Derive from Statement, not ExceptionStatement.
830         (Foreach.CollectionForeach): New nested class.  Moved all the code
831         dealing with collection foreach here.
832         (Foreach.ForeachHelperMethods): Removed.
833         (Foreach.TemporaryVariable): Implement IMemoryLocation.
834
835 2005-05-23  Martin Baulig  <martin@ximian.com>
836
837         * statement.cs (Try.DoResolve): Don't create a `finally' if we
838         don't need to.  Fix #75014.
839
840 2005-05-20  Martin Baulig  <martin@ximian.com>
841
842         Merged r44808 from GMCS.
843
844         * class.cs (TypeContainer.CircularDepException): Removed.
845         (TypeContainer.DefineType): Removed the `InTransit' stuff.
846         (TypeContainer.CheckRecursiveDefinition): Check for circular class
847         (CS0146) and interface (CS0529) dependencies here.
848
849 2005-06-21  Raja R Harinath  <rharinath@novell.com>
850
851         * expression.cs (Invocation.EmitCall): Fix initialization
852         'this_call' to reflect current behaviour.  Fix indentation.
853
854         * convert.cs (FindMostEncompassedType): Add two trivial special
855         cases (number_of_types == 0 || number_of_types == 1).
856         (FindMostEncompasingType): Likewise.
857
858 2005-06-17  Raja R Harinath  <rharinath@novell.com>
859
860         Some cleanups preparing for the fix of #75283.
861         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
862         error testing.
863         (EventExpr.InstanceResolve): Likewise.
864         (EventExpr.DoResolve): Remove redundant checks.
865
866 2005-06-10  Duncan Mak  <duncan@novell.com>
867
868         * cs-tokenizer.cs (process_directives): New flag for controlling
869         the processing of preprocessor directives.
870         (x_token): After seeing a '#', return Token.NONE instead of going
871         to handle_preprocessing_directive() when not processing
872         directives. This avoids unnecessary processing during the token peek in
873         is_punct().
874
875         This fixes #74939.
876
877         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
878         the existing error reporting methods instead of Report.Error.
879
880         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
881         after Raja's rewrite.
882
883 2005-06-08  Miguel de Icaza  <miguel@novell.com>
884
885         * class.cs: Small fix.
886
887 2005-06-08  Raja R Harinath  <rharinath@novell.com>
888
889         Fix #75160.
890         * class.cs (GetPartialBases): Fix return value check of
891         part.GetClassBases.
892
893 2005-06-07  Raja R Harinath  <rharinath@novell.com>
894
895         Ensure that partial classes are registered in their enclosing
896         namespace.  Initial part of fix of #75160.
897         * tree.cs (Tree.RecordDecl): Add new namespace argument.
898         Register declspace with namespace here, not in
899         DeclSpace.RecordDecl.
900         * cs-parser.jay: Pass namespace to RecordDecl.
901         * class.cs (PartialContainer.Create): Likewise.
902         (ClassPart.DefineType): New sanity-check.  Throws an exception if
903         called.
904         * decl.cs (Declspace.RecordDecl): Remove.
905         * namespace.cs (NamespaceEntry.DefineName): Remove.
906
907 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
908
909         * rootcontext.cs: Reset TargetExt as well.
910
911 2005-06-03  Raja R Harinath  <rharinath@novell.com>
912
913         * ecore.cs (Expression.Resolve): Emit CS0654 error when
914         -langversion:ISO-1.
915
916 2005-06-02  Raja R Harinath  <rharinath@novell.com>
917
918         Fix #75080, cs0119.cs.
919         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
920         of ...
921         (Expression.Resolve): ... this.  Use it.  Remove bogus code
922         allowing ExprClass.Type and ExprClass.Namespace for
923         ResolveFlags.VariableOrValue.
924         (Expression.Resolve) [1-argument variant]: Change default resolve
925         flags based on language version.
926         (Expression.Error_UnexpectedKind): Use a simple string array
927         rather than an ArrayList.
928         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
929         not ExprClass.Type.
930         (TypeOfVoid.DoResolve): Likewise.
931         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
932         flags argument -- it always has the same value.
933
934 2005-05-31  Raja R Harinath  <rharinath@novell.com>
935
936         Fix #75081.
937         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
938         Use it in the error message.
939         * assign.cs, expression.cs, statement.cs: Update.
940
941 2005-05-30  Raja R Harinath  <rharinath@novell.com>
942
943         Fix #75088.
944         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
945         the "almostMatchedMember" case too.
946         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
947         that failed the accessibility checks to 'almost_match'.
948
949 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
950
951         * attribute.cs: Use internal MethodBuilder methods to set
952         ExactSpelling and SetLastError on PInvoke methods, instead
953         of passing them via charset.  Fixes #75060.
954
955 2005-05-27  Raja R Harinath  <rharinath@novell.com>
956
957         * parameter.cs (Parameter): Remove TODO comment.
958         (Parameter.DefineParameter): Remove Location parameter.
959         (Parameters.LabelParameters): Likewise.
960         * class.cs (Constructor.Emit): Update to change.
961         (MethodData.Emit): Likewise.
962         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
963         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
964
965 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
966
967         * parameter.cs,
968           Removed Parameters.Location and added Parameter.Location instead.
969           Removed Location parameter from Emit() and GetSignature().
970         * anonymous.cs,
971           class.cs,
972           cs-parser.jay,
973           delegate.cs,
974           iterators.cs,
975           statement.cs :
976           Modified all related calls.
977
978 2005-05-26  Raja R Harinath  <rharinath@novell.com>
979
980         Improve user-defined conversion handling.
981         * convert.cs (GetConversionOperators): Rewrite.  Return only the
982         applicable operators.
983         (AddConversionOperators): New.  Helper for GetConversionOperators.
984         (FindMostEncompassedType, FindMostEncompassingType): Verify that
985         there is only one most encompassed/encompassing type.
986         (FindMostSpecificSource, FindMostSpecificTarget): Remove
987         "applicable operator" handling.
988         (UserConversion): Move cache here from GetConversionOperators.
989         Directly cache the chosen operator, rather than the whole
990         MethodGroup.
991         (ExplicitNumericConversion): Fix buggy implementation of Decimal
992         case.  Allow conversion of decimal to sbyte and byte too.
993         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
994         New static methods.  Used to avoid allocating EmptyExpressions in
995         convert.cs.
996
997 2005-05-24  Duncan Mak  <duncan@novell.com>
998
999         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1000         another class, used in Convert.ExplicitNumericConversion.
1001         (CastToDecimal): New class, similar to above, but casts to
1002         System.Decimal, used in Convert.ImplicitNumericConversion and also
1003         in explicit convesion from double/float to decimal.
1004
1005         * convert.cs (ImplicitNumericConversion): Handle implicit
1006         conversions to System.Decimal.
1007         (ExplicitNumericConversion): handle explicit conversions to
1008         System.Decimal.
1009
1010         This fixes #68711.
1011         
1012 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1013
1014         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1015         know the type at this stage, just break through.   Fixes #75008 
1016
1017 2005-05-19  Martin Baulig  <martin@ximian.com>
1018
1019         * delegate.cs
1020         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1021         to disable error reporting.
1022
1023         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1024         here since we don't want to report an error; see the new test-336.cs.
1025
1026 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1027
1028         * statement.cs (ToplevelBlock.GetParameterReference)
1029         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1030         Move here from class Block.
1031         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1032         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1033
1034 2005-05-18  Martin Baulig  <martin@ximian.com>
1035
1036         Fix #74978.
1037
1038         * flowanalysis.cs
1039         (FlowBranching.Reachability): Add non-static public And() and Or()
1040         methods.
1041         (FlowBranchingSwitch): New class; do the `break_origins' thing
1042         like in FlowBranchingLoop.
1043         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1044         reachability, not just locals and parameters.
1045         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1046         switch; MergeBreakOrigins() now takes care of that.
1047
1048 2005-05-18  Martin Baulig  <martin@ximian.com>
1049
1050         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1051         a loop and may leave it, reset the barrier; fixes #74974.
1052
1053 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1054         
1055         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1056         is back.
1057         
1058         * cs-parser.jay: Catch more lexical errors.
1059         
1060         * report.cs: Add one more Error method.
1061         
1062         * rootcontext.cs,
1063         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1064
1065 2005-05-17  Martin Baulig  <martin@ximian.com>
1066
1067         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1068         #70970. 
1069
1070 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1071
1072         Fix test-382.cs.  Emit values of decimal constants.
1073         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1074         Carved out of ...
1075         (TypeContainer.AddField): ... this.
1076         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1077         with initializers to include 'Const's.
1078         (ClassPart.RegisterFieldForInitialization): Forward to
1079         PartialContainer.
1080         * const.cs (Const.Const): Pass initializer to base class.
1081         (Const.Define): In case of decimal constants, register them for
1082         initialization in a static constructor.
1083
1084 2005-05-14  Martin Baulig  <martin@ximian.com>
1085
1086         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1087         do not call ResolveUnreachable() on unreachable statements in
1088         here, see the comment in the source code.
1089
1090 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1091
1092         Fix #74934.
1093         * expression.cs (BinaryResolveOperator): If one of the operands of
1094         an equality comparison is 'null' and the other is a pointer type,
1095         convert the null to a NullPointer.
1096         * convert.cs (ImplicitReferenceConversion): If the expression is a
1097         NullLiteral and the target type is a pointer type, return a
1098         NullPointer instead.
1099         (ImplicitConversionStandard): Likewise.
1100
1101 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1102         
1103         * cs-parser.jay: Set readonly context based on special constructs.
1104         
1105         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1106         readonly variable error handling.
1107         
1108         * rootcontext.cs (EmitCode): Don't verify members when error
1109         occurred.
1110         
1111         * statement.cs (LocalInfo): Add reaodnly context information.
1112         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1113
1114 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1115
1116         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1117         for #74041 to initialize 'resolved' to false only for explicit
1118         blocks.  Fixes #74873.
1119
1120 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1121
1122         Fix #74920.
1123         * typemanager.cs (unmanaged_enclosing_types): New.
1124         (IsUnmanagedType): Avoid infloops by using
1125         'unmanaged_enclosing_types' to talk with recursive invocations.
1126
1127 2005-05-13  Martin Baulig  <martin@ximian.com>
1128
1129         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1130         instance variable, not a local.  Fix #74873.
1131         (Block.ResolveUnreachable): Set it to true here.
1132
1133 2005-05-11  Duncan Mak  <duncan@novell.com>
1134
1135         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1136         continuing to process for 'arg'.
1137         (handle_preprocessing_directive): Check the argument of the #endif
1138         directive and report error CS1025 if there are any trailing
1139         characters.
1140
1141         According to the C# spec, having even whitespace after the #endif
1142         directive is illegal; however, because we call arg.TrimEnd ()
1143         beforehand, we have the same behavior as csc, allowing whitespace
1144         after the directive.
1145
1146         Fixes #74892.
1147
1148 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1149
1150         Fix #74863.
1151         
1152         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1153         (Constructor.GetObsoleteAttribute): Implemented correctly.
1154
1155 2005-05-10  Martin Baulig  <martin@ximian.com>
1156
1157         * support.cs (ReflectionParameters.ParameterModifier): Use
1158         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1159         and `ParameterAttributes.In'.  Fixes #74884.
1160
1161 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1162
1163         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1164         
1165         * expression.cs (Argument.GetParameterModifier): Turned to property.
1166         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1167         
1168         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1169         its C# equivalent.
1170         
1171 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1172
1173         Fix #74852.
1174         * decl.cs (MemberCache.AddMethods): Register override methods,
1175         rather than non-override methods.
1176         * typemanager.cs (RegisterOverride): New.
1177         (IsOverride): Update.
1178
1179 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1180
1181         Fix #73105.
1182         
1183         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1184         recursive declaration.
1185         
1186         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1187         
1188 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1189
1190         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1191         
1192         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1193
1194 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1195
1196         Fix #74797.
1197         * decl.cs (DeclSpace.FamilyAccessible): 
1198         Use TypeManager.IsNestedFamilyAccessible.
1199
1200         Fix reopened #64812.
1201         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1202         internal'.
1203
1204 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1205             Abin Thomas  <projectmonokochi@rediffmail.com>
1206             Anoob V E  <projectmonokochi@rediffmail.com>
1207             Harilal P R  <projectmonokochi@rediffmail.com>
1208
1209         Fix #64812.
1210         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1211         allow access to all static members.
1212
1213 2005-05-04  Martin Baulig  <martin@ximian.com>
1214
1215         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1216
1217 2005-05-04  Martin Baulig  <martin@ximian.com>
1218
1219         Fix #74655.
1220
1221         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1222         section at the end; make things work if `default' is not the last
1223         section.        
1224
1225 2005-05-04  Martin Baulig  <martin@ximian.com>
1226
1227         Fix #70400.
1228
1229         * statement.cs (Switch): Replaced the `got_default' field with a
1230         `default_section' one.
1231         (Switch.CheckSwitch): Set `default_section' here.
1232         (Switch.Resolve): If we're a constant switch and the constant is
1233         not found, use the default section.
1234
1235 2005-05-03  Martin Baulig  <martin@ximian.com>
1236
1237         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1238
1239         * statement.cs (Foreach.ArrayForeach): New nested class.
1240         (Foreach.TemporaryVariable): New nested class.
1241         (Foreach.EmitArrayForeach): Removed; this is now in the new
1242         ArrayForeach class.
1243
1244 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1245
1246         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1247         more conservative.
1248         (VerifyPendingMethods): Revert change below.
1249
1250         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1251         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1252         that used to trigger warning -28.  Remove warning -28.
1253         * expression.cs (Invocation.OverloadResolve): Use
1254         TypeManager.IsOverride to distinguish override methods.
1255
1256         Fix #74773.
1257         * pending.cs (VerifyPendingMethods): If a base type implements the
1258         requested interface, don't bother checking individual methods of
1259         the base type.  As a side-effect, this prevents the creation of
1260         unnecessary proxies.
1261
1262 2005-05-02  Martin Baulig  <martin@ximian.com>
1263
1264         Fix #70182.
1265
1266         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1267         Also `And' the locals if the old vector is null.
1268         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1269         null; in this case we basically reset all the variables.        
1270
1271 2005-05-02  Martin Baulig  <martin@ximian.com>
1272
1273         Fix #74529.
1274
1275         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1276         Added `FlowBranching branching' argument; always `and' the
1277         variables instead of `or'ing them unless we're an infinite loop.
1278
1279         * statement.cs (While.Resolve): Create a new sibling unless we're
1280         infinite.       
1281
1282 2005-05-02  Martin Baulig  <martin@ximian.com>
1283
1284         Fix #70140.
1285
1286         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1287         arguments; use it instead of creating a new TopLevelBlock.
1288         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1289         our ConstructorInitializer.
1290
1291         * statement.cs
1292         (TopLevelBlock.TopLevelBranching): New public property.
1293         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1294         and create our `TopLevelBranching'.
1295
1296         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1297         anonymous method host, use `block.TopLevelBranching' rather than
1298         creating a new branching.
1299
1300 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1301
1302         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1303         a ScopeInfo, if any of the current children is a child of the new
1304         entry, move those children there.
1305
1306 2005-04-30  Martin Baulig  <martin@ximian.com>
1307
1308         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1309         at the beginning of a SwitchSection.  Fix #73335.
1310
1311 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1312
1313         Fix #74378
1314         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1315         
1316         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1317         (FieldExpr.DoResolve): Obsolete members are ignored for field
1318         initializers.
1319         
1320 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1321
1322         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1323         of arrays detection.
1324
1325         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1326         verification.
1327         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1328
1329         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1330         arrays report.
1331
1332 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1333
1334         * cs-parser.jay: Use the prefered version of -unsafe in error
1335         message.
1336
1337 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1338
1339         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1340         circumstances.
1341
1342 2005-04-20  John Luke  <john.luke@gmail.com>
1343
1344         * driver.cs: fix typo in error message, --outout to --output
1345
1346 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1347
1348         * codegen.cs (InRefOutArgumentResolving): New field.
1349         
1350         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1351         fields outside contructor.
1352         
1353         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1354         
1355 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1356
1357         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1358         parameter code was not completed ever, so it was not as up-to-date
1359         as local variables.  Must finish it.
1360
1361         The bug fix was to compare the Toplevel of the block, not the
1362         current block.  Thanks for Ben for pointing this out. 
1363
1364 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1365
1366         * decl.cs (AddMethods): Use the declaring type of the problem
1367         method to determine if we want to squash a warning.
1368
1369 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1370
1371         * attribute.cs: Removed debug output.
1372
1373         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1374         
1375         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1376         Report.Stderr.
1377         
1378 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1379
1380         Fix #74481.
1381         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1382         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1383         all null comparisons against reference types.
1384
1385 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1386
1387         Fix# 74565
1388         * class.cs (TypeContainer.CircularDepException) New nested
1389         exception class.
1390         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1391         (TypeContainer.DefineType): Removed error, reset InTransit before
1392         exit.
1393         (Class.DefineType): Throw exception when is in Transit.
1394         Catch exception and report error.
1395         (Struct.DefineType): Throw exception when is in Transit.
1396         Catch exception and report error.
1397         (Interface.DefineType): Throw exception when is in Transit.
1398         Catch exception and report error.
1399
1400         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1401         handle nested exception handlers.
1402
1403         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1404         a catch.
1405
1406         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1407         InFinally and InCatch storage.
1408
1409         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1410         (Catch.Resolve): Set and Restore ec.InCatch.
1411         (Try.Resolve): Set and Restore ec.InFinally.
1412         (Try.HasCatch): True when try has catch.
1413
1414 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1415
1416         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1417           for the same event member, so exclude such cases from warning 419.
1418           Fixed bug #74633.
1419
1420 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1421
1422         * expression.cs (Binary.ResolveOperator): Apply patch from John
1423         Luke to fix bug 59864: operators &, | and ^ on enumerations
1424         require that the same enum type on both sides.
1425
1426         * driver.cs: Add warnings to old flag usage, this is to assist
1427         people who produce Makefiles and hope that the Makefiles will be
1428         used on Windows.
1429
1430         * class.cs (TypeContainer.EmitType): Moved the definition of the
1431         special $PRIVATE$ field from the resolve phase to the Emit phase.
1432         During resolve we do not know if we are a struct with
1433         HasExplicitLayout, we know this only after the attributes for the
1434         type are emitted.
1435
1436         Set the FieldOffset to zero on the dummy field that we create for
1437         the class.   Fixes 74590.
1438
1439 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1440
1441         Fix #73834.
1442         * ecore.cs (PropertyExpr.resolved): New.
1443         (DoResolve): Use it to handle a case of double resolution here.
1444         Handle a case of identical-name-and-type-name.
1445         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1446         resolution by storing the results of expression resolution back
1447         into the "probes" array.
1448
1449 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1450
1451         Fix cs0208-7.cs and cs0208-8.cs.
1452         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1453         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1454         error reporting to point out the reason a struct is not unmanaged.
1455
1456 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1457
1458         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1459           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1460
1461 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1462
1463         Fix #74528.
1464         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1465         IdenticalNameAndTypeName here.
1466         (EventExpr.InstanceResolve): Likewise.
1467
1468 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1469
1470         C# 2.0 DefaultCharSetAttribute implementation
1471         
1472         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1473         which allows us to set GlobalNamespace for every resolve.
1474         (Attribute.ResolveArguments): Cut from Resolve.
1475         (Attribute.GetCharSetValue): Returns CharSet named argument.
1476         (Attribute.DefinePInvokeMethod): Gets default charset from
1477         module settings.
1478         (GlobalAttribute.ResolveAsTypeStep): Override.
1479         (GlobalAttribute.ResolveArguments): Override.
1480         
1481         * class.cs (TypeAttr): Is protected.
1482         
1483         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1484         (ModuleClass.DefaultCharSetType): New memeber.
1485         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1486         
1487         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1488         charset from module.
1489         
1490         * delegate.cs (TypeAttr): Override.
1491         (Delegate.DefineType): Use this TypeAttr.
1492         
1493         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1494         at very early stage (before types are defined) to resolve model
1495         module attributes. It will probably not work with corlib but it
1496         should be ok.
1497         
1498         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1499         charset from module.
1500         
1501         * typemanager.cs (default_charset_type): New type.
1502
1503 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1504
1505         * decl.cs (MemberCache.AddMethods): Don't warn if
1506         System.Object.Finalize has buggy MethodAttributes.
1507
1508         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1509         removed below.
1510
1511 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1512
1513         * doc.cs : detect ambiguous reference to overloaded members.
1514           Fixed bug #71603. MS 1.1 csc does not detect it.
1515
1516 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1517
1518         * doc.cs : delegates must not be referenced with parameters.
1519           Fixed bug #71605.
1520
1521 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1522
1523         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1524
1525 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1526
1527         * driver.cs (MainDriver): Stop processing if the CLS stage found
1528         errors. 
1529
1530         (CompilerCallableEntryPoint.InvokeCompiler): Always
1531         reset after execution;   Take a TextWriter argument for the
1532         output.
1533
1534         * report.cs: Use the error stream instead of hardcoding stderr. 
1535
1536 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1537
1538         * class.cs: Reduce code paths to test, too small of an
1539         optimization to make it worth the extra testing.  Always perform
1540         it. 
1541
1542 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1543
1544         Fix #74510.
1545         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1546         operators that had errors reported on them.
1547
1548 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1549
1550         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1551         argument types.
1552         (Attribute.Resolve): Add named argument type checking.
1553         
1554         * class.cs (FixedField.Define): Use IsPrimitiveType
1555         
1556         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1557         
1558         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1559         unsafe parameter types.
1560         
1561         * statement.cs (Using.ResolveExpression): Add better error description.
1562         
1563         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1564         
1565 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1566
1567         Fix #74484.
1568         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1569         AttributeUsageAttribute in the emitcontext of the attribute class,
1570         not in the emitcontext of the attributable entity it was attached to.
1571         * cs-parser.jay: Use 'current_class', not 'current_container',
1572         when creating a GlobalAttribute.
1573
1574 2005-04-08  Alp Toker  <alp@atoker.com>
1575
1576         * pending.cs: The fix to #58413 failed to compile methods implementing
1577         interfaces with/without params modifiers and vice versa, even though
1578         params modifiers aren't part of the signature. Make the modifier check
1579         less strict as in csc.
1580
1581 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1582             Anoob V E  <projectmonokochi@rediffmail.com>
1583             Harilal P R  <projectmonokochi@rediffmail.com>
1584
1585         Fix #58413.
1586         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1587         modifiers of pending methods.
1588         (PendingImplementation.PendingImplementation): Initialize it.
1589         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1590         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1591         with ParameterData.  Add check for modifiers.
1592         * class.cs (MethodData.Define): Update to changes.
1593
1594 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1595
1596         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1597
1598 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1599
1600         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1601         property.
1602         
1603         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1604         
1605         * rootcontext.cs,
1606         * typemanager.cs: Registered RequiredAttributeAttribute.
1607         
1608 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1609
1610         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1611         Warning CS0169 is back at level 3.
1612         (IMethodData.SetMemberIsUsed): New method.
1613         
1614         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1615         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1616         
1617         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1618
1619         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1620         contants.
1621         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1622         is used.
1623         
1624         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1625         is used.
1626         
1627         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1628         to avoid the problems with nested types.
1629
1630 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1631             Anoob V.E  <projectmonokochi@rediffmail.com>
1632             Harilal P.R  <projectmonokochi@rediffmail.com>
1633             Raja R Harinath  <rharinath@novell.com>
1634
1635         Fix #73820.
1636         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1637         attribute.
1638         * typemanager (GetConstructor): Make public.
1639
1640 2005-04-05  John Luke  <john.luke@gmail.com>
1641             Raja R Harinath  <rharinath@novell.com>
1642
1643         Fix #62232.
1644         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1645         struct too.  Return false quicker in a few cases.
1646         (VerifyUnManaged): Use it.
1647
1648 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1649
1650         Fix #74041.
1651         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1652         not 'unreachable_seen'.
1653
1654 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1655
1656         * attribute.cs (Attribute.GetValue): Removed unused.
1657         
1658         * codegen.cs (CodeGen.TrimExt): Removed unused.
1659         
1660         * cs-parser.jay (output): Removed unused.
1661         
1662         * cs-tokenizer.cs (hex_digits): Removed unused.
1663         
1664         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1665         
1666         * expression.cs (Indirection.LoadExprValue): Removed unused.
1667         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1668         
1669         * iterators.cs (Iterator.param_types): Removed unused.
1670         
1671         * statement.cs (Goto.block): Removed unused.
1672         (ToplevelBlock.did): Removed unused.
1673         (Switch.ResolveConstantSwitch): Removed unused.
1674
1675 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1676
1677         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1678         resetting thingy.
1679
1680 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1681
1682         Fix #74232 and cs0208-3.cs.
1683         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1684         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1685         unmanaged type.  Don't use FieldBuilders when 't' is a
1686         TypeBuilder.  Use ModFlags and MemberType fields.
1687         * class.cs (MemberBase.member_type): Rename from MemberType.
1688         (MemberBase.MemberType): New property.  Determines member_type on
1689         demand.
1690         (MemberBase.DoDefine): Don't initialize MemberType here.
1691         (FieldMember.Define): Likewise.
1692
1693 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1694
1695         Fix #74241
1696         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1697         Attributes are emitted there.
1698         
1699 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1700
1701         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1702         keyword in 'partial enum' too.
1703         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1704         is not allowed).
1705         Report from Kamil Skalski <nazgul@omega.pl>.
1706
1707         Fix #74309.
1708         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1709         have partial containers too.
1710
1711         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1712         in block' checks to Block.CheckInvariantMeaningInBlock.
1713         * statement.cs (Block.GetKnownVariableInfo): Make private.
1714         (Block.IsVariableUsedInChildBlock): Remove.
1715         (Block.IsVariableUsedInBlock): Likewise.
1716         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1717         conflicting declaration.
1718         (Block.AddVariable): Make error messages less long-winded and more
1719         specific.  Show location of conflicting declaration.
1720         * parameter.cs (Parameters.Location): New readonly property.
1721
1722 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1723
1724         Clean up semantics of invoking ResolveMemberAccess.
1725         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1726         can have an instance, ensure that we pass in a non-TypeExpression
1727         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1728         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1729         argument.  Update to changes and simplify.
1730         (FieldExpr.Emitinstance): Remove CS0120 check.
1731         (PropertyExpr.EmitInstance): Likewise.
1732         * expression.cs (Argument.Resolve): Likewise.
1733         (Invocation.DoResolve): Update to changes in semantics of
1734         InstanceExpression.
1735
1736 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1737
1738         Fix #74241
1739         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1740         customization.
1741         
1742         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1743
1744 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1745
1746         Fix difference in behaviour with commandline invocation.
1747         * driver.cs (Driver.Reset): New.
1748         (CompilerCallableEntryPoint): Call it.
1749
1750         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1751         variable" warnings if the boolean expression failed to resolve.
1752
1753 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1754
1755         * attribute.cs: Fix the union of several permissions when some of them
1756         are unrestricted (so the result isn't an unrestricted permission set).
1757         Fix #74036.
1758
1759 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1760
1761         * ecore.cs (MemberExpr): New class.  Convert from interface
1762         IMemberExpr.
1763         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1764         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1765         error checks.
1766         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1767         (MethodGroupExpr.IsExplicitImpl): Remove.
1768         (Expression.GetFieldFromEvent): Remove.
1769         (SimpleName.MemberStaticCheck): Remove.
1770         (SimpleName.DoSimpleNameResolve): Update to changes.
1771         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1772         (MemberAccess.IdenticalNameAndTypeName): Remove.
1773         (MemberAccess.error176): Move to MemberExpr.
1774         (MemberAccess.DoResolve): Update to changes.
1775         (BaseAccess.DoResolve): Likewise.
1776
1777 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1778
1779         C# 2.0 Conditional attribute class implementation
1780         
1781         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1782         Analyzes class whether it has attribute which has ConditionalAttribute
1783         and its condition is not defined.
1784         
1785         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1786         (Class.IsExcluded): New method. Search for at least one defined
1787         condition in ConditionalAttribute of attribute class.
1788
1789 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1790
1791         * ecore.cs (PropertyExpr): Derive from Expression, not
1792         ExpressionStatement.
1793         (PropertyExpr.EmitStatement): Remove.
1794
1795 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1796
1797         Fix #74060.
1798         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1799         internal field "value__" of an enum be private.  The examples for
1800         "value__" that I found on MSDN all used FieldAttributes.Private.
1801
1802         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1803         Don't mention IL method attribute names.
1804
1805         Fix #47991.  Remove a TODO.
1806         * statement.cs (Block.Toplevel): Make into a field.
1807         (Block.Parameters): Move into ToplevelBlock.
1808         (Block.known_variables): Rename from child_variable_names.
1809         (Block.Block): Remove variants that take Parameters.  Initialize
1810         'Toplevel' with the immediately surrounding toplevel block.
1811         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1812         LocalInfo parameter.
1813         (Block.GetKnownVariableInfo): New.
1814         (Block.IsVariableNameUsedInChildBlock): Update.
1815         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1816         the block, even though it may not be in scope.
1817         (Block.AddVariable): Remove Parameters parameter.  Use
1818         Toplevel.Parameters instead.
1819         (Block.AddConstant): Remove Parameters parameter.
1820         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1821         (Block.IsParamaterReference): Likewise.
1822         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1823         (ToplevelBlock.Parameters): New.  Moved from Block.
1824         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1825         initialize Parameters to a non-null value.
1826         * cs-parser.jay: Update to changes.
1827         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1828         simple names that mean different things in the same block.  Use
1829         Block.IsVariableNameUsedInBlock.
1830
1831 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1832
1833         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1834         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1835         GetTypeHandle.  It is possible for a reflected type to derive from
1836         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1837         System.Array during mscorlib compilation).
1838         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1839         contain a method_hash, don't create one either.  Don't create a
1840         deep copy of the base cache's method_hash.
1841         (MemberCache.SetupCache): Rename back from DeepCopy.
1842         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1843         already initialized.  If we see an override function, add its
1844         underlying base virtual function to the member_hash too.
1845
1846         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1847
1848 2005-03-26  Raja R Harinath  <harinath@acm.org>
1849
1850         Fix #73038.
1851         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1852         fails to resolve, ensure that the LHS is still resolved as an
1853         lvalue.
1854
1855 2005-03-25  Raja R Harinath  <harinath@acm.org>
1856
1857         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1858         ec.ContainerType.
1859         (Enum.current_ec): Remove.
1860         (Enum.LookupEnumValue): Remove EmitContext argument.
1861         Just uses the one created during DefineType.
1862         (Enum.FindMembers): Update.
1863         * expression.cs (MemberAccess.DoResolve): Update.
1864
1865 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1866
1867         * assign.cs (Assign.DoResolve): Check for CS1717 when
1868         source and target are same (uses Equals).
1869
1870         * expression.cs (LocalVariableReference, ParameterReference,
1871         This): Implemented Equals, GetHashCode.
1872
1873         * statement.cs (Block.GetParameterReference): Removed useless
1874         local variable.
1875
1876 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1877
1878         Fix cs0128.cs
1879         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1880         blocks before deciding whether the error is cs0136 or cs0128.
1881
1882         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1883         (using_alias_directive, using_namespace_directive): Pass
1884         MemberName, not an expression to Namespace.UsingAlias and
1885         Namespace.Using.
1886         (MakeName): Use the MemberName of the namespace.
1887         * namespace.cs (Namespace.MemberName): New.
1888         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1889         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1890         Likewise.
1891         * decl.cs (MemberName.Name): Make readonly.
1892         (MemberName.FromDotted): New "constructor".
1893         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1894         (MemberCore.Name): Compute from MemberName on demand.
1895         (MemberCore.SetMemberName): Provide a way to change the
1896         MemberName.
1897         (MemberCore.AddToContainer): Don't take a fullname parameter.
1898         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1899         fully qualified name of the container to the member name.
1900         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1901         only if the type is a member of the root container.
1902         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1903         MemberName.Left rather than searching for an embedded ".".
1904         (PartialContainer.CreatePart): Update to changes in RootContext.
1905         (MemberBase.ShortName): Turn into a property.  Use
1906         MemberCore.SetMemberName.
1907         (MemberBase.ExplicitInterfaceName): Remove.
1908         (MemberBase.UpdateMemberName): Remove.
1909         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1910         (PropertyBase.SetMemberName): New override.
1911         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1912         (Tree.GetDecl): New.
1913         (Tree.AllDecls): Rename from Decls.
1914         * attribute.cs, enum.cs, report.cs: Update to changes.
1915         * driver.cs (MainDriver): Use MemberName.FromDotted on
1916         RootContext.MainClass.
1917
1918 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1919
1920         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1921         checks.
1922
1923         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1924
1925 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1926
1927         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1928         property accessor modifiers.
1929
1930         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1931         fixed buffer attribute (CS1716).
1932         (PropertyMethod.HasCustomAccessModifier): When property accessor
1933         has custom modifier.
1934
1935         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1936         modifiers.
1937         (PropertyExpr.DoResolveLValue): Add CS0272.
1938
1939 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1940
1941         * convert.cs: When converting to a pointer, use the proper Conv.U
1942         or Conv.I depending on the source data type.
1943
1944         * cs-tokenizer.cs: Make the size for large decimal constants,
1945         fixes #72957.
1946
1947 2005-03-17  Martin Baulig  <martin@ximian.com>
1948
1949         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1950         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1951
1952 2005-03-17  Martin Baulig  <martin@ximian.com>
1953
1954         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1955         to bool so we can return an error condition.
1956         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1957         returned an error.
1958
1959 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1960
1961         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1962         attributes.
1963
1964 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1965
1966         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1967         Refactor to avoid traversing the list of assemblies, and to avoid
1968         string concatenation.
1969         * typemanager.cs (guid_attr_type): Remove.
1970         (negative_hits, pointers, references): Remove hashes.
1971         (type_hash): New.
1972         (GetConstructedType): New.  Uses type_hash to handle constructed
1973         types (arrays, references, pointers).
1974         (GetReferenceType, GetPointerType): Use it.
1975         (GetNestedType): New.  Uses type_hash to handle nested types of
1976         reflected types.
1977         (LookupType, LookupTypeDirect): Remove.
1978         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1979         'types' hash and LookupTypeReflection directly.
1980         (params_string, params_object): Use GetConstructedType.
1981         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1982         top-level types.
1983         (Namespace.Lookup): Use cached_types.
1984         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1985         provided by old TypeManager.LookupType.
1986         * rootcontext.cs (MakeFQN): Remove.
1987         * decl.cs (DeclSpace.MakeFQN): Likewise.
1988         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1989         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1990         TypeManager.GetConstructedType.
1991         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1992
1993 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1994
1995         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
1996         indexers.
1997
1998         * cs-parser.jay: Reports CS1527 for any namespace element.
1999
2000         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2001         Added CS0407.
2002
2003         * expression.cs (ParameterReference.IsAssigned): Changed error to
2004         CS0269.
2005         (Error_WrongNumArguments): Moved CS0245 detection here.
2006
2007         * statement.cs (Return.Resolve): Add CS1622 report.
2008
2009 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2010
2011         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2012
2013 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2014
2015         * attribute.cs expression.cs: Get rid of some allocations.
2016
2017 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2018
2019         * doc.cs : just eliminate the latest change.
2020
2021 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2022
2023         * doc.cs : commented out the latest change. It breaks xml-030.cs
2024
2025 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2026
2027         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2028           fail. So invoke CreateType() in FindDocumentedType().
2029
2030 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2031
2032         * cs-tokenizer.cs : added IsKeyword().
2033         * doc.cs : Detect keyword incorrectly used as identifier.
2034           Allow identifiers prefixed by @.
2035
2036 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2037
2038         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2039         It caused exception in namespace resolving (again!).
2040         
2041         * class.cs (Class.ctor): Removed exit.
2042         (PropertyMethod.ctor): ditto.
2043         
2044         * codegen.cs (Codegen.Reset): Reset static data.
2045         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2046         
2047         * cs-tokenizer.cs (Cleanup): Removed.
2048         
2049         * driver.cs (GetSystemDir): Rewrote to one line command.
2050         It caused problem with unloaded dynamic modules.
2051         (UnixParseOption): Removed Exit.
2052         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2053         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2054         Now can be mcs used as library.
2055         
2056         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2057         empty location.
2058         
2059         * location.cs (Reset): Reset static data.
2060         
2061         * namespace.cs (Reset): Reset static data.
2062         
2063         * report.cs (Report.Reset): Reset static data.
2064         
2065         * rootcontext.cs (RootContext.Reset): Reset static data.
2066         
2067         * tree.cs (RootTypes.ctor): Use Location.Null
2068         
2069         * typemanager.cs (TypeManager.Reset): Reset static data.
2070         (CoreLookupType): Removed Exit.
2071         (TypeHandle.Reset): Reset static data.
2072         
2073 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2074
2075         Fix #73516.
2076         * typemanager.cs (ComputeNamespaces): Import namespaces from
2077         referenced modules too.
2078
2079 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2080
2081         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2082         than '.'.
2083
2084 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2085
2086         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2087         enclosing DeclSpace.  This ensures that a name-lookup populates
2088         more caches and there are fewer 'TypeExpression's.  Carve out
2089         nested type lookup into ...
2090         (LookupNestedTypeInHierarchy): ... this.
2091
2092 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2093
2094         Clean up a few partial-class semantics.  
2095         Fixes test-357.cs and cs1618-2.cs.
2096         * cs-parser.jay (struct_declaration): Use 'current_class' as
2097         parent of newly-created struct.  Remove call to Register ().
2098         Use 'pop_current_class' to complete handing the current struct.
2099         (interface_declaration): Likewise.
2100         (class_declaration): Likewise.
2101         (enum_declaration): Use 'current_class' as parent of newly created
2102         enum.
2103         (delegate_declaration): Likewise.
2104         (pop_current_class): New function.  This is used to handle closing
2105         up the 'current_class' and 'current_container', and pointing them
2106         to the enclosing class/container.
2107         (CSharpParser): Initialize 'current_class' too.
2108         * decl.cs (MemberCore): Add check for invariant: a partial
2109         container is not a parsed entity, and thus does not enclose any
2110         parsed members.
2111         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2112         (DeclSpace.BaseTypeExpr): Use it.
2113         (DeclSpace.LookupType): Add check for invariant.
2114         * class.cs (TypeContainer): Add check for invariant: a nested
2115         class should have the same NamespaceEntry as its enclosing class.
2116         (TypeContainer.EmitFieldInitializers): Make virtual.
2117         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2118         MemberCore.
2119         (TypeContainer.Register): Remove.
2120         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2121         null.  Use TypeResolveEmitContext for resolving base types and
2122         interfaces.  Move initialization of Parts.TypeBuilder here from
2123         ...
2124         (TypeContainer.DefineNestedTypes): ... here.
2125         (PartialContainer): Take a Namespace not a NamespaceEntry.
2126         (PartialContainer.Create): Don't use Register.  Call the
2127         appropriate Add... function directly.
2128         (ClassPart): Take both the PartialContainer and the enclosing
2129         class as constructor arguments.
2130         (ClassPart.EmitFieldInitializers): Override.
2131         (ClassPart.PartFindNestedTypes): Remove.
2132         (FieldBase.GetInitializerExpression): Resolve the initializer
2133         expression in the emit context of the enclosing class.
2134         * tree.cs (RootTypes): Remove Register ().
2135         
2136 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2137
2138         * cs-parser.jay: Removed CS0134.
2139         
2140         * driver.cs: Removed CS1901.
2141         
2142         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2143         for predefined types.
2144
2145 2005-03-07  Duncan Mak  <duncan@novell.com>
2146
2147         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2148         well. Fixes bug #73454.
2149
2150 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2151
2152         * cs-tokenizer.cs (xtoken): Add CS1035.
2153         
2154         * class.cs (MethodData.Define): Add CS0683.
2155         (FieldMember.ctor): Add CS0681.
2156
2157 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2158
2159         * ecore.cs (SimpleName.DoResolve): Rename from
2160         SimpleName.DoResolveAllowStatic.
2161         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2162         Pass 'intermediate' flag to MemberStaticCheck.
2163         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2164         of "intermediate" lookups via MemberAccess.
2165         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2166         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2167
2168 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2169
2170         Fix #73394.
2171         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2172         slipped in because of variable names that are identical to a
2173         builtin type's BCL equivalent ('string String;', 'int Int32;').
2174         (PropertyExpr.EmitInstance): Likewise.
2175
2176 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2177
2178         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2179         
2180         * report.cs (warning_ignore_table): Made public.
2181
2182 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2183
2184         Fix #73282.
2185         * class.cs (MethodData.Emit): Pass 'container' to
2186         container.GetObsoleteAttribute instead of 'container.Parent'.
2187
2188 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2189
2190         * cs-parser.jay: Add 1534 error test.
2191
2192         * iterators.cs (Yield.CheckContext): Add error 1629.
2193         (Iterator.ctor): Save unsafe modifier.
2194         (MoveNextMethod.DoEmit): Restore unsafe context.
2195
2196         * namespace.cs (UsingAlias): Better error message.
2197
2198 2005-03-03  Dan Winship  <danw@novell.com>
2199
2200         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2201         the warning message [#73219]
2202
2203 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2204
2205         Fix compile with MCS 1.0.0.0.
2206         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2207         w_restore to not depend on string constant folding.
2208
2209 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2210
2211         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2212         CS0246 check to users who passed 'silent = false'.
2213         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2214         check.
2215         (SimpleName.SimpleNameResolve): Update.
2216         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2217         (MemberAccess.IdenticalNameAndTypeName): Update.
2218         * doc.cs (FindDocumentedTypeNonArray): Update.
2219
2220 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2221
2222         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2223         * parameters.cs (ComputeAndDefineParameters): Remove.
2224         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2225         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2226         Use GetParameterInfo.
2227
2228 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2229
2230         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2231
2232 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2233
2234         Unify DeclSpace.LookupType and DeclSpace.FindType.
2235         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2236         is in charge of defining nested types on demand.
2237         (DeclSpace.LookupType): Use it when the current_type is a
2238         TypeBuilder.  Use LookupTypeDirect for reflected types.
2239         (DeclSpace.FindType): Remove.
2240         (DeclSpace.LookupInterfaceOrClass): Likewise.
2241         (DeclSpace.DefineTypeAndParents): Likewise.
2242         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2243         DeclSpace.LookupType.
2244         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2245         * typemanager.cs (LookupType): Simplify.
2246         (AddUserType): Remove type from negative_hits.
2247         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2248         * class.cs (TypeContainer.FindMembers): Move handling of nested
2249         types ...
2250         (TypeContainer.FindMembers_NestedTypes): ... here.
2251         (TypeContainer.FindNestedType): Implement override.
2252         (ClassPart.FindNestedType): Delegate to PartialContainer.
2253         (ClassPart.PartFindNestedType): Looks up the nested types of the
2254         part alone.
2255
2256 2005-03-02  Martin Baulig  <martin@ximian.com>
2257
2258         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2259         static constructor in static classes.
2260
2261 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2262
2263         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2264         sizeParamIndex is not specified.
2265
2266 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2267
2268         Fix #73117
2269         * report.cs (WarningMessage.IsEnabled): Missing null check.
2270
2271 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2272
2273         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2274         in the fields and not in the properties.
2275
2276 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2277
2278         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2279         fields as well.
2280
2281 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2282
2283         * attribute.cs: Small refactoring (improved robustness).
2284         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2285         (ValidateGuid): Removed.
2286         (Resolve): Removed referenced to above mentioned.
2287         (GetAttributeUsage): Made private and changed to work without
2288         class assistance.
2289         (GetIndexerAttributeValue): Don't crash.
2290         (GetConditionalAttributeValue): Ditto.
2291         (GetClsCompliantAttributeValue): Ditto.
2292         (ExtractSecurityPermissionSet): All attributes exceptions are
2293         error 648.
2294         (GetPropertyValue): New helper.
2295         (GetMethodImplOptions): New method.
2296         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2297         some missing properties.
2298         
2299         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2300         (Method.ApplyAttributeBuilder): Updated.
2301         
2302         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2303         exception.
2304
2305 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2306
2307         Fix #73052.
2308         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2309         non-simple types (array, pointer, reference).
2310
2311 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2312
2313         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2314
2315         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2316         for operators.
2317         (Method.CheckBase): Catch wrong destructor here.
2318         (MethodData.Define): Add errors 550, 668.
2319
2320         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2321
2322         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2323
2324         * pending.cs (VerifyPendingMethods): Add error 551.
2325
2326         * typemanager.cs (CSharpName): Next error report helper.
2327
2328 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2329
2330         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2331         attributes. Removed useless attribute double check.
2332         It saves almost 2MBs for corlib.
2333
2334 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2335
2336         Fix #72924.
2337         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2338         called twice in case of error.
2339
2340 2005-02-23  Chris Toshok  <toshok@ximian.com>
2341
2342         Fix compiler portions of #72827.
2343         * statement.cs (Block.Emit): call Begin/EndScope on the
2344         EmitContext instead of the ILGenerator.
2345
2346         * codegen.cs (EmitContext.BeginScope): new method, call
2347         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2348         we have one.)
2349         (EmitContext.BeginScope): same, but EndScope and CloseScope
2350
2351         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2352         offset and call the superclass's OpenScope(int) with it.
2353         (SymbolWriter.CloseScope): get the current il
2354         offset and call superclass's CloseScope(int) with it.
2355
2356 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2357
2358         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2359         CS1677 for out and ref as well.
2360
2361         * class.cs (Method.Define): Add error CS1599 detection.
2362         
2363         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2364         
2365         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2366         
2367         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2368         
2369         * support.cs.cs (ModifierDesc): New helper method.
2370
2371 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2372             Abin Thomas  <projectmonokochi@rediffmail.com>
2373             Anoob V E  <projectmonokochi@rediffmail.com>
2374             Harilal P R  <projectmonokochi@rediffmail.com>
2375
2376         Fix #57851, #72718.
2377         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2378         MemberLookup (used for error reporting) actually returns a result.
2379         Fix error report number (122, not 112).
2380
2381 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2382             Anoob V E  <projectmonokochi@rediffmail.com>
2383             Harilal P R  <projectmonokochi@rediffmail.com>
2384
2385         Fix #71134.
2386         * pending.cs (PendingImplementation.GetAbstractMethods):
2387         Find NonPublic members too.
2388
2389 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2390
2391         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2392         Fixed error 217.
2393         
2394         * class.cs (MethodCore.CheckMethodAgainstBase):
2395         Add error 239 report.
2396
2397 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2398
2399         Fix #68955.
2400         * expression.cs (Invocation.IsApplicable): Make public.
2401         (Invocation.IsParamsMethodApplicable): Likewise.
2402         * delegate.cs (Delegate.VerifyApplicability): Don't use
2403         Invocation.VerifyArgumentCompat for parameter applicability
2404         testing.  Use Invocation.IsApplicable and
2405         Invocation.IsParamsMethodApplicable.
2406
2407 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2408
2409         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2410         
2411         * class.cs (Operator.Define): Add error 217 report.
2412         
2413 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2414
2415         * namespace.cs (UsingEntry.Resolve): Undo change below.
2416
2417 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2418
2419         Fix #72756.
2420         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2421         disable the error message when the extended MemberLookup also
2422         fails.
2423         (Expression.MemberLookupFinal): Update.
2424         (SimpleName.DoSimpleNameResolve): Update.
2425         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2426         Don't use MemberLookupFinal.
2427         (New.DoResolve): Update.
2428         (BaseAccess.CommonResolve): Update.
2429
2430 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2431
2432         Fix #72732.
2433         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2434         occured previously, don't resolve again.
2435
2436 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2437
2438         Fix #69949
2439         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2440         argument. Call ResolveAttributeUsage for unresolved.
2441         when types doesn't match ctor arguments.
2442         
2443         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2444         for nested attribute classes.
2445         (Class.attribute_usage): Removed.
2446         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2447         for attribute class.
2448         
2449         * ecore.cs (IsAttribute): Removed.
2450         
2451         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2452         
2453         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2454         now normal types.
2455         (attribute_types): Removed.
2456         (EmitCode): Global attributes are emited as the latest.
2457
2458 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2459
2460         * class.cs (EmitFieldInitializers): Don't emit field initializer
2461         for default values when optimilization is on.
2462         
2463         * constant.cs (Constant.IsDefaultValue): New property.
2464         
2465         * driver.cs: Add /optimize handling.
2466         
2467         * constant.cs,
2468         * ecore.cs,
2469         * literal.cs: Implement new IsDefaultValue property.
2470         
2471         * rootcontext.cs (Optimize): New field, holds /optimize option.
2472
2473 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2474
2475         Fix crasher in re-opened #72347.
2476         * namespace.cs (Namespace.Lookup): Return null if
2477         DeclSpace.DefineType returns null.
2478
2479         Fix #72678.
2480         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2481
2482 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2483
2484         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2485         now returns null if it cannot resolve to an lvalue.
2486         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2487         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2488         returned null.  Remove check for SimpleName.
2489         (EventExpr.DoResolveLValue): New.
2490         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2491         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2492         error from ...
2493         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2494         avoid CS0131 error.
2495         (Unary.ResolveOperator): Move CS0211 check ...
2496         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2497         CS0131 error.
2498         (Unary.DoResolveLValue): Simplify.
2499         (AddressOf.DoResolveLValue): New.
2500         (ArrayAccess.DoResolveLValue): New.
2501
2502 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2503
2504         * attribute.cs (Attribute.Resolve): Add arguments casting for
2505         when types doesn't match ctor arguments.
2506
2507 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2508
2509         Fix parts of #63202.
2510         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2511         lookup of operator in base type.  Ensure that all checks happen
2512         when the operator resolves to an "op_..." method.
2513
2514 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2515
2516         Fix #71992.
2517         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2518         'ignore_cs0104' parameter.  Pass it to ...
2519         (NamespaceEntry.Lookup): ... this.
2520         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2521         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2522         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2523         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2524         Update.  Request that cs0104 errors be ignored.
2525         (ComposedCast.ResolveAsTypeStep): Update.
2526
2527 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2528
2529         Fix #59209.
2530         * expression.cs (Invocation.BetterFunction): Remove support for
2531         comparing virtual functions and their overrides.
2532         (Invocation.IsOverride): New.
2533         (Invocation.OverloadResolve): Don't consider 'override' functions
2534         during candidate selection.  Store them in a lookaside list.
2535         If the selected method is a 'virtual' function, use the list to
2536         find any overrides that are closer to the LHS type.
2537
2538 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2539
2540         * expression.cs (New.DoResolve): Add complex core type reduction.
2541         (New.Constantify): Converts complex core type syntax like 'new int ()'
2542         to simple constant.
2543         
2544 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2545
2546         * decl.cs (EntryType.EntryType): New constructor to create an
2547         updated copy of a cache entry.
2548         (MemberCache.AddMethods): Use it.
2549         (MemberCache.ClearDeclaredOnly): Remove.
2550         (MemberCache.MemberCache): Update.
2551
2552 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2553
2554         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2555         variable.  This one is represents the actual low-level declaration
2556         of the method, as opposed to the semantic level `IsStatic'.   
2557
2558         An anonymous method which is hosted into a static method might be
2559         actually an instance method.  IsStatic would reflect the
2560         container, while MethodIsStatic represents the actual code
2561         generated.
2562
2563         * expression.cs (ParameterReference): Use the new MethodIsStatic
2564         instead of IsStatic.
2565
2566         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2567         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2568         set on the current EmitContext. 
2569
2570         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2571         resolve our casted expression as an LValue.  This triggers the
2572         proper LValue processing that is later required by Assign.
2573
2574         This fixes 72347.
2575
2576         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2577
2578 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2579
2580         C# 2.0 Fixed buffer implementation
2581
2582         * anonymous.cs: Update after RegisterHelperClass renaming.
2583
2584         * attribute.cs (AttributeTester.fixed_buffer_cache):
2585         Cache of external fixed buffers.
2586         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2587         implementation if field is fixed buffer else null.
2588
2589         * class.cs
2590         (TypeContainer.AddField): Accept FieldMember instead of Field.
2591         (FieldBase.IsFieldClsCompliant): Extracted code from
2592         VerifyClsCompliance descendant customization.
2593         (FixedField): New class handles fixed buffer fields.
2594         (FixedFieldExternal): Keeps information about imported fixed
2595         buffer.
2596         (IFixedField): Make access to internal or external fixed buffer
2597         same.
2598
2599         * cs-parser.jay: Add fixed buffer parsing.
2600
2601         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2602         buffer.
2603
2604         * expression.cs (Indirection): Extended implementation to accept
2605         fixed buffer field.
2606         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2607         (ElementAccess.MakePointerAccess): Get type as parameter.
2608         (DoResolve): Add fixed buffer field expression conversion.
2609         (DoResolveLValue): Ditto.
2610         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2611         (ArrayPtr): Derives from FixedBufferPtr.
2612         (ArrayPtr.Emit): Add extra emit for array elements.
2613
2614         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2615
2616         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2617         for compiler generated types.
2618         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2619
2620         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2621         and consume less memory.
2622         (Fixed.Resolve): Add fixed buffer case.
2623
2624         * typemanager.cs (compiler_generated_attr_ctor,
2625         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2626         (HasElementType): Add our own implementation to work on every
2627         runtime.
2628
2629 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2630
2631         * anonymous.cs (CaptureContext): Track whether `this' has been
2632         referenced.   
2633
2634         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2635         only captured `this' if it was implicitly done (instance
2636         methods/variables were used). 
2637
2638         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2639         `this' must be captured.
2640
2641 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2642  
2643         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2644         is null it means that there has been no need to capture anything,
2645         so we just create a sibling.
2646
2647         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2648
2649         Just a partial fix.  The other half is fairly elusive.
2650         
2651 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2652
2653         Fix #52586, cs0121-4.cs.
2654         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2655         and return a hashtable.
2656         (MemberCache.ClearDeclaredOnly): New.
2657         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2658         the method_hash of a base type too.
2659         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2660         type methods.  Overwrite entries with the same MethodHandle so
2661         that the ReflectedType is correct.  The process leaves in base
2662         virtual functions and their overrides as distinct entries.
2663         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2664         matters since it was boxed in a ArrayList before.
2665         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2666         modifier.
2667         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2668         case of a virtual function and its override (choose the overload
2669         as better).
2670         (Invocation.OverloadResolve): Avoid 'override' members during
2671         'applicable_type' calculation.
2672
2673 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2674
2675         Combine two near-redundant caches.
2676         * typemanager.cs (method_params): Rename from method_internal_params.
2677         (TypeManager.GetParameterData): New.  Replace
2678         Invocation.GetParameterData.
2679         (TypeManager.LookupParametersByBuilder): Remove.
2680         * expression.cs (Invocation.method_parameter_cache): Remove.
2681         (Invocation.GetParameterData): Remove.
2682         Update to changes.
2683         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2684         Update to changes.
2685
2686 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2687
2688         Fix #72015.
2689         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2690         TypeManager.multicast_delegate_type is null, resolve it by looking
2691         up "System.MulticastDelegate".
2692         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2693
2694 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2695             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2696             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2697
2698         Fix cs0164.cs.
2699         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2700         (LabeledStatement.AddReference): New.  Set 'referenced'.
2701         (Goto.Resolve): Use it.
2702
2703 2005-02-05  John Luke  <john.luke@gmail.com>
2704
2705         * driver.cs: remove duplicate -doc line in Usage ()
2706
2707 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2708
2709         * location.cs (Location.AddFile): Fix CS2002 error report.
2710
2711 2005-02-02  Martin Baulig  <martin@ximian.com>
2712
2713         * delegate.cs (Delegate.DefineType): Report an internal error if
2714         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2715         details.        
2716
2717 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2718
2719         Fix a crasher in a variant of #31984.
2720         * const.cs (Constant.CheckBase): New override that defers the
2721         new-or-override check in case the base type hasn't been populated
2722         yet.
2723         (Constant.Define): Ensure the new-or-override check is performed.
2724
2725 2005-02-01  Duncan Mak  <duncan@ximian.com>
2726
2727         * const.cs (LookupConstantValue): Check that `ce' is not null
2728         before calling GetValue ().
2729
2730 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2731
2732         Fix test-334.cs (#69519).
2733         * cs-parser.jay (using_alias_directive): Pass in an expression to
2734         NamespaceEntry.UsingAlias.
2735         (using_namespace_directive): Pass in an expression to
2736         NamespaceEntry.Using.
2737         (namespace_name): Don't flatten to a string.
2738         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2739         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2740         ResolveAsTypeStep.
2741         (NamespaceEntry.UsingEntry): Likewise.
2742         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2743         changes.
2744         (NamespaceEntry.LookupForUsing): Remove.
2745         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2746         names.
2747         (NamespaceEntry.Lookup): Remove support for dotted names.
2748
2749 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2750
2751         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2752         split into two.
2753         (NamespaceEntry.ImplicitParent): Compute on demand.
2754         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2755         parallels the current.
2756         (NamespaceEntry.LookupForUsing): Use it.
2757         (NamespaceEntry.Lookup): If the current namespace-entry is
2758         implicit, don't search aliases and using tables.
2759
2760 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2761
2762         Fix #31984.
2763         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2764         BaseCache here.
2765         (TypeContainer.BaseCache): Compute on demand.
2766         (TypeContainer.FindMembers): Define constants and types if they're
2767         not already created.
2768         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2769         check.
2770         * const.cs (Constant.Define): Make idempotent.
2771
2772 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2773
2774         * pending.cs: Produce better code (no nops produced by using Ldarg
2775         + value).
2776         
2777         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2778         i - 1' it should be arg + 1.
2779
2780         Fixes bug #71819.
2781
2782 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2783
2784         * attribute.cs (Attribute.CheckAttributeType): Make private
2785         non-virtual.
2786         (Attribute.ResolveType): Make virtual.
2787         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2788         handling of RootContext.Tree.Types.
2789
2790 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2791
2792         Update attribute-handling to use the SimpleName/MemberAccess
2793         mechanisms.
2794         * cs-parser.jay (attribute): Pass in an expression to the
2795         constructors of Attribute and GlobalAttribute.
2796         * attribute.cs (Attribute): Take an expression for the name.
2797         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2798         passed in attribute name expression.
2799         (Attribute.CheckAttributeType): Use it.
2800         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2801         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2802         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2803         argument to prevent error messages if the lookup fails.
2804
2805 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2806
2807         * expression.cs (Indirection): Implemented IVariable interface
2808         to support indirection in AddressOf operator.
2809         (PointerArithmetic.Emit): Add optimalization for case where
2810         result can be precomputed.
2811
2812 2005-01-26  Martin Baulig  <martin@ximian.com>
2813
2814         * class.cs (TypeContainer.AttributeTargets): Return the correct
2815         AttributeTargets depending on our `Kind' instead of throwing an
2816         exception; fixes #71632.
2817
2818 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2819
2820         Fix #71257
2821         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2822         constant members.
2823
2824 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2825
2826         Fix #71602.
2827         * expression.cs (MemberAccess.DoResolve): Don't complain with
2828         cs0572 when the LHS of a member access has identical name and type
2829         name.
2830
2831 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2832
2833         Fix #71651, #71675
2834         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2835         CreatePermission.
2836         Create custom PermissionSet only for PermissionSetAttribute.
2837
2838 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2839
2840         Fix #71649
2841         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2842         delegates in static class.
2843
2844 2005-01-24  Martin Baulig  <martin@ximian.com>
2845
2846         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2847         merging an implicit block, just use its reachability.
2848
2849         * statement.cs (Block.Resolve): Make the unreachable code check
2850         work wrt. implicit blocks; see test-337 from #63842.
2851
2852 2005-01-21  Alp Toker  <alp@atoker.com>
2853  
2854         * cs-parser.jay: destructor_declaration's container is PartialContainer
2855         not Class when partial types are used, so use Kind prop instead of
2856         'is'.
2857         
2858 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2859
2860         * cs-parser.jay: Improve error reporting when an interface
2861         declares new types.
2862
2863 2005-01-20  Dick Porter  <dick@ximian.com>
2864
2865         * support.cs: SeekableStreamReader fix from Sandor Dobos
2866         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2867         chars are read.  Fixes bug 70369.
2868
2869 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2870
2871         * cs-parser.jay (catch_clause): Simplify current_block handling
2872         somewhat.
2873
2874 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2875
2876         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2877         code with ImplicitStandardConversion to handle the implicit
2878         conversion of method groups into valid delegate invocations. 
2879
2880         The problem is that in parameter handling we were using this code
2881         path.  Fixes bug #64698
2882
2883 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2884
2885         * cs-parser.jay: Fix several infelicities.
2886         - Avoid assigning to the parser value stack.  Code like 
2887           '$3 = null' is unclean.  Synthesize a value for the code block
2888           instead. 
2889         - Avoid using oob_stack for storing location information.  Use ...
2890         (_mark_): ... this.  New (empty) rule.  Saves the current location
2891         in $$.
2892         (foreach_statement): Avoid using oob_stack for current_block
2893         handling.  Use technique used in for_statement and
2894         using_statement.  Synthesize a value for the code block to store
2895         additional intermediate information.
2896
2897 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2898
2899         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2900         of a different type is only allowed to private fields of a
2901         containing type, not on fields of a base class.
2902
2903         See test-174.cs and error cs0122-9.cs
2904
2905 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2906
2907         Fix test-335.cs (bug #58126).
2908         * cs-parser.jay (argument): Split out non-expression parts of the
2909         rule into 'non_simple_argument'.
2910         (invocation_expression): Support parenthesized invocations with
2911         multiple arguments, and with single non-simple arguments.
2912
2913 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2914
2915         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2916         places.
2917
2918 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2919
2920         Fix cs0038-1.cs, cs1640-6.cs.
2921         * ecore.cs (Expression.Resolve): Remove special-case for
2922         SimpleName in error-handling.
2923         (Expression.almostMatchedMembers): Relax access permission to
2924         protected.
2925         (Expression.MemberLookupFailed): Handle duplicates in
2926         almostMatchedMembers list.
2927         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2928         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2929         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2930         overload if the passed in MemberInfo is a MethodBase.
2931
2932 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2933
2934         Fix #70749
2935         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2936         for non-CAS & merge permission sets properly.
2937
2938 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2939
2940         Improve standard-compliance of simple name and member access 
2941         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2942         * ecore.cs (FullNamedExpression): New abstract base class 
2943         for Namespaces and TypeExpressions.
2944         (ResolveFlags.SimpleName): Remove.
2945         (SimpleName): Remove support for dotted names.
2946         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2947         DeclSpace.FindType and DeclSpace.LookupType.
2948         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2949         (Expression.ExprClassName): Make member function.
2950         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2951         a namespace.  Remove creation of dotted "SimpleName"s.
2952         (MemberAccess.DoResolve): Likewise.
2953         * decl.cs (DeclSpace.Cache): Make private.
2954         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2955         (DeclSpace.FindType): Update.
2956         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2957         FullNamedExpression.
2958         * namespace.cs (Namespace): Derive from FullNamedExpression
2959         so that it can be part of expression resolution.
2960         (Namespace.Lookup): Return an FullNamedExpression.
2961         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2962         namespace.
2963         * rootcontext.cs (NamespaceLookup): Remove.
2964         (LookupType): Move to DeclSpace.
2965         * attribute.cs (CheckAttributeType): Update.
2966         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2967         (FindDocumentedTypeNonArray): Likewise.
2968
2969 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2970
2971         Fix cs0509.cs, cs1632.cs.
2972         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2973         is the same as IsInterface.
2974         (TypeContainer.GetClassBases): Likewise.
2975         * statement.cs (LabeledStatement.ig): New field.
2976         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2977         label.
2978         (LabeledStatement.DoEmit): Check that the label was created with
2979         the same ILGenerator.
2980
2981 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2982
2983         Fix #71058
2984         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2985         accessors to its properties.
2986
2987         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2988         from accessors to property.
2989         
2990 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2991
2992         Fix #70722
2993         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2994         only for overrides.
2995         
2996 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2997
2998         * attribute.cs: Check for null and empty strings.  
2999
3000         I have lost another battle to Paolo.
3001
3002 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3003
3004         Fix #70942
3005         * class.cs (PropertyMethod): Set Parent field in ctors.
3006         (SetMethod.InternalParameters): Add unsafe switch hack.
3007         Override MarkForDuplicationCheck where it is appropriate.
3008
3009         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3010         It says whether container allows members with the same name.
3011         Base default is no.
3012         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3013         Removed is_method parameter.
3014
3015 2005-01-06  Duncan Mak  <duncan@ximian.com>
3016
3017         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3018         because the previous change led to incorrect reporting of CS1032
3019         ("Cannot define/undefine preprocessor symbols after first token in
3020         file"). Instead of using `tokens_seen' as the only flag that
3021         triggers CS1040, introduce `comments_seen'. This new flag is used
3022         to signify having seen comments on the current line, so it is
3023         unset after a newline.
3024
3025 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3026
3027         * doc.cs : When searching for a type, find nested type too.
3028           This fixes bug #71040.
3029
3030 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3031
3032         * doc.cs :
3033           - Warn missing member comment on those classes which also does not
3034             have doc comments. Fixed bug #71041.
3035           - Don't warn missing doc comment on default constructor.
3036             Fixed bug #71042.
3037
3038 2005-01-06  Duncan Mak  <duncan@ximian.com>
3039
3040         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3041         comments, set `tokens_seen' to true. This allows us to detect
3042         misplaced preprocessor directives (i.e. not at the beginning of
3043         the a line, nor after whitespaces). In that case, report error
3044         CS1040. This fixes bug #56460.
3045
3046         * cs-parser.jay (interface_member_declaration): Add checks for
3047         IsExplicitImpl, and report CS0541 error if an interface member is
3048         defined as an explicit interface declaration.
3049
3050 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3051
3052         Fix #70817
3053         * class.cs (PropertyMethod): Set Parent field in ctors.
3054         (SetMethod.InternalParameters): Add unsafe switch hack.
3055         
3056         * decl.cs (MemberCore.Parent): Cannot be readonly.
3057
3058 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3059
3060         * decl.cs (DeclSpace.ResolveType): Remove.
3061         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3062         Merge in code from ...
3063         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3064         * class.cs, enum.cs: Update to changes.
3065
3066 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3067
3068         * anonymous.cs: Ensure that we init the scope of our parent if it
3069         has not been initialized yet.
3070
3071 2004-12-30  Duncan Mak  <duncan@ximian.com>
3072
3073         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3074         if field.FieldBuilder is null. Fixes #70758.
3075
3076         * convert.cs: Fixed some typos and updated some of the comments.
3077         (ImplicitStandardConversionExists):
3078         (TryImplicitIntConversion): If `target_type' is an interface and
3079         the type of `ic' implements this interface, return true or a new
3080         BoxedCast instead of null. This fixes #70468.
3081
3082 2004-12-29  Duncan Mak  <duncan@ximian.com>
3083
3084         * expression.cs (Argument.Emit): Check that Expr is
3085         IMemoryLocation before casting to it, and report CS1510 otherwise.
3086
3087         This fixes #70402.
3088
3089 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3090
3091         * statement.cs (Block.ThisVariable): remove the recursion here, to
3092         make the --profile more sane.
3093
3094 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3095
3096         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3097         assembly, by JB Evain.
3098
3099 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3100
3101         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3102           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3103         "parent" refers to enclosing type/class.  "base" refers to superclass.
3104
3105 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3106
3107         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3108         Ensure that we only have GlobalAttributes.
3109         * attribute.cs (Attribute.Emit): Make non-virtual.
3110         (GlobalAttribute.Emit): Remove.
3111         (Attribute.Resolve): Make virtual.
3112         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3113         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3114         the argument. Don't create one.
3115         (Attribute.GetObsoleteAttribute): Likewise.
3116         (Attribute.GetClsCompliantAttributeValue): Likewise.
3117         * class.cs, decl.cs: Update to changes.
3118
3119 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3120
3121         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3122         
3123         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3124         
3125         * statement.cs (Foreach.Resolve): Add error 186 report.
3126
3127 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3128
3129         * expression.cs (Conditional.DoResolve): Add warning 429.
3130         
3131         * statement.cs (If.Resolve): Add warning 665.
3132
3133 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3134
3135         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3136         except when in the parser, and in GlobalAttribute.
3137         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3138         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3139         RootContext.Tree.Types.NamespaceEntry once work is done.
3140         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3141         and resets RootContext.Tree.Types.NamespaceEntry.
3142
3143 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3144
3145         * cs-parser.jay: Don't create a block for every variable.
3146
3147 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3148
3149         * location.cs: Provide extra information.
3150
3151         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3152         variables from the captured environment, it is the ldarg_0.
3153
3154 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3155
3156         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3157         find a conclusion.
3158         
3159         * class.cs: Changed warning level for 169 to avoid developer
3160         displeasure from warning flooding. It will be changed back when they
3161         fix most of current BCL warnings.
3162         
3163         * RootContext.cs: Pushed default WarningLevel to 3.
3164         
3165         * statement.cs: Removed unused variable.
3166
3167 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3168
3169         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3170         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3171         Add error 502 report.
3172         (StaticClass.DefineType): Add error 441 report.
3173         (Class.AllowedModifiersProp): New virtual property as temporary
3174         extension to AllowedModifiers.
3175         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3176         to share implementation with StaticClass and don't call virtual
3177         methods from ctor.
3178         
3179         * driver.cs (MainDriver): Add error 1558 test.
3180
3181         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3182         report. Moved error 36 test here.
3183
3184         * statement.cs (Throw.Resolve): Add error 724 report.
3185
3186         * typemanager.cs: Add out_attribute_type core type.
3187         
3188 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3189
3190         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3191         3018 report.
3192         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3193
3194         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3195         3017 report.
3196         
3197         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3198
3199         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3200         Add error 3023 report.
3201         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3202
3203         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3204         implementation.
3205
3206 2004-12-12  John Luke  <john.luke@gmail.com>
3207
3208         * driver.cs (AddArgs): take -- into account when
3209         adding arguments, fixes bug 65710 
3210
3211 2004-12-12  Martin Baulig  <martin@ximian.com>
3212
3213         * expression.cs (Unary.TryReduceNegative): Added support for
3214         SByteConstant and ByteConstant.
3215         (Unary.Reduce): Check error values from TryReduceNegative().
3216
3217 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3218
3219         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3220         and report exception as error 182.
3221
3222 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3223
3224         * driver.cs (Main): Fix message when there are warnings.
3225
3226 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3227
3228         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3229
3230 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3231
3232         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3233         Reduced number of warnings.
3234         
3235         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3236
3237 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3238
3239         * driver.cs: Removed message.
3240
3241         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3242
3243 2004-12-08    <vargaz@freemail.hu>
3244
3245         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3246
3247 2004-12-08  Martin Baulig  <martin@ximian.com>
3248
3249         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3250         instead of a CS3002 for properties and indexer.
3251
3252 2004-12-08  Martin Baulig  <martin@ximian.com>
3253
3254         * decl.cs (MemberName.ToString): Make this work again.
3255
3256 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3257
3258         * attribute.cs (Resolve): Add error 591 detection.
3259
3260         * class.cs (FieldMember.Define): Add error 1547 detection.
3261         (Indexer.Define): Add error 620 detection.
3262         (Operator.Define): Add error 590 detection.
3263
3264         * ecore.cs: Missing argument for error 79.
3265
3266         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3267         detection.
3268
3269 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3270
3271         Fix #70106
3272         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3273         only.
3274
3275 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3276
3277         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3278           Some operator comments were suppressed.
3279         * doc.cs : Implicit/explicit operator name in doc comments are like
3280           "op_Explicit(type)~returnType", so added suffix handling.
3281
3282 2004-12-07  Martin Baulig  <martin@ximian.com>
3283
3284         * decl.cs
3285         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3286         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3287         (DeclSpace.ec): New protected field; store the EmitContext here.
3288         (DeclSpace.EmitContext): New public property; moved here from
3289         `TypeContainer'.
3290         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3291         EmitContext.
3292
3293         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3294         (Enum.Emit): Don't create a new EmitContext.
3295
3296         * delegate.cs (Delegate.DefineType): Always create the
3297         EmitContext.
3298
3299         * iterators.cs (Iterators.DefineIterator): Create a new
3300         EmitContext and store it in `ec'.
3301
3302 2004-08-24  Martin Baulig  <martin@ximian.com>
3303
3304         * typemanager.cs
3305         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3306         this for accessibility checks.
3307         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3308         IsNestedFamilyAccessible.
3309         (TypeManager.IsSubclassOf): New method, do what the name actually
3310         says.   
3311
3312 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3313
3314         Fix crash on cs0657-17.cs.
3315         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3316         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3317         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3318         the case where the NamespaceEntry gets overwritten.
3319
3320 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3321
3322         Fixed #69195, #56821
3323         * ecore.cs (ResolveBoolean): Tiny refactoring.
3324
3325         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3326         of right expression resolving when left is false constant and
3327         operator is LogicalAnd OR true constant and operator is LogicalOr.
3328
3329         * statement.cs (ResolveUnreachable): Always reports warning.
3330
3331 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3332
3333         * class.cs: Distinguish between 1721 and 1722 (just a little help
3334         for the programmer).
3335
3336 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3337
3338         * delegate.cs: Only allow this on new versions of the language. 
3339
3340 2004-12-02  Duncan Mak  <duncan@ximian.com>
3341
3342         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3343         Expression class.
3344         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3345         here as a static method. Take an additional bool out parameter
3346         `must_do_cs1540_check' for signaling to InstanceResolve.
3347         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3348         member field from PropertyExpr class and made it an argument of
3349         the method instead.
3350         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3351         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3352         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3353         and `remove_accessor' as well as InstanceResolve: report CS0122
3354         where applicable.
3355
3356         Fixes #70129.
3357
3358 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3359
3360         Fix test-327.cs, test-328.cs, and put in early infrastructure
3361         for eventually fixing #52697.
3362         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3363         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3364         from other methods.
3365         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3366         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3367         (VerifyUsing, error246): Update.
3368         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3369         'NamespaceEntry.LookupNamespaceOrType'.
3370
3371 2004-12-03  Martin Baulig  <martin@ximian.com>
3372
3373         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3374         method as our child, call AnonymousMethod.Compatible() on it.
3375
3376 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3377
3378         Disable XML documentation support in 'basic' profile.
3379         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3380         Redirect XmlElement to System.Object.
3381         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3382         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3383         * mcs.exe.sources: Add doc-bootstrap.cs.
3384         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3385         of doc.cs.
3386
3387 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3388
3389         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3390           comments are allowed.
3391
3392 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3393
3394         * delegate.cs: Add checks for subtypes in paramaters and return values
3395         in VerifyMethod () to add support for Covariance/Contravariance
3396         in delegates.
3397         
3398 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3399
3400         * report.cs: Remove extra closing parenthesis.
3401
3402         * convert.cs (Error_CannotImplicitConversion): If the name of the
3403         types are the same, provide some extra information.
3404
3405         * class.cs (FieldBase): Use an unused bit field from the field to
3406         encode the `has_offset' property from the FieldMember.  This saves
3407         a couple of Ks on bootstrap compilation.
3408
3409         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3410         method as our child, return the AnonymousMethod resolved
3411         expression.
3412
3413         * expression.cs (New.DoResolve): Allow return values from
3414         NewDelegate to also include AnonymousMethods.
3415
3416         Fixes #70150.
3417
3418 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3419
3420         Fix bug #70102
3421         * attribute.cs (Resolve): Improved implementation of params
3422         attribute arguments.
3423
3424         * support.cs (ParameterData): Add HasParams to be faster.
3425
3426 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3427
3428         all things are for /doc support:
3429
3430         * doc.cs: new file that supports XML documentation generation.
3431         * mcs.exe.sources: added doc.cs.
3432         * driver.cs:
3433           Handle /doc command line option.
3434           Report error 2006 instead of 5 for missing file name for /doc.
3435           Generate XML documentation when required, after type resolution.
3436         * cs-tokenizer.cs:
3437           Added support for picking up documentation (/// and /** ... */),
3438           including a new XmlCommentState enumeration.
3439         * cs-parser.jay:
3440           Added lines to fill Documentation element for field, constant,
3441           property, indexer, method, constructor, destructor, operator, event
3442           and class, struct, interface, delegate, enum.
3443           Added lines to warn incorrect comment.
3444         * rootcontext.cs :
3445           Added Documentation field (passed only when /doc was specified).
3446         * decl.cs:
3447           Added DocComment, DocCommentHeader, GenerateDocComment() and
3448           OnGenerateDocComment() and some supporting private members for
3449           /doc feature to MemberCore.
3450         * class.cs:
3451           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3452         * delegate.cs:
3453           Added overriden DocCommentHeader.
3454         * enum.cs:
3455           Added overriden DocCommentHeader and GenerateDocComment().
3456
3457 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3458
3459         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3460         unwrapping the enumeration values, chain to
3461         DoConstantNumericPromotions again, so we can promote things to the
3462         fundamental types (takes care of enums that are bytes, sbytes).
3463
3464         Fixes bug #62054.
3465
3466 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3467
3468         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3469         Fix long-standing bug in type-lookup.  Use FindType instead of
3470         LookupType when ec.ResolvingTypeTree.
3471         (Attribute.ResolveType, Attribute.Resolve)
3472         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3473         Update to changes.
3474         (Attributes.Search): Remove internal version.  Update.
3475         (Attributes.SearchMulti): Update.
3476         (Attributes.GetClsCompliantAttribute): Remove.
3477         (Attributes.GetIndexerNameAttribute): Remove.
3478         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3479         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3480         * class.cs (Indexer.Define): Likewise.
3481
3482 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3483
3484         Fix bug #68790
3485         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3486         MarshallByReference members access.
3487
3488         * expression.cs: Use CheckMarshallByRefAccess;
3489         Better error CS0197 message.
3490
3491         * report.cs: Print whole related error message.
3492
3493 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3494
3495         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3496         the current directory to help debugging.
3497
3498 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3499
3500         * class (GetClassBases): Better error 60 report.
3501         (EventProperty): Disabled warning 67 detection.
3502
3503 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3504
3505         Fix bug #60324
3506         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3507
3508         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3509         precise values.
3510
3511 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3512
3513         Fix bug #49488
3514         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3515
3516         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3517
3518 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3519
3520         * attribute.cs (Attribute.Resolve): Refine error reporting and
3521         report a cs0117 if the identifier does not exist, to distinguish
3522         from 0617 which is a miss-use of the actual identifier.
3523
3524         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3525         between cs0070 and cs0079.
3526
3527         * class.cs (MemberBase.DoDefine): When reporting a wrong
3528         accessibility level, we use MethodCore to compare instead of
3529         Method (this was a regression in some refactoring effort).
3530
3531         So now we correctly report cs0056 again.
3532
3533         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3534         testing the target_type (which was known to be object_type) and
3535         not the source type (which is anonymous_method).
3536
3537         Fixed reporting of error cs1660.
3538
3539         * expression.cs (UserCast.Source): Expose the underlying cast.
3540
3541         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3542         allowed types to find a match to int32 first (most common).
3543
3544         In addition, it ignores any ImplicitUserConversions that did an
3545         internal implicit conversion (as the switch statement allows only
3546         one integral conversion to exist).
3547
3548         * class.cs (PartialContainer.Create): rename `name' to
3549         `member_name' for clarity.  Then replace the string calls with a
3550         call to MemberName.GetPartialName, as now using
3551         MemberName.ToString is an error (this is due to the side effects
3552         it had, that were fixed in the past).
3553
3554         This will restore the error reporting on a number of partial class
3555         errors that were missusing this (and getting an exception as a
3556         results, which is now just a plain textual warning, because
3557         yyparse debug output would crash otherwise).
3558
3559 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3560
3561         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3562
3563 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3564
3565         * rootcontext.cs (LookupType): Make sure to cache lookups that
3566         don't give us a negative result. This saves about 5% of corlib
3567         compilation time.
3568
3569 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3570
3571         * report.cs (AbstractMessage.Print): messages are sent to stderr
3572
3573         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3574         non-interface in the list of interfaces (at this point, either
3575         parent was properly set, or a base class is being listed in the
3576         interfaces section).
3577
3578         This flags error 1722, and resolves the crash from bug 69259.
3579
3580 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3581
3582         * statement.cs (Using.EmitExpressionFinally): make this work right
3583         for valuetypes. Fixes 69926.
3584
3585 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3586
3587         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3588         converted to an enum" here, before we try to change the underlying
3589         type.  This code exists, but it is a different code path than the
3590         one used while encoding constants.
3591
3592         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3593         old bug: when converting from the null literal to a pointer,
3594         return an EmptyCast, not the NullLiteral.
3595
3596         This fixes #69921, the recent null_type changes probably made this
3597         bug more prominent.
3598
3599         (ImplicitReferenceConversionExists): In addition, resynchronized
3600         the code here, so it matches the same code in
3601         ImplicitReferenceConversionExists for the `from any class-type S
3602         to any interface-type T'.
3603         
3604
3605 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3606
3607         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3608
3609 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3610
3611         * cs-parser.jay: Use verbosity accordingly. 
3612
3613 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3614
3615         * expression.cs (Unary.ResolveOperator): Do not report warning;
3616         AddressOf reads from variable.
3617         
3618         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3619
3620 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3621
3622         Fix bug #69462
3623
3624         * attribute.cs (Attributable): Removed CheckTargets.
3625         (Attributes.Emit): Explicit attribute targets are tested here.
3626
3627         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3628         not enabled for interfaces.
3629
3630         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3631         (GetAssemblyName): Ouch next bug there.
3632
3633 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3634
3635         * expression.cs: Error 275 added.
3636         
3637 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3638
3639         Fix bug #69177 (Implemented decimal constant support)
3640
3641         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3642         (BinaryFold): Add DecimalConstant.
3643
3644         * const.cs (Define): Decimal constant 
3645         (is not constant.
3646         (ChangeType): Add decimal type handling.
3647         (LookupConstantValue): Don't set value for decimal type but
3648         emit DecimalConstantAttribute. Needed for constant optimization.
3649
3650         * constant.cs (ToDecimal): New method.
3651         (ConvertToDecimal): New method.
3652         (IntConstant): Implemented ConvertToDecimal.
3653         (DecimalConstant.Emit): Emit optimized version for decimals in
3654         int range.
3655
3656         * expression.cs (ResolveOperator): Changed order of constant
3657         reduction to work correctly with native types which have
3658         overloaded operators.
3659         (ResolveMemberAccess): Extract constant value from attribute
3660         for decimal type.
3661
3662         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3663
3664         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3665         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3666         (ChangeType): Decimal is special.
3667         (TypeToCoreType): Add decimal type.
3668
3669 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3670
3671         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3672         decimal types.
3673
3674 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3675
3676         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3677         test cs1667-5.cs.
3678
3679 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3680
3681         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3682
3683         * pending.cs (PendingImplementation): Grab only interfaces.
3684
3685 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3686
3687         * statement.cs (ForeachHelperMethods): Add location member and
3688         error 202 detection.
3689
3690 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3691
3692         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3693         automatically handled by executable.make.
3694         (PROGRAM): Make profile-specific.
3695
3696 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3697
3698         * expression.cs (DoResolveBase): Fixed wrong warning for out
3699         variables.
3700
3701 2004-11-18  Martin Baulig  <martin@ximian.com>
3702
3703         Merged latest changes into gmcs.  Please keep this comment in
3704         here, it makes it easier for me to see what changed in MCS since
3705         the last time I merged.
3706
3707 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3708
3709         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3710         (TypeHandle.GetMemberCache): New.
3711         (TypeHandle.TypeHandle): Update.
3712         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3713         (TypeManager.LookupParentInterfacesCache):
3714         Rename from LookupInterfaceCache.  Optimize slightly.
3715         (TypeManager.MemberLookup_FindMembers): Update.
3716         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3717         multi-type variant.
3718         (AddCacheContents): Rename from AddHashtable.
3719         * class.cs (TypeContainer.parent_container): Remove.
3720         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3721         (TypeContainer.DoDefineMembers): Don't initialize it.
3722         Update to name changes.
3723         
3724 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3725
3726         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3727         that factors the code to check access modifiers on override.  
3728
3729         (PropertyBase): Use the code here.
3730
3731         Patch from Lluis S'anchez, fixes bug #69361.
3732
3733 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3734
3735         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3736         routine that is used to report the use of a captured variable
3737         whose address has been taken.
3738
3739         There are two checks: one when variables are being captured and
3740         the other check is when the address of a variable is taken. 
3741         
3742         (because an anonymous methods might be resolved before *or* after
3743         the address has been taken) and 
3744
3745         * expression.cs (Conditional.DoResolve): Remove the special
3746         casing that Martin added to trueExpr and falseExpr being both
3747         NullLiteral.  We get the right behavior now just by introducing
3748         the null_type into the compiler. 
3749
3750         * convert.cs (ExplicitConversion): Change the code to use
3751         null_type instead of testing `expr is NullLiteral'.
3752         (ImplicitConversionStandard): use null_type too.
3753         (ImplicitReferenceConversionExists): use null_type too.
3754         (ImplicitReferenceConversion): use null_type too.
3755
3756         * literal.cs: The type of `NullLiteral' is now null_type instead
3757         of object_type. 
3758         (Resolve): Set the type here.
3759
3760         * typemanager.cs: Introduce null_type.
3761
3762 2004-11-17  Martin Baulig  <martin@ximian.com>
3763
3764         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3765         direction, like FindMembers() does.  Fixes #69546, testcase is in
3766         test-315.cs.    
3767
3768 2004-11-16  Martin Baulig  <martin@ximian.com>
3769
3770         This is based on a patch from Marek Safar, see bug #69082.
3771         Fixes bugs #63705 and #67130.
3772
3773         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3774         method; create a MemberCache for an interface type and cache the
3775         result.
3776
3777         * decl.cs (IMemberContainer.ParentContainer): Removed.
3778         (IMemberContainer.ParentCache): New property.
3779         (MemberCache.SetupCacheForInterface): Removed.
3780         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3781         to create a cache for an interface's "parent".
3782
3783         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3784         interfaces too.
3785
3786 2004-11-16  Martin Baulig  <martin@ximian.com>
3787
3788         Merged back from gmcs; these changes already went into gmcs a
3789         couple of weeks ago.
3790
3791         * typemanager.cs
3792         (TypeManager.AddUserType): Removed the `ifaces' argument.
3793         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3794         `TypeExpr []'.
3795         (TypeManager.AddUserInterface): Removed.
3796         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3797         `TypeExpr []'.
3798         (TypeManager.GetInterfaces): Likewise.
3799         (TypeManager.GetExplicitInterfaces): Likewise.
3800
3801         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3802
3803         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3804         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3805
3806 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3807
3808         * statement.cs: Avoid adding bools to a hashtable.
3809
3810 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3811
3812         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3813         calling an unsafe method from a safe location.
3814
3815 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3816
3817         Fix #69167
3818         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3819
3820 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3821
3822         * namespace.cs (VerifyUsing): use GetPartialName instead of
3823         ToString. 
3824
3825 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3826
3827         * statement.cs (Return.Resolve): Fix regression in typo: if
3828         `in_exc', we have to request a NeedReturnLabel, this was a typo
3829         introduced in the anonymous method check-in.  Fixes #69131.
3830
3831         * Indexers were using the ShortName when defining themselves,
3832         causing a regression in the compiler bootstrap when applying the
3833         patch from 2004-11-02 (first part), now they use their full name
3834         and the bug is gone.
3835
3836 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3837
3838         * driver.cs: Strip the path from the names of embedded resources. Fixes
3839         #68519.
3840
3841 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3842
3843         Fix error message regression: cs0104-2.cs.
3844         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3845         (AliasEntry.Resolve): Update.
3846         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3847         'silent' flag.
3848         (RootContext.LookupType): Update.
3849
3850 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3851
3852         * cs-parser.jay: Add support for handling accessor modifiers
3853         * class: Add support port accessor modifiers and error checking,
3854         define PropertyMethod.Define as virtual (not abstract anymore)
3855         * ecore.cs: Add checking for proeprties access with access modifiers
3856         * iterators.cs: Modify Accessor constructor call based in the modified
3857         constructor
3858 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3859
3860         * expression.cs (StringConcat): Handle being called twice,
3861         as when we have a concat in a field init with more than two
3862         ctors in the class
3863
3864 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3865
3866         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3867         special case explicit implementations, we should always produce
3868         the .property or .event declaration.
3869         
3870         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3871         since it will not return correct data if people use this
3872         unresolved in the presence of using statements (see test-313).
3873
3874         * class.cs (MethodData.Define): If we are an explicit interface
3875         implementation, set the method name to the full name of the
3876         interface plus the name of the method.  
3877
3878         Notice that using the method.MethodName.GetFullName() does not
3879         work, as it will only contain the name as declared on the source
3880         file (it can be a shorthand in the presence of using statements)
3881         and not the fully qualifed type name, for example:
3882
3883         using System;
3884
3885         class D : ICloneable {
3886                 object ICloneable.Clone ()  {
3887                 }
3888         }
3889
3890         Would produce a method called `ICloneable.Clone' instead of
3891         `System.ICloneable.Clone'.
3892
3893         * namespace.cs (Alias.Resolve): Use GetPartialName.
3894         
3895 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3896
3897         * cs-parser.jay: Add error 1055 report.
3898
3899 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3900
3901         * assign.cs (Assign.DoResolve): Only do the transform of
3902         assignment into a New if the types are compatible, if not, fall
3903         through and let the implicit code deal with the errors and with
3904         the necessary conversions. 
3905
3906 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3907
3908         * cs-parser.jay: Add error 1031 report.
3909
3910         * cs-tokenizer.cs: Add location for error 1038.
3911
3912 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3913
3914         * cs-parser.jay: Add error 1016 report.
3915
3916 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3917
3918         * cs-parser.jay: Add errors 1575,1611 report.
3919
3920 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3921
3922         * cs-parser.jay: Add error 1001 report.
3923
3924 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3925
3926         Fix #68850
3927         * attribute.cs (GetMarshal): Add method argument for
3928         caller identification.
3929
3930         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3931         agument for GetMarshal and RuntimeMissingSupport.
3932
3933 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3934
3935         * attribute.cs (ExtractSecurityPermissionSet): Removed
3936         TypeManager.code_access_permission_type.
3937
3938         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3939
3940 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3941
3942         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3943         for obsolete use of a variable here.   Fixes regression on errors
3944         cs0619-25 and cs0619-26.
3945
3946 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3947
3948         Fix #62358, implemented security attribute encoding.
3949
3950         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3951         Tests permitted SecurityAction for assembly or other types.
3952         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3953         data from SecurityPermissionAttribute to PermisionSet class.
3954
3955         * class.cs (ApplyAttributeBuilder): Added special handling
3956         for System.Security.Permissions.SecurityAttribute based types.
3957
3958         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3959         special handling for System.Security.Permissions.SecurityAttribute
3960         based types.
3961
3962         * enum.cs (ApplyAttributeBuilder): Added special handling
3963         for System.Security.Permissions.SecurityAttribute based types.
3964
3965         * parameter.cs (ApplyAttributeBuilder): Added special handling
3966         for System.Security.Permissions.SecurityAttribute based types.
3967
3968         * rootcontext.cs: Next 2 core types.
3969
3970         * typemanager.cs (TypeManager.security_permission_attr_type):
3971         Built in type for the SecurityPermission Attribute.
3972         (code_access_permission_type): Build in type.
3973
3974 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3975
3976         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3977         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3978         all of this information into
3979         EmitContext.EmitCapturedVariableInstance.
3980         
3981         * codegen.cs (EmitCapturedVariableInstance): move here the
3982         funcionality of emitting an ldarg.0 in the presence of a
3983         remapping.   This centralizes the instance emit code.
3984
3985         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3986         then emit a load of this: it means that we have reached the
3987         topmost ScopeInfo: the one that contains the pointer to the
3988         instance of the class hosting the anonymous method.
3989
3990         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3991         captures to the topmost CaptureContext.
3992
3993 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3994
3995         * expression.cs (LocalVariableReference): Move the knowledge about
3996         the iterators into codegen's EmitCapturedVariableInstance.
3997
3998 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3999
4000         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4001         all code paths return a value from an anonymous method (it is the
4002         same as the 161 error, but for anonymous methods).
4003
4004 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4005
4006         The introduction of anonymous methods in the compiler changed
4007         various ways of doing things in the compiler.  The most
4008         significant one is the hard split between the resolution phase
4009         and the emission phases of the compiler.
4010
4011         For instance, routines that referenced local variables no
4012         longer can safely create temporary variables during the
4013         resolution phase: they must do so from the emission phase,
4014         since the variable might have been "captured", hence access to
4015         it can not be done with the local-variable operations from the runtime.
4016         
4017         * statement.cs 
4018
4019         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4020         is a toplevel block.
4021
4022         (ToplevelBlock): A new kind of Block, these are the blocks that
4023         are created by the parser for all toplevel method bodies.  These
4024         include methods, accessors and anonymous methods.
4025
4026         These contain some extra information not found in regular blocks:
4027         A pointer to an optional CaptureContext (for tracking captured
4028         local variables and parameters).  A pointer to the parent
4029         ToplevelBlock.
4030         
4031         (Return.Resolve): Catch missmatches when returning a value from an
4032         anonymous method (error 1662).
4033         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4034         phase.
4035
4036         (Break.Resolve): ditto.
4037
4038         (SwitchLabel): instead of defining the labels during the
4039         resolution phase, we now turned the public ILLabel and ILLabelCode
4040         labels into methods called GetILLabelCode() and GetILLabel() that
4041         only define the label during the Emit phase.
4042
4043         (GotoCase): Track the SwitchLabel instead of the computed label
4044         (its contained therein).  Emit the code by using
4045         SwitchLabel.GetILLabelCode ().
4046
4047         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4048         whether the Local has been captured or not.
4049
4050         (LocalInfo.IsCaptured): New property, used to tell whether the
4051         local has been captured.
4052         
4053         * anonymous.cs: Vastly updated to contain the anonymous method
4054         support.
4055
4056         The main classes here are: CaptureContext which tracks any
4057         captured information for a toplevel block and ScopeInfo used to
4058         track the activation frames for various local variables.   
4059
4060         Each toplevel block has an optional capture context associated
4061         with it.  When a method contains an anonymous method both the
4062         toplevel method and the anonymous method will create a capture
4063         context.   When variables or parameters are captured, they are
4064         recorded on the CaptureContext that owns them, for example:
4065
4066         void Demo () {
4067              int a;
4068              MyDelegate d = delegate {
4069                  a = 1;
4070              }
4071         }
4072
4073         Here `a' will be recorded as captured on the toplevel
4074         CapturedContext, the inner captured context will not have anything
4075         (it will only have data if local variables or parameters from it
4076         are captured in a nested anonymous method.
4077
4078         The ScopeInfo is used to track the activation frames for local
4079         variables, for example:
4080
4081         for (int i = 0; i < 10; i++)
4082                 for (int j = 0; j < 10; j++){
4083                    MyDelegate d = delegate {
4084                         call (i, j);
4085                    }
4086                 }
4087
4088         At runtime this captures a single captured variable `i', but it
4089         captures 10 different versions of the variable `j'.  The variable
4090         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4091         recorded on a child.  
4092
4093         The toplevel ScopeInfo will also track information like the `this'
4094         pointer if instance variables were referenced (this is necessary
4095         as the anonymous method lives inside a nested class in the host
4096         type of the method). 
4097
4098         (AnonymousMethod): Expanded to track the Toplevel, implement
4099         `AnonymousMethod.Compatible' to tell whether an anonymous method
4100         can be converted to a target delegate type. 
4101
4102         The routine now also produces the anonymous method content
4103
4104         (AnonymousDelegate): A helper class that derives from
4105         DelegateCreation, this is used to generate the code necessary to
4106         produce the delegate for the anonymous method that was created. 
4107
4108         * assign.cs: API adjustments for new changes in
4109         Convert.ImplicitStandardConversionExists.
4110
4111         * class.cs: Adjustments to cope with the fact that now toplevel
4112         blocks are of type `ToplevelBlock'. 
4113
4114         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4115         insteda of standard blocks.
4116
4117         Flag errors if params arguments are passed to anonymous methods.
4118
4119         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4120         `CurrentAnonymousMethod' which points to the current Anonymous
4121         Method.  The variable points to the AnonymousMethod class that
4122         holds the code being compiled.  It is set in the new EmitContext
4123         created for the anonymous method.
4124
4125         (EmitContext.Phase): Introduce a variable and an enumeration to
4126         assist in enforcing some rules about when and where we are allowed
4127         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4128         only one that enfonces this right now).
4129
4130         (EmitContext.HaveCaptureInfo): new helper method that returns
4131         whether we have a CapturedContext initialized.
4132
4133         (EmitContext.CaptureVariable): New method used to register that a
4134         LocalInfo must be flagged for capturing. 
4135
4136         (EmitContext.CapturedParameter): New method used to register that a
4137         parameters must be flagged for capturing. 
4138         
4139         (EmitContext.CapturedField): New method used to register that a
4140         field must be flagged for capturing. 
4141
4142         (EmitContext.HaveCapturedVariables,
4143         EmitContext.HaveCapturedFields): Return whether there are captured
4144         variables or fields. 
4145
4146         (EmitContext.EmitMethodHostInstance): This is used to emit the
4147         instance for the anonymous method.  The instance might be null
4148         (static methods), this (for anonymous methods that capture nothing
4149         and happen to live side-by-side with the current method body) or a
4150         more complicated expression if the method has a CaptureContext.
4151
4152         (EmitContext.EmitTopBlock): Routine that drives the emission of
4153         code: it will first resolve the top block, then emit any metadata
4154         and then emit the code.  The split is done so that we can extract
4155         any anonymous methods and flag any captured variables/parameters.
4156         
4157         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4158         during this phase, the ILGenerator should not be used as labels
4159         and local variables declared here might not be accessible to any
4160         code that is part of an anonymous method.  
4161
4162         Exceptions to this include the temporary variables that are
4163         created by some statements internally for holding temporary
4164         variables. 
4165         
4166         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4167         metadata for a cb
4168
4169         (EmitContext.TemporaryReturn): This method is typically called
4170         from the Emit phase, and its the only place where we allow the
4171         ReturnLabel to be defined other than the EmitMeta.  The reason is
4172         that otherwise we would have to duplicate a lot of logic in the
4173         Resolve phases of various methods that today is on the Emit
4174         phase. 
4175
4176         (EmitContext.NeedReturnLabel): This no longer creates the label,
4177         as the ILGenerator is not valid during the resolve phase.
4178
4179         (EmitContext.EmitThis): Extended the knowledge in this class to
4180         work in anonymous methods in addition to iterators. 
4181
4182         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4183         code is necessary on the stack to access the instance to a local
4184         variable (the variable will be accessed as a field).
4185
4186         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4187         EmitContext.EmitAddressOfParameter): Routines to support
4188         parameters (not completed at this point). 
4189         
4190         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4191         will also remove the parameters.
4192
4193         * convert.cs (Convert): Define a `ConstantEC' which points to a
4194         null.  This is just to prefity some code that uses
4195         ImplicitStandardConversion code and do not have an EmitContext
4196         handy.
4197
4198         The idea is to flag explicitly that at that point in time, it is
4199         known that the conversion will not trigger the delegate checking
4200         code in implicit conversions (which requires a valid
4201         EmitContext). 
4202
4203         Everywhere: pass new EmitContext parameter since
4204         ImplicitStandardConversionExists now requires it to check for
4205         anonymous method conversions. 
4206
4207         (Convert.ImplicitStandardConversionExists): If the type of an
4208         expression is the anonymous_method_type, and the type is a
4209         delegate, we invoke the AnonymousMethod.Compatible method to check
4210         whether an implicit conversion is possible. 
4211
4212         (Convert.ImplicitConversionStandard): Only do implicit method
4213         group conversions if the language level is not ISO_1.
4214
4215         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4216         MethodInfo for the Invoke method.  used by Delegate and
4217         AnonymousDelegate.
4218
4219         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4220         method conversions if the target type is a delegate.
4221
4222         Removed extra debugging nops.
4223
4224         (LocalVariableReference): Turn the `local_info' into a public
4225         field. 
4226
4227         Add `prepared' field, the same hack used for FieldExprs to cope
4228         with composed assignments, as Local variables do not necessarily
4229         operate purely on the stack as they used to: they can be captured
4230         fields. 
4231
4232         Add `temp' for a temporary result, like fields.
4233
4234         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4235
4236         It now copes with Local variables that are captured and emits the
4237         proper instance variable to load it from a field in the captured
4238         case. 
4239
4240         (ParameterReference.DoResolveBase): During the resolve phase,
4241         capture parameters if we are in an anonymous method.
4242
4243         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4244         anonymous method, use the EmitContext helper routines to emit the
4245         parameter reference.
4246
4247         * iterators.cs: Set RemapToProxy to true/false during the
4248         EmitDispose class.
4249
4250         * parameters.cs (GetParameterByName): New helper method. 
4251
4252         * typemanager.cs (anonymous_method_type) a new type that
4253         represents an anonyous method.  This is always an internal type,
4254         used as a fencepost to test against the anonymous-methodness of an
4255         expression. 
4256         
4257 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4258
4259         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4260         561 report.
4261         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4262
4263 2004-10-18  Martin Baulig  <martin@ximian.com>
4264
4265         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4266         `Type' directly, but call ResolveType() on it.
4267         (Catch.Resolve): Likewise.
4268         (Foreach.Resolve): Likewise.
4269
4270 2004-10-18  Martin Baulig  <martin@ximian.com>
4271
4272         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4273         `Type' directly, but call ResolveType() on it.
4274         (Probe.DoResolve): Likewise.
4275         (ArrayCreation.LookupType): Likewise.
4276         (TypeOf.DoResolve): Likewise.
4277         (SizeOf.DoResolve): Likewise.
4278
4279 2004-10-18  Martin Baulig  <martin@ximian.com>
4280
4281         * expression.cs (Invocation.BetterFunction): Put back
4282         TypeManager.TypeToCoreType().
4283
4284 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4285
4286         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4287         the ResolveType.
4288
4289 2004-10-18  Martin Baulig  <martin@ximian.com>
4290
4291         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4292         `Type' directly, but call ResolveType() on it.
4293
4294 2004-10-18  Martin Baulig  <martin@ximian.com>
4295
4296         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4297         `Type' directly, but call ResolveType() on it.
4298         (MemberBase.DoDefine): Likewise.
4299
4300         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4301         `Type' directly, but call ResolveType() on it.
4302         (ComposedCast.DoResolveAsTypeStep): Likewise.
4303
4304         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4305         `Type' directly, but call ResolveType() on it.
4306
4307 2004-10-17  John Luke  <john.luke@gmail.com>
4308
4309         * class.cs (Operator.GetSignatureForError): use CSharpName
4310
4311         * parameter.cs (Parameter.GetSignatureForError): Returns
4312         correct name even if was not defined.
4313
4314 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4315
4316         Fix #65816.
4317         * class.cs (TypeContainer.EmitContext): New property.
4318         (DefineNestedTypes): Create an emitcontext for each part.
4319         (MethodCore.DoDefineParameters): Use container's emitcontext.
4320         Pass type array to InternalParameters.
4321         (MemberBase.DoDefine): Use container's emitcontext.
4322         (FieldMember.Define): Likewise.
4323         (Event.Define): Likewise.
4324         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4325         Pass type array to InternalParameters.
4326         (SetIndexerMethod.GetParameterInfo): Likewise.
4327         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4328         * delegate.cs (Define): Pass emitcontext to
4329         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4330         array to InternalParameters.
4331         * expression.cs (ParameterReference.DoResolveBase): Pass
4332         emitcontext to GetParameterInfo.
4333         (ComposedCast.DoResolveAsTypeStep): Remove check on
4334         ec.ResolvingTypeTree.
4335         * parameter.cs (Parameter.Resolve): Change argument to
4336         EmitContext.  Use ResolveAsTypeTerminal.
4337         (Parameter.GetSignature): Change argument to EmitContext.
4338         (Parameters.ComputeSignature): Likewise.
4339         (Parameters.ComputeParameterTypes): Likewise.
4340         (Parameters.GetParameterInfo): Likewise.
4341         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4342         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4343         * support.cs (InternalParameters..ctor): Remove variant that takes
4344         a DeclSpace.
4345         * typemanager.cs (system_intptr_expr): New.
4346         (InitExpressionTypes): Initialize it.
4347
4348 2004-10-12  Chris Toshok  <toshok@ximian.com>
4349
4350         * cs-parser.jay: fix location for try_statement and catch_clause.
4351
4352 2004-10-11  Martin Baulig  <martin@ximian.com>
4353
4354         * report.cs: Don't make --fatal abort on warnings, we have
4355         -warnaserror for that.
4356
4357 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4358
4359         More DeclSpace.ResolveType avoidance.
4360         * decl.cs (MemberCore.InUnsafe): New property.
4361         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4362         with newly created EmitContext.
4363         (FieldMember.Define): Likewise.
4364         * delegate.cs (Delegate.Define): Likewise.
4365         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4366         only if normal name-lookup fails.
4367         (TypeExpr.DoResolve): Enable error-checking.
4368         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4369         (SizeOf.DoResolve): Likewise.
4370         (ComposedCast.DoResolveAsTypeStep): Likewise.
4371         (StackAlloc.DoResolve): Likewise.
4372         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4373         (Block.Unsafe): New property.
4374         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4375         (Unsafe): Set 'unsafe' flag of contained block.
4376         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4377         (Fixed.Resolve): Likewise.
4378         (Catch.Resolve): Likewise.
4379         (Using.ResolveLocalVariableDecls): Likewise.
4380         (Foreach.Resolve): Likewise.
4381
4382 2004-10-05  John Luke <john.luke@gmail.com>
4383
4384         * cs-parser.jay: add location to error CS0175
4385
4386 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4387
4388         * ecore.cs (Expression.Constantity): Add support for turning null
4389         into a constant.
4390
4391         * const.cs (Const.Define): Allow constants to be reference types
4392         as long as the value is Null.
4393
4394 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4395
4396         * namespace.cs (NamespaceEntry.Using): No matter which warning
4397         level is set, check if this namespace name has already been added.
4398
4399 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4400
4401         * expression.cs: reftype [!=]= null should always use br[true,false].
4402         # 67410
4403
4404 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4405
4406         Fix #67108
4407         * attribute.cs: Enum conversion moved to 
4408         GetAttributeArgumentExpression to be applied to the all
4409         expressions.
4410
4411 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4412
4413         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4414         * class.c (TypeContainer.DefineType): Flag error if
4415         base types aren't accessible due to access permissions.
4416         * decl.cs (DeclSpace.ResolveType): Move logic to
4417         Expression.ResolveAsTypeTerminal.
4418         (DeclSpace.ResolveTypeExpr): Thin layer over
4419         Expression.ResolveAsTypeTerminal.
4420         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4421         Refactor code into NestedAccess.  Use it.
4422         (DeclSpace.NestedAccess): New.
4423         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4424         argument to silence errors.  Check access permissions.
4425         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4426         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4427         (Cast.DoResolve): Likewise.
4428         (New.DoResolve): Likewise.
4429         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4430         (TypeOf.DoResolve): Likewise.
4431
4432         * expression.cs (Invocation.BetterConversion): Return the Type of
4433         the better conversion.  Implement section 14.4.2.3 more faithfully.
4434         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4435         section 14.4.2.2 explicit.
4436         (Invocation.OverloadResolve): Update.
4437         (Invocation): Remove is_base field.
4438         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4439         (Invocation.Emit): Likewise.
4440
4441 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4442
4443         * README: Update to changes.
4444
4445 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4446
4447         * cs-parser.jay: Reverted 642 warning fix.
4448
4449 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4450
4451         Fix bug #66615
4452         * decl.cs (FindMemberWithSameName): Indexer can have more than
4453         1 argument.
4454
4455 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4456
4457         * expression.cs (LocalVariableReference.DoResolveLValue):
4458         Do not report warning 219 for out values.
4459         (EmptyExpression.Null): New member to avoid extra allocations.
4460
4461 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4462
4463         * cs-parser.jay: Fix wrong warning 642 report.
4464
4465         * cs-tokenizer.cs (CheckNextToken): New helper;
4466         Inspect next character if is same as expected.
4467
4468 2004-09-23  Martin Baulig  <martin@ximian.com>
4469
4470         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4471         (Convert.ImplicitReferenceConversionExists): Likewise.
4472
4473 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4474
4475         * class.cs (Operator.Define): Add error 448 and 559 report.
4476
4477 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4478
4479         * class.cs (MemberBase.IsTypePermitted): New protected
4480         method for checking error CS0610.
4481
4482 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4483
4484         * class.cs (TypeContainer.HasExplicitLayout): New property
4485         Returns whether container has StructLayout attribute set Explicit.
4486         (FieldMember): New abstract class for consts and fields.
4487         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4488         (Field): Reuse FieldMember.
4489
4490         * const.cs (Const): Reuse FieldMember.
4491
4492         * rootcontext.cs: EmitConstants call moved to class.
4493
4494 2004-09-22  Martin Baulig  <martin@ximian.com>
4495
4496         Thanks to Peter Sestoft for this bug report.
4497
4498         * expression.cs (Conditional): If both the `trueExpr' and the
4499         `falseExpr' is a NullLiteral, return a NullLiteral.
4500
4501 2004-09-22  Martin Baulig  <martin@ximian.com>
4502
4503         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4504         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4505         for the "get_Current" call.
4506
4507 2004-09-22  Martin Baulig  <martin@ximian.com>
4508
4509         Marek and me just fixed one of our oldest bugs: #28562 :-)
4510
4511         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4512
4513         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4514         we're an EnumConstant, just return that.
4515         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4516         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4517         to get the value which'll actually be written into the attribute.
4518         However, we have to use GetValue() to access the attribute's value
4519         in the compiler.        
4520
4521 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4522
4523         * constant.cs (Constant.IsNegative): New abstract property
4524         IsNegative.
4525
4526         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4527         (StackAlloc.DoResolve): Reused IsNegative.
4528
4529 2004-09-21  Martin Baulig  <martin@ximian.com>
4530
4531         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4532         if we're used in an iterator, we may be called from different
4533         methods.
4534
4535         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4536         we actually have an exception block.
4537
4538 2004-09-20  John Luke <jluke@cfl.rr.com>
4539
4540         * class.cs, cs-parser.jay: Improve the error report for 1520:
4541         report the actual line where the error happens, not where the
4542         class was declared.
4543
4544         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4545         Pass location information that was available elsewhere.
4546
4547 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4548
4549         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4550         runtime to delay sign assemblies.
4551
4552 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4553
4554         * cs-parser.jay: Do not report the stack trace, this is barely
4555         used nowadays.
4556
4557 2004-08-22  John Luke  <john.luke@gmail.com>
4558  
4559         * driver.cs : check that a resource id is not already used
4560         before adding it, report CS1508 if it is, bug #63637
4561
4562 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4563
4564         * ecore.cs: Removed dead code.
4565
4566 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4567
4568         * class.cs: Do not report warning CS0067 on the interfaces.
4569
4570 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4571
4572         * cs-parser.jay: Add error 504 report.
4573
4574 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4575
4576         * rootcontext.cs: WarningLevel is 4 by default now.
4577
4578         * statement.cs (Fixed.Resolve): Do not null
4579         VariableInfo.
4580
4581 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4582
4583         Fixed bug #55780
4584         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4585         deep search when property is not virtual.
4586         (PropertyExpr.ResolveAccessors): Make one call for both
4587         accessors.
4588
4589 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4590
4591         Fixed bug #65766
4592         * statement.cs: Error 152 report constains also location.
4593
4594 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4595
4596         Fixed bug #65766
4597         * const.cs: Explicitly set constant as static.
4598
4599 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4600
4601         Fixed bug #64226
4602         * cs-parser.jay: Add error 1017 report.
4603
4604 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4605
4606         Fixed bug #59980, #64224
4607         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4608
4609         * typemanager.cs (IsSpecialMethod): Simplified
4610
4611 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4612
4613         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4614         condition with better params.
4615
4616 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4617
4618         Fixed bug #65238
4619         * attribute.cs (Resolve): Property has to have both
4620         accessors.
4621
4622 2004-09-14  Martin Baulig  <martin@ximian.com>
4623
4624         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4625
4626 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4627
4628         Fixed bug #61902
4629         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4630         called and is obsolete then this member suppress message
4631         when call is inside next [Obsolete] method or type.
4632
4633         * expression.cs: Use TestObsoleteMethodUsage member.
4634
4635 2004-09-14  Martin Baulig  <martin@ximian.com>
4636
4637         * cs-parser.jay: Sync a bit with the GMCS version.
4638
4639 2004-09-14  Martin Baulig  <martin@ximian.com>
4640
4641         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4642         (CSharpParser.yacc_verbose_flag): New public field.
4643
4644         * genericparser.cs: Removed.
4645
4646 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4647
4648         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4649
4650 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4651
4652         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4653
4654 2004-09-10  Martin Baulig  <martin@ximian.com>
4655
4656         Backported my MemberName changes from GMCS into MCS.
4657
4658         - we are now using a special `MemberName' class instead of using
4659         strings; in GMCS, the `MemberName' also contains the type
4660         arguments.
4661
4662         - changed the grammar rules a bit:
4663           * the old `member_name' is now a `namespace_or_type_name':
4664             The rule is that we use `namespace_or_type_name' everywhere
4665             where we expect either a "member name" (GetEnumerator) or a
4666             "member name" with an explicit interface name
4667             (IEnumerable.GetEnumerator).
4668             In GMCS, the explicit interface name may include type arguments
4669             (IEnumerable<T>.GetEnumerator).
4670           * we use `member_name' instead of just `IDENTIFIER' for
4671             "member names":
4672             The rule is that we use `member_name' wherever a member may
4673             have type parameters in GMCS.       
4674
4675         * decl.cs (MemberName): New public class.
4676         (MemberCore.MemberName): New public readonly field.
4677         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4678         (DeclSpace): Likewise.
4679
4680         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4681         * enum.cs (Enum.ctor): Likewise.
4682
4683         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4684         MemberName.     
4685         (AliasEntry.ctor): Take a MemberName, not an Expression.
4686         (AliasEntry.UsingAlias): Likewise.
4687
4688         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4689         (IMethodData.MemberName): Changed type from string to MemberName.
4690         (MemberBase.ExplicitInterfaceName): Likewise.
4691         (AbstractPropertyEventMethod.SetupName): Make this private.
4692         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4693         argument; compute the member name here.
4694         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4695         on the `member.MemberName' and the `prefix'.
4696
4697         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4698         not `type_name'.
4699         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4700         thus, we get a `MemberName' instead of a `string'.  These
4701         declarations may have type parameters in GMCS.
4702         (interface_method_declaration, delegate_declaration): Likewise.
4703         (class_declaration, interface_declaration): Likewise.
4704         (method_header): Use `namespace_or_type_name' instead of
4705         `member_name'.  We may be an explicit interface implementation.
4706         (property_declaration, event_declaration): Likewise.
4707         (member_name): This is now just an `IDENTIFIER', not a
4708         `namespace_or_type_name'.
4709         (type_name, interface_type): Removed.
4710         (namespace_or_type_name): Return a MemberName, not an Expression.
4711         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4712         call GetTypeExpression() on the MemberName to get an expression.
4713         (IndexerDeclaration.interface_type): Changed type from string to
4714         MemberName.
4715         (MakeName): Operate on MemberName's instead of string's.
4716
4717 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4718
4719         Fix bug #55770.
4720         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4721         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4722         lookup to avoid symbols introduced by 'using'.
4723         * rootcontext.cs (NamespaceLookup): Update.
4724
4725 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4726
4727         * class.cs (TypeContainer.DoDefineMembers): Do not call
4728         DefineDefaultConstructor for static classes.
4729
4730 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4731
4732         * attribute.cs (Attribute.Resolve): Add error 653 report.
4733
4734         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4735         report.
4736         (Method.ApplyAttributeBuilder): Add error 685 report.
4737         (Operator.Define): Add error 564 report.
4738
4739         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4740
4741         * expression.cs (Invocation.DoResolve): Add error
4742         245 and 250 report.
4743
4744         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4745         error 674 report.
4746
4747 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4748
4749         * class.cs (ConstructorInitializer.Resolve):
4750         Wrong error number (515->516).
4751
4752 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4753
4754         * class.cs (Indexer.Define): Add error 631 report.
4755
4756 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4757
4758         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4759
4760 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4761
4762         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4763
4764 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4765
4766         * cs-parser.jay: Added error CS0241 report.
4767
4768 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4769
4770         * cs-parser.jay (fixed_statement): Introduce a scope for the
4771         declaration in the 'fixed' statement.
4772
4773 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4774
4775         * cs-parser.jay: Added CS0230 error report.
4776
4777 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4778
4779         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4780
4781 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4782
4783         * expression.cs (Argument.Resolve): Added error CS0192 and
4784         CS0199 report.
4785
4786 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4787
4788         C# 2.0 #pragma warning feature
4789
4790         * cs-tokenizer.cs (PreProcessPragma): New method; 
4791         Handles #pragma directive.
4792
4793         * report.cs (WarningRegions): New class; Support
4794         class for #pragma warning directive. It tests whether
4795         warning is enabled for a given line.
4796
4797 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4798
4799         * const.cs: Add more descriptive error report, tahnks to
4800         Sebastien. 
4801
4802 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4803
4804         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4805
4806 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4807
4808         * expression.cs: Apply patch from Ben: Remove dead code from
4809         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4810         as that code just threw an exception anwyays.
4811
4812         * const.cs: Remove the call to the turnintoconstant, for details
4813         see bug: #63144
4814         
4815         * literal.cs: The type of the null-literal is the null type;  So
4816         we use a placeholder type (literal.cs:System.Null, defined here)
4817         for it.
4818
4819         * expression.cs (Conditional.DoResolve): Remove some old code that
4820         is no longer needed, conversions have been fixed.
4821
4822         (ArrayCreationExpression.DoResolve): Return false if we fail to
4823         resolve the inner expression.
4824
4825 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4826
4827         Fix test-290.cs.
4828         * cs-parser.jay (delegate_declaration): Record a delegate
4829         declaration as a type declaration.
4830         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4831
4832 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4833
4834         * parameter.cs: Do not crash if the type can not be resolved. 
4835
4836         * expression.cs: Report errors with unsafe pointers, fixes #64896
4837
4838 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4839
4840         * expression.cs: Pointer arith always needs to do a conv.i
4841         if the operand is a long. fix 65320
4842
4843 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4844
4845         Fixed cs0619-37.cs, cs0619-38.cs
4846
4847         * enum.cs (GetObsoleteAttribute): Removed.
4848
4849         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4850         on Enum member is double staged. The first is tested member
4851         and then enum.
4852
4853 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4854
4855         Fixed #56986, #63631, #65231
4856
4857         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4858         adds member to name container.
4859         (TypeContainer.AddToTypeContainer): New method, adds type to
4860         name container.
4861         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4862         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4863         AddOperator): Simplified by reusing AddToMemberContainer.
4864         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4865         instead of field.
4866         (Method.CheckForDuplications): Fixed implementation to test all
4867         possibilities.
4868         (MemberBase): Detection whether member is explicit interface
4869         implementation is now in constructor.
4870         (MemberBase.UpdateMemberName): Handles IndexerName.
4871         (Accessor): Changed to keep also location information.
4872         (AbstractPropertyEventMethod): Is derived from MemberCore.
4873         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4874         will be emited or not.
4875         (PropertyBase.AreAccessorsDuplicateImplementation):
4876         Tests whether accessors are not in collision with some method.
4877         (Operator): Is derived from MethodCore to simplify common
4878         operations.
4879
4880         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4881         must be performed.
4882         (DeclSpace.AddToContainer): Adds the member to defined_names
4883         table. It tests for duplications and enclosing name conflicts.
4884
4885         * enum.cs (EnumMember): Clean up to reuse the base structures
4886
4887 2004-09-03  Martin Baulig  <martin@ximian.com>
4888
4889         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4890         into TypeContainer, to make partial classes work again.
4891
4892 2004-09-03  Martin Baulig  <martin@ximian.com>
4893
4894         * rootcontext.cs (RootContext.V2): Removed.
4895
4896 2004-03-23  Martin Baulig  <martin@ximian.com>
4897
4898         * expression.cs (Invocation.OverloadResolve): Added `bool
4899         may_fail' argument and use it instead of the Location.IsNull() hack.
4900
4901 2004-09-03  Martin Baulig  <martin@ximian.com>
4902
4903         Merged latest changes into gmcs.  Please keep this comment in
4904         here, it makes it easier for me to see what changed in MCS since
4905         the last time I merged.
4906
4907 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4908
4909         Fix #61128.
4910         * expression.cs (BetterConversion): Don't allow either conversion 
4911         to be null.  Remove redundant implicit conversion test when 'q ==
4912         null' -- when this function is invoked, we already know that the
4913         implicit conversion exists.
4914         (BetterFunction): Assume that 'best' is non-null.  Remove
4915         redundant reimplementation of IsApplicable when 'best' is null.
4916         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4917         number of arguments.
4918         (IsAncestralType): Extract from OverloadResolve.
4919         (OverloadResolve): Make robust to the MethodGroupExpr being
4920         unsorted.  Implement all the logic of Section 14.5.5.1, and
4921         support overloading of methods from multiple applicable types.
4922         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4923
4924         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4925         (RealError, Warning): Append type of report to related symbol.
4926
4927 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4928
4929         * enum.cs: Fixed CLS-Compliance checks for enum members.
4930         Error tests cs3008-8.cs, cs3014-8.cs
4931
4932 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4933
4934         Fixed bug #62342, #63102
4935         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4936         like ImplementMethod.
4937
4938 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4939
4940         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4941         Fixed bug #65170.
4942
4943 2004-09-02  Martin Baulig  <martin@ximian.com>
4944
4945         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4946         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4947         on the MethodBase.
4948
4949 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4950
4951         C# 2.0 Static classes implemented
4952
4953         * class.cs (TypeContainer): instance_constructors,
4954         initialized_fields, initialized_static_fields,
4955         default_constructor, base_inteface_types are protected to be
4956         accessible from StaticClass.
4957         (TypeContainer.DefineDefaultConstructor): New virtual method
4958         for custom default constructor generating
4959         (StaticClass): New class to handle "Static classes" feature.
4960
4961         * cs-parser.jay: Handle static keyword on class like instance
4962         of StaticClass.
4963
4964         * driver.cs: Added "/langversion" command line switch with two
4965         options (iso-1, default).
4966
4967 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4968
4969         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4970
4971 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4972
4973         * delegate.cs: Style.
4974
4975 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4976
4977         * delegate.cs: Add seperate instance expr field for miguel.
4978
4979 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4980
4981         * PointerArithmetic (Resolve): make sure we are not doing
4982         pointer arith on void*. Also, make sure we are resolved
4983         by not setting eclass until resolve.
4984
4985         All callers: Make sure that PointerArithmetic gets resolved.
4986
4987 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4988
4989         * ArrayCreation (LookupType): If the type does not resolve 
4990         to an array, give an error.
4991
4992 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4993
4994         * statement.cs (Try.Resolve): Fixed bug #64222
4995
4996 2004-08-27  Martin Baulig  <martin@ximian.com>
4997
4998         * class.cs
4999         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5000         crash here.     
5001
5002 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5003
5004         * ecore.cs (Constantify): Get underlying type via
5005         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5006         Windows in special cases.
5007
5008 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5009
5010         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5011         for obtaining also private methods.
5012         (GetRemoveMethod): Used GetRemoveMethod (true)
5013         for obtaining also private methods.
5014
5015 2004-08-24  Martin Baulig  <martin@ximian.com>
5016
5017         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5018         MethodAttributes.HideBySig for operators.
5019
5020 2004-08-23  Martin Baulig  <martin@ximian.com>
5021
5022         Back to the old error reporting system :-)
5023
5024         * report.cs (Message): Removed.
5025         (Report.MessageData, ErrorData, WarningData): Removed.
5026         (Report.Error, Warning): Back to the old system.
5027
5028 2004-08-23  Martin Baulig  <martin@ximian.com>
5029
5030         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5031
5032         * class.cs (TypeContainer.ParentContainer): New public virtual
5033         method; replaces the explicit interface implementation.
5034         (ClassPart.ParentContainer): Override.
5035
5036 2004-08-23  Martin Baulig  <martin@ximian.com>
5037
5038         * statement.cs (Switch): Added support for constant switches; see
5039         #59428 or test-285.cs.
5040
5041 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5042
5043         Fixed bug #62740.
5044         * statement.cs (GetEnumeratorFilter): Removed useless
5045         logic because C# specs is strict. GetEnumerator must be
5046         public.
5047
5048 2004-08-22  Martin Baulig  <martin@ximian.com>
5049
5050         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5051         a switch and may break, reset the barrier.  Fixes #59867.
5052
5053 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5054
5055         CLS-Compliance speed up (~5% for corlib)
5056
5057         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5058         New method. Tests container for CLS-Compliant names
5059
5060         * class.cs (TypeContainer.VerifyClsName): New method.
5061         Checks whether container name is CLS Compliant.
5062         (Constructor): Implements IMethodData.
5063
5064         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5065         low-case table for CLS Compliance test.
5066         (MemberCache.VerifyClsParameterConflict): New method.
5067         Checks method parameters for CS3006 error.
5068
5069         * enum.cs (EnumMember): Is derived from MemberCore.
5070         (Enum.VerifyClsName): Optimized for better performance.
5071
5072 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5073
5074         * report.cs: Renamed Error_T to Error and changed all
5075         references.
5076
5077 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5078
5079         * class.cs (TypeContainer.IndexerArrayList): New inner class
5080         container for indexers.
5081         (TypeContainer.DefaultIndexerName): New constant for default
5082         indexer name. Replaced all "Item" with this constant.
5083         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5084
5085         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5086         DefaultMemberAttribute constructor.
5087
5088 2004-08-05  Martin Baulig  <martin@ximian.com>
5089
5090         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5091         Fix bug #59429.
5092
5093 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5094
5095         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5096         multi platforms problem.
5097
5098         * compiler.csproj: Included shared files.
5099
5100 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5101
5102         Fix bug 60333, 55971 in the more general way
5103         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5104         Added arg_type argument for constant conversion.
5105         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5106
5107 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5108
5109         Fix bug #59760
5110         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5111         OperatorArrayList, MethodCoreArrayList for typecontainer
5112         containers. Changed class member types to these new types.
5113         (MethodArrayList.DefineMembers): Added test for CS0659.
5114
5115 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5116
5117         * cfold.cs: Synchronize the folding with the code in expression.cs
5118         Binary.DoNumericPromotions for uint operands.
5119
5120         * attribute.cs: Revert patch from Raja, it introduced a regression
5121         while building Blam-1.2.1 (hard to isolate a test case).
5122
5123 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5124
5125         Fix for #55382
5126         * class.cs:
5127         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5128         name collision.
5129         (MethodCore.parent_method): New member. The method we're overriding
5130         if this is an override method.
5131         (MethodCore.CheckBase): Moved from Method class and made common.
5132         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5133         private.
5134         (MethodCore.CheckForDuplications): New abstract method. For custom
5135         member duplication search in a container
5136         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5137         method and its return type.
5138         (Event.conflict_symbol): New member. Symbol with same name in the
5139         parent class.
5140
5141         * decl.cs:
5142         (MemberCache.FindMemberWithSameName): New method. The method
5143         is looking for conflict with inherited symbols.
5144
5145 2004-08-04  Martin Baulig  <martin@ximian.com>
5146
5147         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5148
5149         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5150
5151 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5152
5153         * report.cs (Message): New enum for better error, warning reference in
5154         the code.
5155         (MessageData): New inner abstract class. It generally handles printing of
5156         error and warning messages.
5157         Removed unused Error, Warning, Message methods.
5158
5159 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5160
5161         Fix for cs0592-8.cs test
5162         * attribute.cs
5163         (Attributable.ValidAttributeTargets): Made public.
5164         (Attribute.ExplicitTarget): New member for explicit target value.
5165         (Attribute.CheckTargets): Now we translate explicit attribute
5166         target to Target here.
5167
5168 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5169
5170         * ecore.cs (MethodGroupExpr): new IsBase property.
5171
5172         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5173
5174         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5175         rather than an instance expr.
5176
5177         (DelegateCreation.Emit): Use the method group rather than
5178         the instance expression. Also, if you have base.Foo as the
5179         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5180
5181         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5182
5183         (NewDelegate.DoResolve): Only check for the existance of Invoke
5184         if the method is going to be needed. Use MethodGroupExpr.
5185
5186         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5187
5188         * expression.cs: For pointer arith., make sure to use
5189         the size of the type, not the size of the pointer to
5190         the type.
5191
5192 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5193
5194         Fix for #60722
5195         * class.cs (Class): Added error CS0502 test.
5196
5197 2004-08-03  John Luke  <jluke@cfl.rr.com>
5198             Raja R Harinath  <rharinath@novell.com>
5199
5200         Fix for #60997.
5201         * attribute.cs (Attribute.complained_before): New flag.
5202         (Attribute.ResolveType, Attribute.Resolve),
5203         (Attribute.DefinePInvokeMethod): Set it.
5204         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5205         
5206 2004-08-03  Martin Baulig  <martin@ximian.com>
5207
5208         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5209         use a user-defined operator; we still need to do numeric
5210         promotions in case one argument is a builtin type and the other
5211         one has an implicit conversion to that type.  Fixes #62322.
5212
5213 2004-08-02  Martin Baulig  <martin@ximian.com>
5214
5215         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5216         (LocalInfo.IsThis): New public property.
5217         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5218
5219 2004-08-01  Martin Baulig  <martin@ximian.com>
5220
5221         * class.cs (TypeContainer.GetClassBases): Don't set the default
5222         here since we may get called from GetPartialBases().
5223         (TypeContainer.DefineType): If GetClassBases() didn't return a
5224         parent, use the default one.
5225
5226 2004-07-30  Duncan Mak  <duncan@ximian.com>
5227
5228         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5229
5230 2004-07-30  Martin Baulig  <martin@ximian.com>
5231
5232         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5233
5234         * class.cs (SourceMethod): New public class, derive from the
5235         symbol writer's ISourceMethod.
5236         (Method): Use the new symbol writer API.
5237
5238         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5239         as argument and use the new symbol writer.
5240
5241         * location.cs
5242         (SourceFile): Implement the symbol writer's ISourceFile.
5243         (Location.SymbolDocument): Removed.
5244         (Location.SourceFile): New public property.
5245
5246         * symbolwriter.cs: Use the new symbol writer API.
5247
5248 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5249
5250         * Makefile (install-local): Remove.  Functionality moved to
5251         executable.make.
5252
5253 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5254
5255         * Makefile: Install mcs.exe.config file together with mcs.exe.
5256         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5257         correct runtime version.
5258         
5259 2004-07-25  Martin Baulig  <martin@ximian.com>
5260
5261         * class.cs
5262         (TypeContainer.RegisterOrder): Removed, this was unused.
5263         (TypeContainer, interface_order): Removed.
5264         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5265         TypeContainer as argument since we can also be called with a
5266         `PartialContainer' for a partial class/struct/interface.
5267         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5268         of checking whether we're an `Interface' - we could be a
5269         `PartialContainer'.
5270         (PartialContainer.Register): Override; call
5271         AddClass()/AddStruct()/AddInterface() on our parent.
5272
5273         * cs-parser.jay (interface_member_declaration): Add things to the
5274         `current_container', not the `current_class'.
5275
5276         * rootcontext.cs (RegisterOrder): The overloaded version which
5277         takes an `Interface' was unused, removed.
5278
5279         * typemanager.cs (TypeManager.LookupInterface): Return a
5280         `TypeContainer', not an `Interface'.
5281         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5282         contain a `PartialContainer' for an interface, so check it's
5283         `Kind' to figure out what it is.
5284
5285 2004-07-25  Martin Baulig  <martin@ximian.com>
5286
5287         * class.cs (Class.DefaultTypeAttributes): New public constant.
5288         (Struct.DefaultTypeAttributes): Likewise.
5289         (Interface.DefaultTypeAttributes): Likewise.
5290         (PartialContainer.TypeAttr): Override this and add the
5291         DefaultTypeAttributes.
5292
5293 2004-07-25  Martin Baulig  <martin@ximian.com>
5294
5295         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5296         we can just use the `Parent' field instead.
5297
5298 2004-07-25  Martin Baulig  <martin@ximian.com>
5299
5300         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5301
5302 2004-07-25  Martin Baulig  <martin@ximian.com>
5303
5304         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5305         our parts before defining any methods.
5306         (TypeContainer.VerifyImplements): Make this virtual.
5307         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5308         on our PartialContainer.
5309
5310 2004-07-25  Martin Baulig  <martin@ximian.com>
5311
5312         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5313
5314         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5315         argument, we can just use the `Parent' field instead.
5316
5317         * class.cs
5318         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5319         (MemberBase.DoDefine): Likewise.
5320
5321 2004-07-24  Martin Baulig  <martin@ximian.com>
5322
5323         * decl.cs (MemberCore.Parent): New public field.
5324         (DeclSpace.Parent): Moved to MemberCore.
5325
5326         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5327         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5328         parent's .ctor.
5329         (FieldBase, Field, Operator): Likewise.
5330         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5331         (EventField, Event): Likewise.
5332
5333 2004-07-23  Martin Baulig  <martin@ximian.com>
5334
5335         * class.cs (PartialContainer): New public class.
5336         (ClassPart): New public class.
5337         (TypeContainer): Added support for partial classes.
5338         (TypeContainer.GetClassBases): Splitted some of the functionality
5339         out into GetNormalBases() and GetPartialBases().
5340
5341         * cs-tokenizer.cs (Token.PARTIAL): New token.
5342         (Tokenizer.consume_identifier): Added some hacks to recognize
5343         `partial', but only if it's immediately followed by `class',
5344         `struct' or `interface'.
5345
5346         * cs-parser.jay: Added support for partial clases.
5347
5348 2004-07-23  Martin Baulig  <martin@ximian.com>
5349
5350         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5351         a `DeclSpace' and also made it readonly.
5352         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5353         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5354         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5355
5356         * cs-parser.jay: Pass the `current_class', not the
5357         `current_container' (at the moment, this is still the same thing)
5358         to a new Method, Property, Event, Indexer or Constructor.
5359
5360 2004-07-23  Martin Baulig  <martin@ximian.com>
5361
5362         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5363         and removed the `current_interface' one.
5364         (struct_declaration, class_declaration, interface_declaration):
5365         Set `current_class' to the newly created class/struct/interface;
5366         set their `Bases' and call Register() before parsing their body.
5367
5368 2004-07-23  Martin Baulig  <martin@ximian.com>
5369
5370         * class.cs (Kind): New public enum.
5371         (TypeContainer): Made this class abstract.
5372         (TypeContainer.Kind): New public readonly field.
5373         (TypeContainer.CheckDef): New public method; moved here from
5374         cs-parser.jay.
5375         (TypeContainer.Register): New public abstract method.
5376         (TypeContainer.GetPendingImplementations): New public abstract
5377         method.
5378         (TypeContainer.GetClassBases): Removed the `is_class' and
5379         `is_iface' parameters.
5380         (TypeContainer.DefineNestedTypes): Formerly known as
5381         DoDefineType().
5382         (ClassOrStruct): Made this class abstract.
5383
5384         * tree.cs (RootTypes): New public type. 
5385
5386 2004-07-20  Martin Baulig  <martin@ximian.com>
5387
5388         * tree.cs (Tree.RecordNamespace): Removed.
5389         (Tree.Namespaces): Removed.
5390
5391         * rootcontext.cs (RootContext.IsNamespace): Removed.
5392
5393         * cs-parser.jay (namespace_declaration): Just create a new
5394         NamespaceEntry here.
5395
5396 2004-07-20  Martin Baulig  <martin@ximian.com>
5397
5398         * statement.cs (ExceptionStatement): New abstract class.  This is
5399         now used as a base class for everyone who's using `finally'.
5400         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5401         our local variables before using them.
5402
5403         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5404         virtual method.  This is used by Yield.Resolve() to "steal" an
5405         outer block's `finally' clauses.
5406         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5407         argument.
5408
5409         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5410         version which takes an ExceptionStatement.  This version must be
5411         used to create exception branchings.
5412
5413         * iterator.cs
5414         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5415         (Iterator.EmitMoveNext): Added exception support; protect the
5416         block with a `fault' clause, properly handle 'finally' clauses.
5417         (Iterator.EmitDispose): Run all the `finally' clauses here.
5418
5419 2004-07-20  Martin Baulig  <martin@ximian.com>
5420
5421         * iterator.cs: This is the first of a set of changes in the
5422         iterator code.  Match the spec more closely: if we're an
5423         IEnumerable, then GetEnumerator() must be called.  The first time
5424         GetEnumerator() is called, it returns the current instance; all
5425         subsequent invocations (if any) must create a copy.
5426
5427 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5428
5429         * expression.cs: Resolve the constant expression before returning
5430         it. 
5431
5432 2004-07-19  Martin Baulig  <martin@ximian.com>
5433
5434         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5435         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5436         the return type of the new EmitContext.
5437
5438 2004-07-18  Martin Baulig  <martin@ximian.com>
5439
5440         * class.cs (Property.Define): Fix iterators.
5441
5442         * iterators.cs (Iterator.Define): Moved the
5443         `container.AddInterator (this)' call here from the .ctor; only do
5444         it if we resolved successfully.
5445
5446 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5447
5448         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5449         `true' for preprocessing directives that we parse.  The return
5450         value indicates whether we should return to regular tokenizing or
5451         not, not whether it was parsed successfully.
5452
5453         In the past if we were in: #if false ... #line #endif, we would
5454         resume parsing after `#line'.  See bug 61604.
5455
5456         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5457         building: IsEnumType should return true only for enums, not for
5458         enums or System.Enum itself.  This fixes #61593.
5459
5460         Likely what happened is that corlib was wrong: mcs depended on
5461         this bug in some places.  The bug got fixed, we had to add the
5462         hack, which caused bug 61593.
5463
5464         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5465         that was a workaround for the older conditions.
5466
5467 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5468
5469         * assign.cs: IAssignMethod has a new interface, as documented
5470         inline. All assignment code now uses this new api.
5471
5472         * ecore.cs, expression.cs: All classes which implement
5473         IAssignMethod now use the new interface.
5474
5475         * expression.cs (Invocation): add a hack to EmitCall so that
5476         IndexerAccess can be the target of a compound assignment without
5477         evaluating its arguments twice.
5478
5479         * statement.cs: Handle changes in Invocation api.
5480
5481 2004-07-16  Martin Baulig  <martin@ximian.com>
5482
5483         * iterators.cs: Rewrote this.  We're now using one single Proxy
5484         class for both the IEnumerable and the IEnumerator interface and
5485         `Iterator' derives from Class so we can use the high-level API.
5486
5487         * class.cs (TypeContainer.AddIterator): New method.
5488         (TypeContainer.DoDefineType): New protected virtual method, which
5489         is called from DefineType().
5490         (TypeContainer.DoDefineMembers): Call DefineType() and
5491         DefineMembers() on all our iterators.
5492         (TypeContainer.Emit): Call Emit() on all our iterators.
5493         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5494
5495         * codegen.cs (EmitContext.CurrentIterator): New public field.
5496
5497 2004-07-15  Martin Baulig  <martin@ximian.com>
5498
5499         * typemanager.cs
5500         (TypeManager.not_supported_exception_type): New type.   
5501
5502 2004-07-14  Martin Baulig  <martin@ximian.com>
5503
5504         * iterators.cs: Use real error numbers.
5505
5506 2004-07-14  Martin Baulig  <martin@ximian.com>
5507
5508         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5509         requires this to be a System.Collection.IEnumerable and not a
5510         class implementing that interface.
5511         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5512
5513 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5514
5515         * class.cs: Fixed previous fix, it broke some error tests.
5516
5517 2004-07-12  Martin Baulig  <martin@ximian.com>
5518
5519         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5520         Fixes #61293.
5521
5522 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5523
5524         * assign.cs (LocalTemporary): Add new argument: is_address,If
5525         `is_address' is true, then the value that we store is the address
5526         to the real value, and not the value itself.
5527         
5528         * ecore.cs (PropertyExpr): use the new local temporary
5529         stuff to allow us to handle X.Y += z (where X is a struct)
5530
5531 2004-07-08  Martin Baulig  <martin@ximian.com>
5532
5533         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5534         not always return, just like we're doing in Using.Resolve().
5535
5536 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5537
5538         * cs-parser.jay (fixed_statement): flag this as Pinned.
5539
5540 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5541
5542         * typemanager.cs (TypeManager): Removed MakePinned method, this
5543         mechanism is replaced with the .NET 2.x compatible mechanism of
5544         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5545
5546         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5547         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5548         `IsFixed' property which has a different meaning.
5549
5550 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5551
5552         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5553         visible from inside a nested class, not just the names of the
5554         immediately enclosing class.
5555         Fix for bug #60730.
5556
5557 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5558
5559         * expression.cs (BetterConversion): Remove buggy special-case
5560         handling of "implicit constant expression conversions".  At this
5561         point, we already know that the conversion is possible -- we're
5562         only checking to see which is better.
5563
5564 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5565
5566         * cs-parser.jay: Added error CS0210 test.
5567
5568 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5569
5570         * cs-parser.jay: Added error CS0134 test.
5571
5572 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5573
5574         Fix bug #52507
5575         * cs-parser.jay: Added error CS0145 test.
5576
5577 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5578
5579         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5580
5581 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5582         
5583         * expression.cs (StackAlloc.Resolve): The argument may not
5584         be a constant; deal with this case.
5585         
5586 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5587
5588         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5589         GetIndexerAttributeValue.
5590         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5591
5592         * class.cs (Indexer.Define): Added error tests for CS0415,
5593         CS0609.
5594
5595 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5596
5597         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5598         property code.
5599
5600 2004-06-23  Martin Baulig  <martin@ximian.com>
5601
5602         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5603         neither return nor throw, reset the barrier as well.  Fixes #60457.
5604
5605 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5606
5607         * class.cs : EventAttributes is now set to None by default.
5608           This fixes bug #60459.
5609
5610 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5611
5612         Fix bug #60219
5613         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5614         Don't throw exception but return null (it's sufficient now).
5615
5616 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5617
5618         * typemanager.cs (GetArgumentTypes): Faster implementation.
5619
5620 2004-06-18  Martin Baulig  <martin@ximian.com>
5621
5622         * attribute.cs (Attribute.Resolve): Check whether we're an
5623         EmptyCast which a Constant child.  Fixes #60333.
5624
5625 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5626
5627         * statement.cs (EmitCollectionForeach): Account for the fact that
5628         not all valuetypes are in areas which we can take the address of.
5629         For these variables, we store to a temporary variable. Also, make
5630         sure that we dont emit a `callvirt' on a valuetype method.
5631
5632 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5633
5634         * expression.cs (StackAlloc.DoReSolve): Added test for
5635         negative parameter (CS0247).
5636
5637 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5638
5639         Fix bug #59792
5640         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5641
5642 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5643
5644         Fix bug #59781
5645         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5646         ulong.
5647
5648 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5649
5650         Fix bug #58254 & cs1555.cs, cs1556.cs
5651         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5652
5653 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5654
5655         * cs-parser.jay: Added error CS1669 test for indexers.
5656
5657 2004-06-11  Martin Baulig  <martin@ximian.com>
5658
5659         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5660         call this twice: for params and varargs methods.
5661
5662 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5663
5664         * class.cs:
5665         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5666
5667 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5668
5669         * attribute.cs (Attribute.GetValidTargets): Made public.
5670
5671         * class.cs: 
5672         (AbstractPropertyEventMethod): New class for better code sharing.
5673         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5674         CS1667 report.
5675         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5676
5677 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5678
5679         Fix bug #59477.
5680         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5681         that the call to Resolve is part of a MemberAccess.
5682         (Expression.Resolve): Use it for SimpleName resolution.
5683         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5684         Add 'intermediate' boolean argument.
5685         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5686         error message when the SimpleName can be resolved ambiguously
5687         between an expression and a type.
5688         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5689         public.
5690         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5691         call on the left-side.
5692
5693 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5694
5695         * class.cs:
5696         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5697
5698 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5699
5700         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5701
5702 2004-06-11  Martin Baulig  <martin@ximian.com>
5703
5704         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5705         varargs methods if applicable.
5706
5707 2004-06-11  Martin Baulig  <martin@ximian.com>
5708
5709         * expression.cs (Invocation.EmitCall): Don't use
5710         `method.CallingConvention == CallingConventions.VarArgs' since the
5711         method could also have `CallingConventions.HasThis'.
5712
5713 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5714
5715         * class.cs (Event.GetSignatureForError): Implemented.
5716         Fixed crash in error test cs3010.cs
5717
5718 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5719
5720         * cs-tokenizer.cs: Change the way we track __arglist to be
5721         consistent with the other keywords.
5722
5723 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5724
5725         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5726         tomorrow.
5727
5728 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5729
5730         * codegen.cs: Check that all referenced assemblies have a strongname
5731         before strongnaming the compiled assembly. If not report error CS1577.
5732         Fix bug #56563. Patch by Jackson Harper.
5733         * typemanager.cs: Added a method to return all referenced assemblies.
5734         Fix bug #56563. Patch by Jackson Harper.
5735
5736 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5737
5738         * class.cs:
5739         (Method.ApplyAttributeBuilder): Moved and added conditional
5740         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5741
5742         * delegate.cs:
5743         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5744
5745 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5746
5747         Fixed #59640
5748         * class.cs: (EventField.attribute_targets): Changed default target.
5749
5750 2004-06-08  Martin Baulig  <martin@ximian.com>
5751
5752         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5753
5754 2004-06-08  Martin Baulig  <martin@ximian.com>
5755
5756         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5757
5758 2004-06-07  Martin Baulig  <martin@ximian.com>
5759
5760         Added support for varargs methods.
5761
5762         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5763         keyword.
5764
5765         * cs-parser.jay: Added support for `__arglist'.
5766
5767         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5768
5769         * expression.cs (Argument.AType): Added `ArgList'.
5770         (Invocation): Added support for varargs methods.
5771         (ArglistAccess): New public class.
5772         (Arglist): New public class.
5773
5774         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5775
5776         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5777         a method's top-level block if the method has varargs.
5778
5779         * support.cs (ReflectionParameters, InternalParameters): Added
5780         support for varargs methods.    
5781
5782 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5783
5784         * class.cs: Provide location in indexer error report.
5785
5786         * driver.cs: Use standard names.
5787
5788         * namespace.cs: Catch the use of using after a namespace has been
5789         declared also on using aliases.
5790
5791 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5792
5793         Bug #50820.
5794         * typemanager.cs (closure_private_ok, closure_invocation_type)
5795         (closure_qualifier_type, closure_invocation_assembly)
5796         (FilterWithClosure): Move to ...
5797         (Closure): New internal nested class.
5798         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5799         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5800         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5801         (MemberLookup, MemberLookupFailed): Use it.
5802         * expression.cs (New.DoResolve): Treat the lookup for the
5803         constructor as being qualified by the 'new'ed type.
5804         (Indexers.GetIndexersForTypeOrInterface): Update.
5805
5806 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5807
5808         * attribute.cs
5809         (GetConditionalAttributeValue): New method. Returns
5810         condition of ConditionalAttribute.
5811         (SearchMulti): New method.  Returns all attributes of type 't'.
5812         Use it when attribute is AllowMultiple = true.
5813         (IsConditionalMethodExcluded): New method.
5814
5815         * class.cs
5816         (Method.IsExcluded): Implemented. Returns true if method has conditional
5817         attribute and the conditions is not defined (method is excluded).
5818         (IMethodData): Extended interface for ConditionalAttribute support.
5819         (PropertyMethod.IsExcluded): Implemented.
5820
5821         * decl.cs
5822         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5823
5824         * expression.cs
5825         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5826         on the method.
5827
5828 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5829
5830         * expression.cs (ArrayCreationExpression): Make this just an
5831         `expression'. It can't be a statement, so the code here was
5832         dead.
5833
5834 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5835
5836         Fixed #59072
5837         * typemanager.cs (GetFullNameSignature): New method for
5838         MethodBase types.
5839
5840 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5841
5842         Fixed #56452
5843         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5844         Use this method when MethodBuilder is null.
5845         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5846         Added test for error CS0626 (MONO reports error for this situation).
5847         (IMethodData.GetSignatureForError): Extended interface.
5848
5849 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5850
5851         * attribute.cs
5852         (AttributeTester.GetObsoleteAttribute): Returns instance of
5853         ObsoleteAttribute when type is obsolete.
5854
5855         * class.cs
5856         (TypeContainer.VerifyObsoleteAttribute): Override.
5857         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5858         (MethodCode.VerifyObsoleteAttribute): Override.
5859         (MemberBase.VerifyObsoleteAttribute): Override.
5860
5861         * decl.cs
5862         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5863         and report proper error.
5864
5865         *delegate.cs
5866         Delegate.VerifyObsoleteAttribute): Override.
5867
5868         * ecore.cs
5869         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5870         and report proper error.
5871         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5872
5873         * enum.cs
5874         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5875         and enum member.
5876
5877         * expression.cs
5878         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5879         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5880         Added test for ObsoleteAttribute.
5881
5882         * statement.cs
5883         (Catch): Derived from Statement.
5884
5885 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5886  
5887         Fixed bug #59071 & cs0160.cs
5888  
5889         * statement.cs (Try.Resolve): Check here whether order of catch
5890         clauses matches their dependencies.
5891
5892 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
5893
5894         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
5895         caused a regression: #59343.  Referencing nested classes from an
5896         assembly stopped working.
5897
5898 2004-05-31  Martin Baulig  <martin@ximian.com>
5899
5900         MCS is now frozen for beta 2.
5901
5902 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5903
5904         * convert.cs: add a trivial cache for overload operator resolution.
5905
5906 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5907
5908         * decl.cs: If possible, use lookuptypedirect here. We can only do
5909         this if there is no `.' after the namespace. Avoids using
5910         LookupType, which does lots of slow processing.
5911         (FindNestedType) New method, does what it says :-).
5912         * namespace.cs: use LookupTypeDirect.
5913         * rootcontext.cs: use membercache, if possible.
5914         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5915
5916 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5917
5918         * expression.cs:
5919         According to the spec, 
5920
5921         In a member access of the form E.I, if E is a single identifier,
5922         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5923         field, property, localvariable, or parameter with the same type as
5924         the meaning of E as a type-name (§3.8), then both possible
5925         meanings of E are permitted.
5926
5927         We did not check that E as a simple-name had the same type as E as
5928         a type name.
5929
5930         This trivial check gives us 5-7% on bootstrap time.
5931
5932 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5933
5934         * expression.cs (Invocation.OverloadResolve): Avoid the
5935         use of hashtables and boxing here by allocating on demand.
5936
5937 2004-05-30  Martin Baulig  <martin@ximian.com>
5938
5939         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5940         we're doing a silent lookup.  Don't try to lookup nested types in
5941         TypeManager.object_type (thanks to Ben Maurer).
5942
5943 2004-05-30  Martin Baulig  <martin@ximian.com>
5944
5945         Committing a patch from Ben Maurer.
5946
5947         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5948
5949 2004-05-29  Martin Baulig  <martin@ximian.com>
5950
5951         * class.cs (IMethodData.ShouldIgnore): New method.
5952
5953         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5954         `Location' argument, we don't need it anywhere.  Use
5955         `IMethodData.ShouldIgnore ()' instead of
5956         `MethodData.GetMethodFlags ()'.
5957         (TypeManager.AddMethod): Removed.
5958         (TypeManager.AddMethod2): Renamed to AddMethod.
5959
5960 2004-05-29  Martin Baulig  <martin@ximian.com>
5961
5962         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5963
5964         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5965         converting from a class type S to an interface type and we already
5966         have an object on the stack, don't box it again.  Fixes #52578.
5967
5968 2004-05-29  Martin Baulig  <martin@ximian.com>
5969
5970         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5971         Added support for `params' parameters.  Fixes #59267.
5972
5973 2004-05-29  Martin Baulig  <martin@ximian.com>
5974
5975         * literal.cs (NullPointer): Provide a private .ctor which sets
5976         `type' to TypeManager.object_type.  Fixes #59048.
5977
5978 2004-05-29  Martin Baulig  <martin@ximian.com>
5979
5980         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5981         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5982
5983         * ecore.cs (EventExpr.instance_expr): Make the field private.
5984
5985 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5986
5987         Fixed bug #50080 & cs0214-2.cs
5988         * expression.cs (Cast.DoResolve): Check unsafe context here.
5989         
5990         * statement.cs (Resolve.DoResolve): Likewise.
5991
5992 2004-05-26  Martin Baulig  <martin@ximian.com>
5993
5994         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5995
5996         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5997         (RootContext.LookupType): Pass down the `silent' flag.
5998
5999 2004-05-25  Martin Baulig  <martin@ximian.com>
6000
6001         * expression.cs
6002         (MethodGroupExpr.IdenticalTypeName): New public property.
6003         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6004         expression actually refers to a type.
6005
6006 2004-05-25  Martin Baulig  <martin@ximian.com>
6007
6008         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6009         for #56176 and made it actually work.
6010
6011 2004-05-25  Martin Baulig  <martin@ximian.com>
6012
6013         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6014         (FieldExpr, PropertyExpr): Override and implement
6015         CacheTemporaries.  Fixes #52279.
6016
6017 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6018
6019         * location.cs: In the new compiler listing a file twice is a
6020         warning, not an error.
6021
6022 2004-05-24  Martin Baulig  <martin@ximian.com>
6023
6024         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6025         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6026
6027 2004-05-24  Martin Baulig  <martin@ximian.com>
6028
6029         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6030         walking the `using' list.  Fixes #53921.
6031
6032 2004-05-24  Martin Baulig  <martin@ximian.com>
6033
6034         * const.cs (Const.LookupConstantValue): Added support for
6035         EmptyCast's; fixes #55251.
6036
6037 2004-05-24  Martin Baulig  <martin@ximian.com>
6038
6039         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6040         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6041         which does the CS0135 check.  The reason is that we first need to
6042         check whether the variable actually exists.
6043
6044 2004-05-24  Martin Baulig  <martin@ximian.com>
6045
6046         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6047         than RootContext.LookupType() to find the explicit interface
6048         type.  Fixes #58584.
6049
6050 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6051
6052         * Makefile: Simplify.  Use executable.make.
6053         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6054
6055 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6056
6057         * decl.cs:
6058         * enum.cs:
6059         Use the invariant culture when doing String.Compare for CLS case
6060         sensitivity.
6061         
6062 2004-05-23  Martin Baulig  <martin@ximian.com>
6063
6064         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6065         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6066
6067         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6068         
6069 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6070
6071         * class.cs (MemberBase.Define): Reuse MemberType member for 
6072         resolved type. Other methods can use it too.
6073
6074 2004-05-23  Martin Baulig  <martin@ximian.com>
6075
6076         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6077         the variable also exists in the current block (otherwise, we need
6078         to report a CS0103).  Fixes #58670.
6079
6080 2004-05-23  Martin Baulig  <martin@ximian.com>
6081
6082         * flowanalysis.cs (Reachability.Reachable): Compute this
6083         on-the-fly rather than storing it as a field.
6084
6085 2004-05-23  Martin Baulig  <martin@ximian.com>
6086
6087         * flowanalysis.cs (Reachability.And): Manually compute the
6088         resulting `barrier' from the reachability.      
6089        
6090 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6091
6092         Fix bug #57835
6093         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6094         instance of ObsoleteAttribute when symbol is obsolete.
6095
6096         * class.cs
6097         (IMethodData): Extended interface for ObsoleteAttribute support.
6098
6099 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6100
6101         * attribute.cs: Fix bug #55970
6102
6103 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6104
6105         Fix bug #52705
6106         * attribute.cs
6107         (GetObsoleteAttribute): New method. Creates the instance of
6108         ObsoleteAttribute.
6109         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6110         ObsoleteAttribute when member is obsolete.
6111         (AttributeTester.Report_ObsoleteMessage): Common method for
6112         Obsolete error/warning reporting.
6113
6114         * class.cs
6115         (TypeContainer.base_classs_type): New member for storing parent type.
6116
6117         * decl.cs
6118         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6119         for this MemberCore.
6120
6121 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6122
6123         * attribute.cs, const.cs: Fix bug #58590
6124
6125 2004-05-21  Martin Baulig  <martin@ximian.com>
6126
6127         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6128         out parameters if the end of the method is unreachable.  Fixes
6129         #58098. 
6130
6131 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6132
6133         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6134         Hari was right, why extra method.
6135
6136 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6137
6138         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6139
6140 2004-05-20  Martin Baulig  <martin@ximian.com>
6141
6142         Merged this back from gmcs to keep the differences to a minumum.
6143
6144         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6145         instead of a Declspace.
6146         (Attribute.ResolveType): Likewise.
6147         (Attributes.Search): Likewise.
6148         (Attributes.Contains): Likewise.
6149         (Attributes.GetClsCompliantAttribute): Likewise.
6150
6151         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6152         argument.
6153         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6154         DeclSpace.
6155
6156 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6157
6158         Fix bug #58688 (MCS does not report error when the same attribute
6159         is assigned twice)
6160
6161         * attribute.cs (Attribute.Emit): Distinction between null and default.
6162
6163 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6164
6165         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6166         of a top-level attribute without an attribute target.
6167         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6168         Make non-static.
6169         (Attribute.Conditional_GetConditionName), 
6170         (Attribute.Obsolete_GetObsoleteMessage): Update.
6171         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6172         part of ScanForIndexerName.
6173         (Attribute.CanIgnoreInvalidAttribute): New function.
6174         (Attribute.ScanForIndexerName): Move to ...
6175         (Attributes.ScanForIndexerName): ... here.
6176         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6177         (Attributes.Search): New internal variant that can choose not to
6178         complain if types aren't resolved.  The original signature now
6179         complains.
6180         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6181         complaints suppressed.
6182         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6183         only if it not useful.
6184         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6185         top-level for attributes that are shared between the assembly
6186         and a top-level class.
6187         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6188         * class.cs: Update to reflect changes.
6189         (DefineIndexers): Fuse loops.
6190         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6191         a couple more variants of attribute names.
6192
6193 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6194
6195         Fix bug #52585 (Implemented explicit attribute declaration)
6196
6197         * attribute.cs:
6198         (Attributable.ValidAttributeTargets): New abstract method. It gets
6199         list of valid attribute targets for explicit target declaration.
6200         (Attribute.Target): It holds target itself.
6201         (AttributeSection): Removed.
6202         (Attribute.CheckTargets): New method. It checks whether attribute
6203         target is valid for the current element.
6204
6205         * class.cs:
6206         (EventProperty): New class. For events that are declared like
6207         property (with add and remove accessors).
6208         (EventField): New class. For events that are declared like field.
6209         class.cs
6210
6211         * cs-parser.jay: Implemented explicit attribute target declaration.
6212
6213         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6214         Override ValidAttributeTargets.
6215
6216         * parameter.cs:
6217         (ReturnParameter): Class for applying custom attributes on 
6218         the return type.
6219         (ParameterAtribute): New class. Class for applying custom
6220         attributes on the parameter type.
6221
6222 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6223
6224         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6225         definitions. 
6226
6227         (Method): Allow UNSAFE here.
6228
6229         * modifiers.cs: Support unsafe reporting.
6230
6231 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6232
6233         * decl.cs: Fix bug #58478.
6234
6235 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6236
6237         * statement.cs: When checking for unreachable code on an EmptyStatement,
6238         set the location. Fixes bug #58488.
6239
6240 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6241
6242         * driver.cs: Add -pkg handling.
6243
6244         From Gonzalo: UseShelLExecute=false
6245
6246 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6247
6248         * attribute.cs:
6249         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6250         for attribute.
6251         (Attribute.IsClsCompliaceRequired): Moved to base for better
6252         accesibility.
6253         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6254         when attribute is AttributeUsageAttribute.
6255         (Attribute.GetValidTargets): Simplified.
6256         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6257         attribute for this type.
6258         (Attribute.ApplyAttributes): Method renamed to Emit and make
6259         non-static.
6260         (GlobalAttributeSection): New class for special handling of global
6261         attributes (assembly, module).
6262         (AttributeSection.Emit): New method.
6263
6264         * class.cs: Implemented Attributable abstract methods.
6265         (MethodCore.LabelParameters): Moved to Parameter class.
6266         (Accessor): Is back simple class.
6267         (PropertyMethod): Implemented Attributable abstract class.
6268         (DelegateMethod): Implemented Attributable abstract class.
6269         (Event): New constructor for disctintion between normal Event
6270         and Event with accessors.
6271
6272         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6273
6274         * codegen.cs, const.cs, decl.cs, delegate.cs:
6275         (CommonAssemblyModulClass): Implemented Attributable abstract class
6276         and simplified.
6277
6278         * enum.cs: Implement IAttributeSupport interface.
6279         (EnumMember): New class for emum members. Implemented Attributable
6280         abstract class
6281
6282         * parameter.cs:
6283         (ParameterBase): Is abstract.
6284         (ReturnParameter): New class for easier [return:] attribute handling.
6285
6286         * typemanager.cs: Removed builder_to_attr.
6287
6288 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6289
6290         Fix bug #57151.
6291         * attribute.cs (Attribute.GetPositionalValue): New function.
6292         * class.cs (TypeContainer.VerifyMembers): New function.
6293         (TypeContainer.Emit): Use it.
6294         (ClassOrStruct): New base class for Class and Struct.
6295         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6296         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6297         class.
6298         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6299         then each non-static field should have a FieldOffset attribute.
6300         Otherwise, none of the fields should have a FieldOffset attribute.
6301         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6302         and FieldOffset attributes.
6303         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6304         (TypeManager.field_offset_attribute_type): New core types.
6305         (TypeManager.InitCoreTypes): Initialize them.
6306
6307 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6308
6309         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6310         Return correct type.
6311         From bug #58270.
6312
6313 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6314
6315         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6316         be implicitly converted to ulong.
6317         
6318         * expression.cs: The logic for allowing operator &, | and ^ worked
6319         was wrong, it worked before because we did not report an error in
6320         an else branch.  Fixes 57895.
6321
6322         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6323         allow volatile fields to be reference types.
6324
6325 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6326
6327         * driver.cs: Add support for /debug-
6328
6329 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6330
6331         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6332         Add a 'complain' parameter to silence errors.
6333         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6334         silently overlooked type-resolutions.
6335         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6336         to reflect changes.
6337         (Attributes.Search): New function.
6338         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6339         (Attributes.GetAttributeFullName): Remove hack.
6340         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6341         Update to reflect changes.
6342         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6343         Use Attributes.Search instead of nested loops.
6344
6345 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6346
6347         * decl.cs:
6348         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6349         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6350         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6351
6352         * report.cs: (Report.Warning): Renamed to Warning_T because of
6353         parameter collision.
6354
6355 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6356
6357         * expression.cs (MemberAccess.ResolveMemberAccess):
6358         Exit with non-zero status after Report.Error.
6359         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6360         Likewise.
6361         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6362
6363 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6364
6365         * support.cs: Don't hang when the file is empty.
6366
6367 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6368
6369         * support.cs: In SeekableStreamReader, compute the preamble size of the
6370           underlying stream. Position changes should take into account that initial
6371           count of bytes.
6372
6373 2004-05-03  Todd Berman  <tberman@sevenl.net>
6374
6375         * driver.cs: remove unused GetSysVersion function.
6376
6377 2004-05-03  Todd Berman  <tberman@sevenl.net>
6378
6379         * driver.cs: Remove the hack from saturday, as well as the hack
6380         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6381         link_paths to get that bit proper.
6382
6383 2004-05-01  Todd Berman  <tberman@sevenl.net>
6384
6385         * driver.cs: Try a LoadFrom before a Load, this checks the current
6386         path. This is currently a bug in mono that is be fixed, however, this
6387         provides a workaround for now. This will be removed when the bug
6388         is fixed.
6389
6390 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6391
6392         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6393         incomplete key pairs (#57941).
6394
6395 2004-05-01  Todd Berman  <tberman@sevenl.net>
6396
6397         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6398         from the GAC
6399
6400 2004-04-30  Jackson Harper  <jackson@ximian.com>
6401
6402         * codegen.cs: Open keys readonly.
6403         
6404 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6405
6406         * typemanager.cs: don't report cyclic struct layout when a struct
6407         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6408         which has 2 Pango.Rectangle fields.
6409
6410 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6411
6412         * expression.cs: Handle IntPtr comparisons with IL code
6413         rather than a method call.
6414
6415 2004-04-29  Martin Baulig  <martin@ximian.com>
6416
6417         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6418         the list of PropertyInfo's in class hierarchy and find the
6419         accessor.  Fixes #56013.
6420
6421 2004-04-29  Martin Baulig  <martin@ximian.com>
6422
6423         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6424
6425 2004-04-29  Martin Baulig  <martin@ximian.com>
6426
6427         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6428
6429         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6430
6431 2004-04-29  Martin Baulig  <martin@ximian.com>
6432
6433         * class.cs (ConstructorInitializer.Resolve): Check whether the
6434         parent .ctor is accessible.  Fixes #52146.
6435
6436 2004-04-29  Martin Baulig  <martin@ximian.com>
6437
6438         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6439
6440         * statement.cs (Using.EmitLocalVariableDecls): Use
6441         TypeManager.idisposable_type, not typeof (IDisposable).
6442         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6443
6444 2004-04-29  Martin Baulig  <martin@ximian.com>
6445
6446         * class.cs (Event.Define): Don't emit the field and don't set
6447         RTSpecialName and SpecialName for events on interfaces.  Fixes
6448         #57703. 
6449
6450 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6451
6452         Refactor Attribute.ApplyAttributes.
6453         * attribute.cs (Attributable): New base class for objects that can
6454         have Attributes applied on them.
6455         (Attribute): Make AttributeUsage fields public.
6456         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6457         (Attribute.IsInternalCall): New property.
6458         (Attribute.UsageAttr): Convert to a public read-only property.
6459         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6460         (Attribute.ResolveType, Attribute.Resolve)
6461         (Attribute.ScanForIndexerName): Update to reflect changes.
6462         (Attribute.CheckAttributeTarget): Re-format.
6463         (Attribute.ApplyAttributes): Refactor, to various
6464         Attributable.ApplyAttributeBuilder methods.
6465         * decl.cs (MemberCore): Make Attributable.
6466         * class.cs (Accessor): Make Attributable.
6467         (MethodData.ApplyAttributes): Use proper attribute types, not
6468         attribute names.
6469         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6470         (TypeContainer.ApplyAttributeBuilder)
6471         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6472         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6473         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6474         (Operator.ApplyAttributeBuilder): New factored-out methods.
6475         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6476         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6477         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6478         * parameter.cs (ParameterBase): New Attributable base class
6479         that can also represent Return types.
6480         (Parameter): Update to the changes.
6481
6482 2004-04-29  Jackson Harper  <jackson@ximian.com>
6483
6484         * driver.cs: Prefer the corlib system version when looking for
6485         assemblies in the GAC. This is still a hack, but its a better hack
6486         now.
6487         
6488 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6489
6490         * decl.cs, enum.cs: Improved error 3005 reporting.
6491   
6492         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6493         (related_symbols): New private member for list of symbols
6494         related to reported error/warning.
6495         
6496         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6497
6498 2004-04-29  Martin Baulig  <martin@ximian.com>
6499
6500         * ecore.cs (Expression.Constantify): If we're an enum and
6501         TypeManager.TypeToCoreType() doesn't give us another type, use
6502         t.UnderlyingSystemType.  Fixes #56178.  
6503
6504 2004-04-29  Martin Baulig  <martin@ximian.com>
6505
6506         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6507         interfaces and for each interface, only add members directly
6508         declared in that interface.  Fixes #53255.
6509
6510 2004-04-28  Martin Baulig  <martin@ximian.com>
6511
6512         * expression.cs (ConditionalLogicalOperator): Use a temporary
6513         variable for `left' to avoid that we evaluate it more than once;
6514         bug #52588.
6515
6516 2004-04-28  Martin Baulig  <martin@ximian.com>
6517
6518         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6519         `void[]' (CS1547).
6520
6521 2004-04-28  Martin Baulig  <martin@ximian.com>
6522
6523         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6524         void (CS1547).
6525
6526         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6527         whether the type is not void (CS1547).
6528
6529 2004-04-28  Martin Baulig  <martin@ximian.com>
6530
6531         * expression.cs (Unary.DoResolveLValue): Override this and report
6532         CS0131 for anything but Operator.Indirection.
6533
6534 2004-04-28  Martin Baulig  <martin@ximian.com>
6535
6536         Committing a patch from Ben Maurer; see bug #50820.
6537
6538         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6539         check for classes.
6540
6541         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6542         classes.        
6543
6544 2004-04-28  Martin Baulig  <martin@ximian.com>
6545
6546         Committing a patch from Ben Maurer; see bug #50820.
6547
6548         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6549         check for classes.
6550
6551         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6552         classes.        
6553
6554 2004-04-28  Martin Baulig  <martin@ximian.com>
6555
6556         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6557         (Block.AddLabel): Call DoLookupLabel() to only search in the
6558         current block.
6559
6560 2004-04-28  Martin Baulig  <martin@ximian.com>
6561
6562         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6563         comparing StringConstants and NullLiterals in Equality and Inequality.
6564
6565 2004-04-28  Jackson Harper  <jackson@ximian.com>
6566
6567         * driver.cs: Attempt to load referenced assemblies from the
6568         GAC. This is the quick and dirty version of this method that
6569         doesnt take into account versions and just takes the first
6570         canidate found. Will be good enough for now as we will not have more
6571         then one version installed into the GAC until I update this method.
6572
6573 2004-04-28  Martin Baulig  <martin@ximian.com>
6574
6575         * typemanager.cs (TypeManager.CheckStructCycles): New public
6576         static method to check for cycles in the struct layout.
6577
6578         * rootcontext.cs (RootContext.PopulateTypes): Call
6579         TypeManager.CheckStructCycles() for each TypeContainer.
6580         [Note: We only need to visit each type once.]
6581
6582 2004-04-28  Martin Baulig  <martin@ximian.com>
6583
6584         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6585
6586         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6587         success and added `out object value'.  Use a `bool resolved' field
6588         to check whether we've already been called rather than
6589         `ConstantValue != null' since this breaks for NullLiterals.
6590
6591 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6592
6593         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6594         setting of this flag, since the 'set' method may be non-public.
6595
6596 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6597
6598         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6599         check on current_vector.Block.
6600
6601 2004-04-27  Martin Baulig  <martin@ximian.com>
6602
6603         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6604         a field initializer.  Fixes #56459.
6605
6606 2004-04-27  Martin Baulig  <martin@ximian.com>
6607
6608         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6609         we're not attempting to use an indexer.  Fixes #52154.
6610
6611 2004-04-27  Martin Baulig  <martin@ximian.com>
6612
6613         * statement.cs (Return): Don't create a return label if we don't
6614         need it; reverts my change from January 20th.  Thanks to Ben
6615         Maurer for this.
6616
6617 2004-04-27  Martin Baulig  <martin@ximian.com>
6618
6619         According to the spec, `goto' can only leave a nested scope, but
6620         never enter it.
6621
6622         * statement.cs (Block.LookupLabel): Only lookup in the current
6623         block, don't recurse into parent or child blocks.
6624         (Block.AddLabel): Check in parent and child blocks, report
6625         CS0140/CS0158 if we find a duplicate.
6626         (Block): Removed this indexer for label lookups.
6627         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6628         this already does the error reporting for us.
6629
6630         * flowanalysis.cs
6631         (FlowBranching.UsageVector.Block): New public variable; may be null.
6632         (FlowBranching.CreateSibling): Added `Block' argument.
6633         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6634         label for the target of a `goto' and check whether we're not
6635         leaving a `finally'.
6636
6637 2004-04-27  Martin Baulig  <martin@ximian.com>
6638
6639         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6640         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6641         just for returns).
6642
6643 2004-04-27  Martin Baulig  <martin@ximian.com>
6644
6645         * statement.cs (Block.AddLabel): Also check for implicit blocks
6646         and added a CS0158 check.
6647
6648 2004-04-27  Martin Baulig  <martin@ximian.com>
6649
6650         * flowanalysis.cs (FlowBranchingLoop): New class.
6651         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6652         UsageVector's instead of an ArrayList.
6653         (FlowBranching.Label): Likewise.
6654         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6655         (FlowBranching.AddBreakVector): New method.
6656
6657 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6658
6659         * attribute.cs: Small regression fix: only convert the type if we
6660         the type is different, fixes System.Drawing build.
6661
6662 2004-04-27  Martin Baulig  <martin@ximian.com>
6663
6664         * attribute.cs (Attribute.Resolve): If we have a constant value
6665         for a named field or property, implicity convert it to the correct
6666         type.
6667
6668 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6669
6670         * statement.cs (Block.Block): Implicit blocks share
6671         'child_variable_names' fields with parent blocks.
6672         (Block.AddChildVariableNames): Remove.
6673         (Block.AddVariable): Mark variable as "used by a child block" in
6674         every surrounding block.
6675         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6676         been used in a child block, complain about violation of "Invariant
6677         meaning in blocks" rule.
6678         * cs-parser.jay (declare_local_variables): Don't use
6679         AddChildVariableNames.
6680         (foreach_statement): Don't create an implicit block: 'foreach'
6681         introduces a scope.
6682
6683 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6684
6685         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6686         converting from 0L to ulong.  Fixes 57522.
6687
6688 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6689
6690         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6691         derived class hides via 'new' keyword field from base class (test-242.cs).
6692         TODO: Handle this in the more general way.
6693         
6694         * class.cs (CheckBase): Ditto.
6695
6696 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6697
6698         * decl.cs (caching_flags): New member for storing cached values
6699         as bit flags.
6700         (MemberCore.Flags): New enum where bit flags for caching_flags
6701         are defined.
6702         (MemberCore.cls_compliance): Moved to caching_flags.
6703         (DeclSpace.Created): Moved to caching_flags.
6704
6705         * class.cs: Use caching_flags instead of DeclSpace.Created
6706         
6707 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6708
6709         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6710         if we are only a derived class, not a nested class.
6711
6712         * typemanager.cs: Same as above, but do this at the MemberLookup
6713         level (used by field and methods, properties are handled in
6714         PropertyExpr).   Allow for the qualified access if we are a nested
6715         method. 
6716
6717 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6718
6719         * class.cs: Refactoring.
6720         (IMethodData): New inteface; Holds links to parent members
6721         to avoid member duplication (reduced memory allocation).
6722         (Method): Implemented IMethodData interface.
6723         (PropertyBase): New inner classes for get/set methods.
6724         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6725         (Event): New inner classes for add/remove methods.
6726         (Event.DelegateMethod): Implemented IMethodData interface.
6727
6728         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6729         EmitContext (related to class.cs refactoring).
6730
6731 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6732
6733         * delegate.cs (Delegate.VerifyApplicability): If the number of
6734         arguments are the same as the number of parameters, first try to
6735         verify applicability ignoring  any 'params' modifier on the last
6736         parameter.
6737         Fixes #56442.
6738
6739 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6740
6741         * class.cs (TypeContainer.AddIndexer): Use
6742         'ExplicitInterfaceName' to determine if interface name was
6743         explicitly specified.  'InterfaceType' is not initialized at this time.
6744         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6745         Indexers array is already in the required order.  Initialize
6746         'IndexerName' only if there are normal indexers.
6747         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6748         (TypeContainer.Emit): Emit DefaultMember attribute only if
6749         IndexerName is initialized.
6750         Fixes #56300.
6751
6752 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6753
6754         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6755         Fixes #57007
6756
6757 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6758
6759         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6760         attributes.
6761         Fix for #56456.
6762
6763         * attribute.cs (Attribute.Resolve): Check for duplicate named
6764         attributes.
6765         Fix for #56463.
6766
6767 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6768
6769         * iterators.cs (MarkYield): track whether we are in an exception,
6770         and generate code accordingly.  Use a temporary value to store the
6771         result for our state.
6772
6773         I had ignored a bit the interaction of try/catch with iterators
6774         since their behavior was not entirely obvious, but now it is
6775         possible to verify that our behavior is the same as MS .NET 2.0
6776
6777         Fixes 54814
6778
6779 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6780
6781         * iterators.cs: Avoid creating temporaries if there is no work to
6782         do. 
6783
6784         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6785         Enumerations, use TypeManager.EnumToUnderlying and call
6786         recursively. 
6787
6788         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6789         bug #57013
6790
6791         (This.Emit): Use EmitContext.EmitThis to emit our
6792         instance variable.
6793
6794         (This.EmitAssign): Ditto.
6795
6796         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6797         codepaths, we will move all the functionality into
6798         Mono.CSharp.This 
6799
6800         (FieldExpr.EmitAssign): Ditto.
6801
6802         This fixes several hidden bugs that I uncovered while doing a code
6803         review of this today.
6804
6805         * codegen.cs (EmitThis): reworked so the semantics are more clear
6806         and also support value types "this" instances.
6807
6808         * iterators.cs: Changed so that for iterators in value types, we
6809         do not pass the value type as a parameter.  
6810
6811         Initialization of the enumerator helpers is now done in the caller
6812         instead of passing the parameters to the constructors and having
6813         the constructor set the fields.
6814
6815         The fields have now `assembly' visibility instead of private.
6816
6817 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6818
6819         * expression.cs (Argument.Resolve): Check if fields passed as ref
6820         or out are contained in a MarshalByRefObject.
6821
6822         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6823         another compiler type.
6824
6825 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6826
6827         * class.cs (Indexer.Define): use the new name checking method.
6828         Also, return false on an error.
6829         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6830         (is_identifier_[start/part]_character): make static.
6831
6832 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6833
6834         * expression.cs (Binary.ResolveOperator): Do no append strings
6835         twice: since we can be invoked more than once (array evaluation)
6836         on the same concatenation, take care of this here.  Based on a fix
6837         from Ben (bug #56454)
6838
6839 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6840
6841         * codegen.cs: Fix another case where CS1548 must be reported (when 
6842         delay-sign isn't specified and no private is available #56564). Fix
6843         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6844         error when MCS is used on the MS runtime and we need to delay-sign 
6845         (which seems unsupported by AssemblyBuilder - see #56621).
6846
6847 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6848
6849         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6850         (TypeManager.ComputeNamespaces): Faster implementation for
6851         Microsoft runtime.
6852
6853         * compiler.csproj: Updated AssemblyName to mcs.
6854
6855 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6856
6857         * rootcontext.cs: Add new types to the boot resolution.
6858
6859         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6860         MulticastDelegate is not allowed.
6861
6862         * typemanager.cs: Add new types to lookup: System.TypedReference
6863         and ArgIterator.
6864
6865         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6866         check for TypedReference or ArgIterator, they are not allowed. 
6867
6868         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6869         makes us properly catch 1510 in some conditions (see bug 56016 for
6870         details). 
6871
6872 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6873
6874         * CryptoConvert.cs: update from corlib version
6875         with endian fixes.
6876
6877 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6878
6879         * class.cs (Indexer.Define): Check indexername declaration
6880
6881 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6882
6883         * attribute.cs (IsClsCompliant): Fixed problem with handling
6884         all three states (compliant, not-compliant, undetected).
6885
6886 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6887
6888         * attribute.cs (Attribute): Location is now public.
6889         (Resolve): Store resolved arguments (pos_values) in attribute class.
6890         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6891         (GetClsCompliantAttributeValue): New method that gets
6892         CLSCompliantAttribute value.
6893         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6894         if exists else null.
6895         (AttributeTester): New class for CLS-Compliant verification routines.
6896
6897         * class.cs (Emit): Add CLS-Compliant verification.
6898         (Method.GetSignatureForError): Implemented.
6899         (Constructor.GetSignatureForError): Implemented
6900         (Constructor.HasCompliantArgs): Returns if constructor has
6901         CLS-Compliant arguments.
6902         (Constructor.Emit): Override.
6903         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6904         is needed to test only parameters.
6905         (FieldBase.GetSignatureForError): Implemented.
6906         (TypeContainer): New member for storing base interfaces.
6907         (TypeContainer.FindMembers): Search in base interfaces too.
6908
6909         * codegen.cs (GetClsComplianceAttribute): New method that gets
6910         assembly or module CLSCompliantAttribute value.
6911         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
6912         for assembly.
6913         (ModuleClass.Emit): Add error 3012 test.
6914
6915         * const.cs (Emit): Override and call base for CLS-Compliant tests.
6916
6917         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
6918         state for all decl types.
6919         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
6920         if CLS-Compliant tests are required.
6921         (IsClsCompliaceRequired): New method. Analyze whether code
6922         must be CLS-Compliant.
6923         (IsExposedFromAssembly): New method. Returns true when MemberCore
6924         is exposed from assembly.
6925         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
6926         value or gets cached value.
6927         (HasClsCompliantAttribute): New method. Returns true if MemberCore
6928         is explicitly marked with CLSCompliantAttribute.
6929         (IsIdentifierClsCompliant): New abstract method. This method is
6930         used to testing error 3005.
6931         (IsIdentifierAndParamClsCompliant): New method. Common helper method
6932         for identifier and parameters CLS-Compliant testing.
6933         (VerifyClsCompliance): New method. The main virtual method for
6934         CLS-Compliant verifications.
6935         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6936         null. I don't know why is null (too many public members !).
6937         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6938         and get value of first CLSCompliantAttribute that found.
6939
6940         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6941         (VerifyClsCompliance): Override and add extra tests.
6942
6943         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6944         clscheck- disable CLS-Compliant verification event if assembly is has
6945         CLSCompliantAttribute(true).
6946
6947         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6948         ApllyAttribute is now called in emit section as in the other cases.
6949         Possible future Emit integration.
6950         (IsIdentifierClsCompliant): New override.
6951         (VerifyClsCompliance): New override.
6952         (GetEnumeratorName): Returns full enum name.
6953
6954         * parameter.cs (GetSignatureForError): Implemented.
6955
6956         * report.cs (WarningData): New struct for Warning message information.
6957         (LocationOfPreviousError): New method.
6958         (Warning): New method. Reports warning based on the warning table.
6959         (Error_T): New method. Reports error based on the error table.
6960
6961         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
6962         verifications are done here.
6963
6964         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
6965
6966         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
6967         CLSCompliantAttribute.
6968         (all_imported_types): New member holds all imported types from other
6969         assemblies.
6970         (LoadAllImportedTypes): New method fills static table with exported types
6971         from all referenced assemblies.
6972         (Modules): New property returns all assembly modules.
6973
6974 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
6975
6976         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
6977         throwing a parser error.
6978
6979         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
6980         which removes the hardcoded get_/set_ prefixes for properties, as
6981         IL allows for the properties to be named something else.  
6982
6983         Bug #56013
6984
6985         * expression.cs: Do not override operand before we know if it is
6986         non-null.  Fix 56207
6987
6988 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6989
6990         * typemanager.cs: support for pinned variables.
6991
6992 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6993
6994         * decl.cs, typemanager.cs: Avoid using an arraylist
6995         as a buffer if there is only one result set.
6996
6997 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6998
6999         * expression.cs: Make sure you cant call a static method
7000         with an instance expression, bug #56174.
7001
7002 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7003
7004         * class.cs (IsDuplicateImplementation): Improve error reporting to
7005         flag 663 (method only differs in parameter modifier).
7006
7007         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7008         in preprocessor directives.
7009
7010         * location.cs (LookupFile): Allow for the empty path.
7011
7012         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7013         better approach for some of that patch, but its failing with the
7014         CharSet enumeration.  For now try/catch will do.
7015
7016         * typemanager.cs: Do not crash if a struct does not have fields.
7017         Fixes 56150.
7018
7019 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7020
7021         * expression.cs: cs0213, cant fix a fixed expression.
7022         fixes 50231.
7023
7024 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7025
7026         * cs-parser.jay: detect invalid embeded statements gracefully.
7027         bug #51113.
7028
7029 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7030
7031         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7032         As a regex:
7033         s/
7034         the invocation type may not be a subclass of the tye of the item/
7035         The type of the item must be a subclass of the invocation item.
7036         /g
7037
7038         Fixes bug #50820.
7039
7040 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7041
7042         * attribute.cs: Added methods to get a string and a bool from an
7043         attribute. Required to information from AssemblyKeyFileAttribute,
7044         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7045         * codegen.cs: Modified AssemblyName creation to include support for
7046         strongnames. Catch additional exceptions to report them as CS1548.
7047         * compiler.csproj: Updated include CryptoConvert.cs.
7048         * compiler.csproj.user: Removed file - user specific configuration.
7049         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7050         Mono.Security assembly. The original class is maintained and tested in
7051         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7052         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7053         like CSC 8.0 (C# v2) supports.
7054         * Makefile: Added CryptoConvert.cs to mcs sources.
7055         * rootcontext.cs: Added new options for strongnames.
7056
7057 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7058
7059         * driver.cs: For --expect-error, report error code `2'
7060         if the program compiled with no errors, error code `1' if
7061         it compiled with an error other than the one expected.
7062
7063 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7064
7065         * compiler.csproj: Updated for Visual Studio .NET 2003.
7066         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7067         * compiler.sln: Updated for Visual Studio .NET 2003.
7068
7069 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7070
7071         * expression.cs: Fix bug #47234. We basically need to apply the
7072         rule that we prefer the conversion of null to a reference type
7073         when faced with a conversion to 'object' (csc behaviour).
7074
7075 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7076
7077         * statement.cs: Shorter form for foreach, eliminates
7078         a local variable. r=Martin.
7079
7080 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7081
7082         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7083         checks if we can use brtrue/brfalse to test for 0.
7084         * expression.cs: use the above in the test for using brtrue/brfalse.
7085         cleanup code a bit.
7086
7087 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7088
7089         * expression.cs: Rewrite string concat stuff. Benefits:
7090
7091         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7092         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7093         rather than a concat chain.
7094
7095         * typemanager.cs: Add lookups for more concat overloads.
7096
7097 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7098
7099         * expression.cs: Emit shorter il code for array init.
7100
7101         newarr
7102         dup
7103         // set 1
7104
7105         // set 2
7106
7107         newarr
7108         stloc.x
7109
7110         ldloc.x
7111         // set 1
7112
7113         ldloc.x
7114         // set 2
7115
7116 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7117
7118         * statement.cs: Before, two switch blocks would be merged if the
7119         total size of the blocks (end_item - begin_item + 1) was less than
7120         two times the combined sizes of the blocks.
7121
7122         Now, it will only merge if after the merge at least half of the
7123         slots are filled.
7124
7125         fixes 55885.
7126
7127 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7128
7129         * class.cs : csc build fix for GetMethods(). See bug #52503.
7130
7131 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7132
7133         * expression.cs: Make sure fp comparisons work with NaN.
7134         This fixes bug #54303. Mig approved this patch a long
7135         time ago, but we were not able to test b/c the runtime
7136         had a related bug.
7137
7138 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7139
7140         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7141
7142 2004-03-19  Martin Baulig  <martin@ximian.com>
7143
7144         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7145         error here and not in our caller.
7146
7147 2004-03-19  Martin Baulig  <martin@ximian.com>
7148
7149         * interface.cs: Completely killed this file.
7150         (Interface): We're now a TypeContainer and live in class.cs.
7151
7152         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7153         argument; we're now also called for interfaces.
7154         (TypeContainer.DefineMembers): Allow this method being called
7155         multiple times.
7156         (TypeContainer.GetMethods): New public method; formerly known as
7157         Interface.GetMethod().  This is used by PendingImplementation.
7158         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7159         it's now private and non-static.
7160         (Interface): Moved this here; it's now implemented similar to
7161         Class and Struct.
7162         (Method, Property, Event, Indexer): Added `bool is_interface'
7163         argument to their .ctor's.
7164         (MemberBase.IsInterface): New public field.
7165
7166         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7167         instances instead of InterfaceMethod, InterfaceProperty, etc.
7168         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7169         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7170
7171 2004-03-19  Martin Baulig  <martin@ximian.com>
7172
7173         * class.cs (MethodCore.IsDuplicateImplementation): New private
7174         method which does the CS0111 checking.
7175         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7176         Use IsDuplicateImplementation().
7177
7178 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7179
7180         * decl.cs (FindMemberToOverride): New method to find the correct
7181         method or property to override in the base class.
7182         * class.cs
7183             - Make Method/Property use the above method to find the
7184               version in the base class.
7185             - Remove the InheritableMemberSignatureCompare as it is now
7186               dead code.
7187
7188         This patch makes large code bases much faster to compile, as it is
7189         O(n) rather than O(n^2) to do this validation.
7190
7191         Also, it fixes bug 52458 which is that nested classes are not
7192         taken into account when finding the base class member.
7193
7194         Reviewed/Approved by Martin.
7195
7196 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7197
7198         * interface.cs: In all interface classes removed redundant
7199         member initialization.
7200
7201 2004-03-16  Martin Baulig  <martin@ximian.com>
7202
7203         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7204
7205 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7206
7207         * decl.cs (DefineTypeAndParents): New helper method to define a
7208         type's containers before the type itself is defined;  This is a
7209         bug exposed by the recent changes to Windows.Forms when an
7210         implemented interface was defined inside a class that had not been
7211         built yet.   
7212
7213         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7214
7215         (Check): Loop correctly to report errors modifiers
7216         (UNSAFE was not in the loop, since it was the same as TOP).
7217
7218         * interface.cs: Every interface member now takes a ModFlags,
7219         instead of a "is_new" bool, which we set on the base MemberCore. 
7220
7221         Every place where we called "UnsafeOk" in the interface, now we
7222         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7223         the unsafe settings from the member declaration instead of the
7224         container interface. 
7225
7226         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7227
7228         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7229         `set_indexer_name' to the pending bits (one per type).
7230
7231         We fixed a bug today that was picking the wrong method to
7232         override, since for properties the existing InterfaceMethod code
7233         basically ignored the method name.  Now we make sure that the
7234         method name is one of the valid indexer names.
7235
7236 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7237  
7238         * support.cs (SeekableStreamReader): Keep track of stream byte
7239         positions and don't mix them with character offsets to the buffer.
7240
7241         Patch from Gustavo Giráldez
7242
7243 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7244
7245         * interface.cs (InterfaceSetGetBase): Removed double member
7246         initialization, base class does it as well.
7247
7248 2004-03-13  Martin Baulig  <martin@ximian.com>
7249
7250         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7251         when compiling corlib.
7252
7253 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7254
7255         * convert.cs (ExplicitConversion): We were reporting an error on
7256         certain conversions (object_type source to a value type, when the
7257         expression was `null') before we had a chance to pass it through
7258         the user defined conversions.
7259
7260         * driver.cs: Replace / and \ in resource specifications to dots.
7261         Fixes 50752
7262
7263         * class.cs: Add check for duplicate operators.  Fixes 52477
7264
7265 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7266
7267         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7268         that are in the middle of the statements, not only at the end.
7269         Fixes #54987
7270
7271         * class.cs (TypeContainer.AddField): No longer set the
7272         `HaveStaticConstructor' flag, now we call it
7273         `UserDefineStaticConstructor' to diferentiate the slightly
7274         semantic difference.
7275
7276         The situation is that we were not adding BeforeFieldInit (from
7277         Modifiers.TypeAttr) to classes that could have it.
7278         BeforeFieldInit should be set to classes that have no static
7279         constructor. 
7280
7281         See:
7282
7283         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7284
7285         And most importantly Zoltan's comment:
7286
7287         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7288
7289         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7290          before its static fields are used', i.e. initialization does not need
7291          to be triggered by the first access to the type. Setting this flag
7292          helps the JIT to compile better code, since it can run the static
7293          constructor at JIT time, and does not need to generate code to call it
7294          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7295          this flag for lots of classes like String. 
7296          
7297          csc sets this flag if the type does not have an explicit static 
7298          constructor. The reasoning seems to be that if there are only static
7299          initalizers for a type, and no static constructor, then the programmer
7300          does not care when this initialization happens, so beforefieldinit
7301          can be used.
7302          
7303          This bug prevents the AOT compiler from being usable, since it 
7304          generates so many calls to mono_runtime_class_init that the AOT code
7305          is much slower than the JITted code. The JITted code is faster, 
7306          because it does not generate these calls if the vtable is type is
7307          already initialized, which is true in the majority of cases. But the
7308          AOT compiler can't do this."
7309
7310 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7311
7312         * class.cs (MethodData.Emit): Refactor the code so symbolic
7313         information is generated for destructors;  For some reasons we
7314         were taking a code path that did not generate symbolic information
7315         before. 
7316
7317 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7318
7319         * class.cs: Create a Constructor.CheckBase method that
7320         takes care of all validation type code. The method
7321         contains some code that was moved from Define.
7322
7323         It also includes new code that checks for duplicate ctors.
7324         This fixes bug #55148.
7325
7326 2004-03-09  Joshua Tauberer <tauberer@for.net>
7327
7328         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7329         a { ... }-style array creation invokes EmitStaticInitializers
7330         which is not good for reference-type arrays.  String, decimal
7331         and now null constants (NullCast) are not counted toward
7332         static initializers.
7333
7334 2004-03-05  Martin Baulig  <martin@ximian.com>
7335
7336         * location.cs (SourceFile.HasLineDirective): New public field;
7337         specifies whether the file contains or is referenced by a "#line"
7338         directive.
7339         (Location.DefineSymbolDocuments): Ignore source files which
7340         either contain or are referenced by a "#line" directive.        
7341
7342 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7343
7344         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7345         direct access to our parent, so check the method inline there.
7346
7347 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7348
7349         * expression.cs (Invocation.EmitCall): Miguel's last commit
7350         caused a regression. If you had:
7351
7352             T t = null;
7353             t.Foo ();
7354
7355         In Foo the implict this would be null.
7356
7357 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7358
7359         * expression.cs (Invocation.EmitCall): If the method is not
7360         virtual, do not emit a CallVirt to it, use Call.
7361
7362         * typemanager.cs (GetFullNameSignature): Improve the method to
7363         cope with ".ctor" and replace it with the type name.
7364
7365         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7366         as an argument the ConstructorBuilder where it is being defined,
7367         to catch the recursive constructor invocations.
7368
7369 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7370
7371         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7372         routines to check if a type is an enumerable/enumerator allow
7373         classes that implement the IEnumerable or IEnumerator interfaces.
7374
7375         * class.cs (Property, Operator): Implement IIteratorContainer, and
7376         implement SetYields.
7377
7378         (Property.Define): Do the block swapping for get_methods in the
7379         context of iterators.   We need to check if Properties also
7380         include indexers or not.
7381
7382         (Operator): Assign the Block before invoking the
7383         OperatorMethod.Define, so we can trigger the Iterator code
7384         replacement. 
7385
7386         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7387         Property and Operator classes are not created when we parse the
7388         declarator but until we have the block completed, so we use a
7389         singleton SimpleIteratorContainer.Simple to flag whether the
7390         SetYields has been invoked.
7391
7392         We propagate this setting then to the Property or the Operator to
7393         allow the `yield' to function.
7394
7395 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7396
7397         * codegen.cs: Implemented attribute support for modules.
7398         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7399         Assembly/Module functionality.
7400
7401         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7402         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7403         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7404
7405 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7406
7407         * interface.cs (FindMembers): The operation is performed on all base
7408         interfaces and not only on the first. It is required for future CLS Compliance patch.
7409
7410 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7411
7412         * statement.cs, codegen.cs:
7413         This patch deals with patterns such as:
7414
7415         public class List : IEnumerable {
7416
7417                 public MyEnumerator GetEnumerator () {
7418                         return new MyEnumerator(this);
7419                 }
7420
7421                 IEnumerator IEnumerable.GetEnumerator () {
7422                         ...
7423                 }
7424                 
7425                 public struct MyEnumerator : IEnumerator {
7426                         ...
7427                 }
7428         }
7429
7430         Before, there were a few things we did wrong:
7431         1) we would emit callvirt on a struct, which is illegal
7432         2) we emited ldarg when we needed to emit ldarga
7433         3) we would mistakenly call the interface methods on an enumerator
7434         type that derived from IEnumerator and was in another assembly. For example:
7435
7436         public class MyEnumerator : IEnumerator
7437
7438         Would have the interface methods called, even if there were public impls of the
7439         method. In a struct, this lead to invalid IL code.
7440
7441 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7442
7443         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7444           renamed to Emit.
7445
7446         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7447
7448 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7449
7450         * cs-parser.jay: Fix small regression: we were not testing V2
7451         compiler features correctly.
7452
7453         * interface.cs: If the emit context is null, then create one
7454
7455 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7456
7457         * decl.cs (GetSignatureForError): New virtual method to get full name
7458           for error messages.
7459
7460         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7461           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7462
7463         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7464           Duplicated members and code in these classes has been removed.
7465           Better encapsulation in these classes.
7466
7467 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7468
7469         * assign.cs (Assign.DoResolve): When dealing with compound
7470         assignments, there is a new rule in ECMA C# 2.4 (might have been
7471         there before, but it is documented here) that states that in:
7472
7473         a op= b;
7474
7475         If b is of type int, and the `op' is a shift-operator, then the
7476         above is evaluated as:
7477
7478         a = (int) a op b 
7479
7480         * expression.cs (Binary.ResolveOperator): Instead of testing for
7481         int/uint/long/ulong, try to implicitly convert to any of those
7482         types and use that in pointer arithmetic.
7483
7484         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7485         method to print information for from the type, not from the
7486         null-method we were given.
7487
7488 2004-02-01  Duncan Mak  <duncan@ximian.com>
7489
7490         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7491         parsing for cmd, fixes bug #53694.
7492
7493 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7494
7495         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7496         in the member name duplication tests. Property and operator name duplication
7497         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7498
7499 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7500
7501         * interface.cs (PopulateMethod): Fixed crash when interface method
7502         returns not existing type (error test cs0246-3.cs).
7503
7504 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7505
7506         * cs-parser.jay (interface_accessors): Re-write actions to also
7507         store attributes attached to get and set methods. Fix spelling
7508         while at it.
7509
7510         (inteface_property_declaration): Modify accordingly.
7511
7512         (InterfaceAccessorInfo): New helper class to store information to pass
7513         around between rules that use interface_accessors.
7514
7515         * interface.cs (Emit): Apply attributes on the get and set
7516         accessors of properties and indexers too.
7517
7518         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7519         right MethodBuilder when applying attributes to the get and set accessors.
7520
7521 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7522
7523         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7524
7525 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7526
7527         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7528
7529 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7530
7531         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7532         changes that treat `yield' specially when present before `break'
7533         or `return' tokens.
7534
7535         * cs-tokenizer.cs: yield is no longer a keyword.
7536
7537 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7538
7539         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7540         setting for default constructors.
7541         For default constructors are almost every time set wrong Modifier. The
7542         generated IL code has been alright. But inside mcs this values was
7543         wrong and this was reason why several of my CLS Compliance tests
7544         failed.
7545
7546 2004-01-22  Martin Baulig  <martin@ximian.com>
7547
7548         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7549         not a QualifiedIdentifier.  This is what `type_name_expression'
7550         was previously doing.
7551         (type_name_expression): Removed; the code is now in
7552         `namespace_or_type_name'.
7553         (qualified_identifier): Removed, use `namespace_or_type_name'
7554         instead.
7555         (QualifiedIdentifier): Removed this class.      
7556
7557 2004-01-22  Martin Baulig  <martin@ximian.com>
7558
7559         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7560         not a string as alias name.
7561
7562 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7563
7564         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7565         #52730 bug, and instead compute correctly the need to use a
7566         temporary variable when requesting an address based on the
7567         static/instace modified of the field and the constructor.
7568  
7569 2004-01-21  Martin Baulig  <martin@ximian.com>
7570
7571         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7572         class and namespace before looking up aliases.  Fixes #52517.
7573
7574 2004-01-21  Martin Baulig  <martin@ximian.com>
7575
7576         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7577         assinged in a 'try'; fixes exception4.cs.
7578
7579 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7580         * class.cs : Implemented parameter-less constructor for TypeContainer
7581
7582         * decl.cs: Attributes are now stored here. New property OptAttributes
7583
7584         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7585
7586         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7587
7588 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7589
7590         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7591           (CSharpSignature): New method for indexer and property signature.
7592
7593 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7594
7595         * pending.cs (IsVirtualFilter): Faster implementation.
7596
7597 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7598
7599         * typemanager.cs: Avoid inclusion of same assembly more than once.
7600
7601 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7602
7603         * cs-parser.jay: Fixed problem where the last assembly attribute
7604           has been applied also to following declaration (class, struct, etc.)
7605           
7606 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7607
7608         * class.cs: Added error CS0538, CS0539 reporting.
7609         Fixed crash on Microsoft runtime when field type is void.
7610
7611         * cs-parser.jay: Added error CS0537 reporting.
7612
7613         * pending.cs: Added error CS0535 reporting.
7614         Improved error report for errors CS0536, CS0534.
7615
7616 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7617
7618         Merge a few bits from the Anonymous Method MCS tree.
7619
7620         * statement.cs (ToplevelBlock): New class for toplevel methods,
7621         will hold anonymous methods, lifted variables.
7622
7623         * cs-parser.jay: Create toplevel blocks for delegates and for
7624         regular blocks of code. 
7625
7626 2004-01-20  Martin Baulig  <martin@ximian.com>
7627
7628         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7629         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7630         and `NeedExplicitReturn'; added `IsLastStatement'.
7631         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7632         have a `ReturnLabel' or we're not unreachable.
7633
7634         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7635         child's reachability; don't just override ours with it.  Fixes
7636         #58058 (lluis's example).
7637         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7638         InFinally(), InLoop(), InSwitch() and
7639         BreakCrossesTryCatchBoundary() methods.
7640
7641         * statement.cs (Return): Do all error checking in Resolve().
7642         Unless we are the last statement in a top-level block, always
7643         create a return label and jump to it.
7644         (Break, Continue): Do all error checking in Resolve(); also make
7645         sure we aren't leaving a `finally'.
7646         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7647         statement in a top-level block.
7648         (Block.Flags): Added `IsDestructor'.
7649         (Block.IsDestructor): New public property.
7650
7651 2004-01-20  Martin Baulig  <martin@ximian.com>
7652
7653         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7654
7655 2004-01-20  Martin Baulig  <martin@ximian.com>
7656
7657         * statement.cs (Statement.ResolveUnreachable): New public method.
7658         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7659         (Block.Resolve): Resolve unreachable statements.
7660
7661 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7662
7663         * expression.cs: We need to fix the case where we do
7664         not have a temp variable here.
7665
7666         * assign.cs: Only expression compound assignments need
7667         temporary variables.
7668
7669 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7670
7671         * flowanalysis.cs: Reduce memory allocation in a few ways:
7672           - A block with no variables should not allocate a bit
7673             vector for itself.
7674           - A method with no out parameters does not need any tracking
7675             for assignment of the parameters, so we need not allocate
7676             any data for it.
7677           - The arrays:
7678                 public readonly Type[] VariableTypes;
7679                 public readonly string[] VariableNames;
7680             Are redundant. The data is already stored in the variable
7681             map, so we need not allocate another array for it.
7682           - We need to add alot of checks for if (params | locals) == null
7683             due to the first two changes.
7684
7685 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7686
7687         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7688         implement IMemoryLocation, we store a copy on a local variable and
7689         take the address of it.  Patch from Benjamin Jemlich
7690
7691         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7692         to use a special "type_name_expression" rule which reduces the
7693         number of "QualifiedIdentifier" classes created, and instead
7694         directly creates MemberAccess expressions.
7695
7696 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7697
7698         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7699         that fixes #52853.  Null literal assignment to ValueType
7700
7701         * class.cs (MethodData.Emit): Instead of checking the name of the
7702         method to determine if its a destructor, create a new derived
7703         class from Method called Destructor, and test for that.  
7704
7705         * cs-parser.jay: Create a Destructor object instead of a Method.  
7706
7707         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7708
7709         Fixes: 52933
7710
7711 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7712
7713         * expression.cs (Binary.ResolveOperator): Perform an implicit
7714         conversion from MethodGroups to their delegate types on the
7715         Addition operation.
7716
7717         * delegate.cs: Introduce a new class DelegateCreation that is the
7718         base class for `NewDelegate' and `ImplicitDelegateCreation',
7719         factor some code in here.
7720
7721         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7722         conversion from MethodGroups to compatible delegate types. 
7723
7724         * ecore.cs (Expression.Resolve): Do not flag error 654
7725         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7726         we allow conversions from MethodGroups to delegate types now.
7727
7728         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7729         assignments in v2 either.
7730
7731 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7732
7733         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7734         static read-only fields in ctors.
7735
7736         Applied patch from Benjamin Jemlich 
7737
7738         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7739
7740 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7741
7742         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7743         here to return true, as they can be used like this:
7744
7745                 (XXX) int.MEMBER ()
7746
7747         Fixed 49836 and all the other dups
7748
7749 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7750
7751         * driver.cs: Implement /win32res and /win32icon.
7752
7753 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7754
7755         * cs-parser.jay: Add a rule to improve error handling for the
7756         common mistake of placing modifiers after the type.
7757
7758 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7759
7760         * cs-parser.jay (interface_event_declaration): Catch
7761         initialization of events on interfaces, and report cs0068
7762
7763         * cs-parser.jay (interface_event_declaration): Catch
7764         initialization of events. 
7765
7766         * ecore.cs: Better report missing constructors.
7767
7768         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7769         the error reporting done in the wrong place.  Fix.
7770
7771         * expression.cs (Binary.ResolveOperator): Catch the 
7772         operator + (E x, E y) error earlier, and later allow for implicit
7773         conversions in operator +/- (E e, U x) from U to the underlying
7774         type of E.
7775
7776         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7777         52596, if the container class is abstract, the default constructor
7778         is protected otherwise its public (before, we were always public).
7779
7780         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7781         fixed statement.
7782
7783         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7784         Jemlich that fixes bug #52597, MCS was generating invalid code for
7785         idisposable structs.   Thanks to Ben for following up with this
7786         bug as well.
7787
7788 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7789
7790         * driver.cs: Allow assemblies without code to be generated, fixes
7791         52230.
7792
7793 2004-01-07  Nick Drochak <ndrochak@gol.com>
7794
7795         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7796
7797 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7798
7799         * cs-parser.jay: Add rules to improve error reporting if fields or
7800         methods are declared at the namespace level (error 116)
7801
7802         * Add rules to catch event add/remove
7803
7804 2004-01-04  David Sheldon <dave-mono@earth.li>
7805
7806   * expression.cs: Added matching ")" to error message for 
7807   CS0077
7808
7809 2004-01-03 Todd Berman <tberman@gentoo.org>
7810
7811         * ecore.cs, attribute.cs:
7812         Applying fix from #52429.
7813
7814 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7815
7816         * ecore.cs, expression.cs, statement.cs:
7817         Total rewrite of how we handle branching. We
7818         now handle complex boolean expressions with fewer
7819         jumps. As well if (x == 0) no longer emits a ceq.
7820
7821         if (x is Foo) is much faster now, because we generate
7822         better code.
7823
7824         Overall, we get a pretty big improvement on our benchmark
7825         tests. The code we generate is smaller and more readable.
7826
7827         I did a full two-stage bootstrap. The patch was reviewed
7828         by Martin and Miguel.
7829
7830 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7831
7832         * cs-parser.jay: Make primary_expression not take a QI.
7833         we dont need this because the member_access rule covers
7834         us here. So we replace the rule with just IDENTIFIER.
7835
7836         This has two good effects. First, we remove a s/r conflict.
7837         Second, we allocate many fewer QualifiedIdentifier objects.
7838
7839 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7840
7841         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7842         set the correct information via SRE. This prevents
7843         hanging on the MS runtime. Fixes #29374.
7844
7845 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7846
7847         * convert.cs: correctly handle conversions to value types
7848         from Enum and ValueType as unboxing conversions.
7849
7850         Fixes bug #52569. Patch by Benjamin Jemlich.
7851
7852 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7853
7854         * expression.cs (BetterConversion): Prefer int -> uint
7855         over int -> ulong (csc's behaviour). This fixed bug #52046.
7856
7857 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7858
7859         * decl.cs (MemberCache.FindMembers): now returns a
7860         MemberInfo [].
7861
7862         * typemanager.cs: In general, go with with ^^.
7863         (CopyNewMethods): take an IList.
7864         (RealMemberLookup): Only allocate an arraylist
7865         if we copy from two sets of methods.
7866
7867         This change basically does two things:
7868         1) Fewer array lists allocated due to CopyNewMethods.
7869         2) the explicit cast in MemberList costed ALOT.
7870
7871 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7872
7873         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7874         a hashtable to avoid needless string allocations when an identifier is
7875         used more than once (the common case).
7876
7877 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7878
7879         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7880         is broken, it will not return anything. So, we
7881         have to use the information we have in mcs to
7882         do the task.
7883
7884         * typemanager.cs: Add a cache for GetInterfaces,
7885         since this will now be used more often (due to ^^)
7886
7887         (GetExplicitInterfaces) New method that gets the
7888         declared, not effective, interfaces on a type
7889         builder (eg, if you have interface IFoo, interface
7890         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
7891         { IBar }.
7892
7893         This patch makes MCS able to bootstrap itself on
7894         Windows again.
7895
7896 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7897
7898         * expression.cs: Remove the Nop's that Miguel put
7899         in by mistake.
7900
7901 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7902
7903         * report.cs, codegen.cs: Give the real stack trace to
7904         the error when an exception is thrown.
7905
7906 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7907
7908         * decl.cs: only allocate hashtables for ifaces if 
7909         it is an iface!
7910
7911 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7912
7913         * expression.cs: fix the error from cs0121-2.cs
7914         (a parent interface has two child interfaces that
7915         have a function with the same name and 0 params
7916         and the function is called through the parent).
7917
7918 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7919
7920         * class.cs, rootcontext.cs, typmanager.cs: do not
7921         leak pointers.
7922
7923 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7924
7925         * codegen.cs: remove stack for the ec flow branching.
7926         It is already a linked list, so no need.
7927
7928 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7929
7930         * Makefile: Allow custom profiler here.
7931
7932 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7933
7934         * typemanager.cs (LookupType):
7935           - Use a static char [], because split takes
7936             a param array for args, so it was allocating
7937             every time.
7938           - Do not store true in a hashtable, it boxes.
7939
7940 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7941
7942         * flowanalysis.cs: bytify common enums.
7943
7944 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7945
7946         * modifiers.cs: Add a new set of flags for the
7947         flags allowed on explicit interface impls.
7948         * cs-parser.jay: catch the use of modifiers in
7949         interfaces correctly.
7950         * class.cs: catch private void IFoo.Blah ().
7951
7952         All related to bug #50572.
7953
7954 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7955
7956         * decl.cs: Rewrite the consistant accessability checking.
7957         Accessability is not linear, it must be implemented in
7958         a tableish way. Fixes #49704.
7959
7960 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7961
7962         * expression.cs: Handle negation in a checked context.
7963         We must use subtraction from zero. Fixes #38674.
7964
7965 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7966
7967         * class.cs: Ignore static void main in DLLs.
7968         * rootcontext.cs: Handle the target type here,
7969         since we are have to access it from class.cs
7970         * driver.cs: account for the above.
7971
7972 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7973
7974         * report.cs: Give line numbers and files if available.
7975
7976 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
7977
7978         * driver.cs: Implement /addmodule.
7979
7980         * typemanager.cs:  Change 'modules' field so it now contains Modules not
7981         ModuleBuilders.
7982
7983 2003-12-20  Martin Baulig  <martin@ximian.com>
7984
7985         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
7986         (FieldBase.IsAssigned): Removed this field.
7987         (FieldBase.SetAssigned): New public method.
7988         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
7989
7990 2003-12-20  Martin Baulig  <martin@ximian.com>
7991
7992         * expression.cs (LocalVariableReference.DoResolve): Don't set
7993         `vi.Used' if we're called from DoResolveLValue().
7994
7995         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
7996         returns the usage vector it just merged into the current one -
7997         pass this one to UsageWarning().
7998         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
7999         of the `EmitContext', don't call this recursively on our children.
8000
8001 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8002
8003         * driver.cs: Implement /target:module.
8004
8005 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8006
8007         * support.cs (CharArrayHashtable): New helper class.
8008
8009         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8010         char arrays, not strings, so we can avoid creating a string in
8011         consume_identifier if the identifier is a keyword.
8012
8013 2003-12-16  Martin Baulig  <martin@ximian.com>
8014
8015         * statement.cs (LocalInfo.Assigned): Removed this property.
8016         (LocalInfo.Flags): Removed `Assigned'.
8017         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8018         and uses flow analysis.
8019         (Block.UsageWarning): Made this method private.
8020         (Block.Resolve): Call UsageWarning() if appropriate.
8021
8022         * expression.cs (LocalVariableReference.DoResolve): Always set
8023         LocalInfo.Used here.
8024
8025 2003-12-13  Martin Baulig  <martin@ximian.com>
8026
8027         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8028         any value here; we're now using flow analysis to figure out
8029         whether a statement/block returns a value.
8030
8031 2003-12-13  Martin Baulig  <martin@ximian.com>
8032
8033         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8034         working again.
8035         (FlowBranching.MergeFinally): Don't call
8036         `branching.CheckOutParameters()' here, this is called in
8037         MergeTopBlock().
8038         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8039         when adding the `finally' vector.       
8040
8041 2003-12-13  Martin Baulig  <martin@ximian.com>
8042
8043         * flowanalysis.cs
8044         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8045         actually work and also fix #48962.
8046
8047 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8048
8049         * decl.cs: Do not check System.Object for nested types,
8050         since we know it does not have any. Big bang for buck:
8051
8052         BEFORE:
8053            Run 1:   8.35 seconds
8054            Run 2:   8.32 seconds
8055            corlib:  17.99 seconds
8056         AFTER:
8057            Run 1:   8.17 seconds
8058            Run 2:   8.17 seconds
8059            corlib:  17.39 seconds
8060
8061 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8062
8063         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8064         time we are returning 0 members, so we save alot here.
8065
8066 2003-12-11  Martin Baulig  <martin@ximian.com>
8067
8068         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8069         `MergeChild()', also just take the `FlowBranching' as argument;
8070         call Merge() on it and return the result.
8071         (FlowBranching.Merge): We don't need to do anything if we just
8072         have one sibling.
8073
8074 2003-12-11  Martin Baulig  <martin@ximian.com>
8075
8076         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8077         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8078         Maurer for this idea.
8079
8080 2003-12-11  Martin Baulig  <martin@ximian.com>
8081
8082         * flowanalysis.cs (MergeResult): This class is now gone; we now
8083         use the `UsageVector' for this.  The reason for this is that if a
8084         branching just has one sibling, we don't need to "merge" them at
8085         all - that's the next step to do.
8086         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8087         `MergeResult'.
8088
8089 2003-12-11  Martin Baulig  <martin@ximian.com>
8090
8091         Reworked flow analyis and made it more precise and bug-free.  The
8092         most important change is that we're now using a special `Reachability'
8093         class instead of having "magic" meanings of `FlowReturns'.  I'll
8094         do some more cleanups and optimizations and also add some more
8095         documentation this week.
8096
8097         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8098         largely reworked this class.
8099         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8100         the new `Reachability' class instead of having "magic" values here.
8101         (FlowBranching): We're now using an instance of `Reachability'
8102         instead of having separate `Returns', `Breaks' etc. fields.
8103
8104         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8105         based on flow analysis; ignore the return value of block.Emit ().
8106
8107 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8108
8109         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8110         if they are private.
8111
8112 2003-12-09  Martin Baulig  <martin@ximian.com>
8113
8114         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8115         call them directly on the UsageVector.
8116
8117 2003-12-09  Martin Baulig  <martin@ximian.com>
8118
8119         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8120         Changed return type from `FlowReturns' to `Reachability'.
8121
8122 2003-12-09  Martin Baulig  <martin@ximian.com>
8123
8124         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8125         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8126         `Reachable' fields with a single `Reachability' one.
8127
8128 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8129
8130         * class.cs (FindMembers): Remove foreach's.
8131
8132         Bootstrap times:
8133
8134         BEFORE
8135                 Run 1:   8.74 seconds
8136                 Run 2:   8.71 seconds
8137
8138         AFTER
8139                 Run 1:   8.64 seconds
8140                 Run 2:   8.58 seconds
8141
8142
8143 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8144
8145         * cs-parser.jay:
8146         * gen-treedump.cs:
8147         * statement.cs:
8148         This patch does a few things:
8149                 1. EmptyStatement is now a singleton, so it is never reallocated.
8150                 2. All blah is EmptyStatement constructs have been changed to
8151                    blah == EmptyStatement.Value, which is much faster and valid
8152                    now that EmptyStatement is a singleton.
8153                 3. When resolving a block, rather than allocating a new array for
8154                    the non-empty statements, empty statements are replaced with
8155                    EmptyStatement.Value
8156                 4. Some recursive functions have been made non-recursive.
8157         Mainly the performance impact is from (3), however (1) and (2) are needed for
8158         this to work. (4) does not make a big difference in normal situations, however
8159         it makes the profile look saner.
8160
8161         Bootstrap times:
8162
8163         BEFORE
8164         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8165         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8166         Total memory allocated: 56397 KB
8167
8168         AFTER
8169         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8170         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8171         Total memory allocated: 55666 KB
8172
8173 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8174
8175         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8176         than the hashtable in a hashtable version
8177
8178         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8179         we always end up concating a string. This results in a huge perf
8180         loss, because many strings have to be tracked by the GC. In this
8181         patch, we first use a hashtable that works with two keys, so that
8182         the strings do not need to be concat'ed.
8183
8184         Bootstrap times:
8185         BEFORE
8186                 Run 1:   8.74 seconds
8187                 Run 2:   8.71 seconds
8188
8189         AFTER
8190                 Run 1:   8.65 seconds
8191                 Run 2:   8.56 seconds
8192
8193 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8194
8195         * Makefile: Add a new target `do-time' that does a quick and simple
8196         profile, leaving easy to parse output.
8197
8198 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8199
8200         * codegen.cs (Init): Create the dynamic assembly with 
8201         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8202
8203 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8204
8205         * support.cs: Make the PtrHashtable use only one
8206         instance of its comparer.
8207
8208 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8209
8210         * typemanager.cs: Fix lookup of GetNamespaces.
8211
8212 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8213
8214         * expression.cs: Removed redundant line.
8215
8216         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8217         ArrayLists, use for loops with bounds.  
8218
8219         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8220         arraylist.
8221
8222         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8223         arraylists, use for loop with bounds.
8224
8225         The above three changes give us a 0.071 second performance
8226         improvement out of 3.294 seconds down to 3.223.  On my machine
8227         the above changes reduced the memory usage by 1,387 KB during
8228         compiler bootstrap.
8229
8230         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8231         QualifiedIdentifiers.  Before we created a new string through
8232         concatenation, and mostly later on, the result would be
8233         manipulated by DecomposeQI through string manipulation.
8234
8235         This reduced the compiler memory usage for bootstrapping from
8236         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8237         compile times in 0.05 seconds.
8238
8239 2003-11-28  Dick Porter  <dick@ximian.com>
8240
8241         * support.cs: Do string compares with the Invariant culture.
8242
8243         * rootcontext.cs: 
8244         * gen-treedump.cs: 
8245         * expression.cs: 
8246         * driver.cs: 
8247         * decl.cs: 
8248         * codegen.cs: 
8249         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8250         the comparison is done with the Invariant culture.
8251
8252 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8253
8254         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8255         GetEnumerator method.
8256
8257         (ProbeCollectionType): Iterate starting at the most specific type
8258         upwards looking for a GetEnumerator
8259
8260         * expression.cs: Shift count can be up to 31 for int/uint and 63
8261         for long/ulong.
8262
8263 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8264
8265         * statement.cs (Block.LookupLabel): Also look for the label on the
8266         children blocks.  Use a hash table to keep track of visited
8267         nodes. 
8268
8269         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8270         we actually did transform the other operand, otherwise fall back
8271         to the common codepath that casts to long.
8272
8273         * cs-tokenizer.cs: Use the same code pattern as the int case.
8274         Maybe I should do the parsing myself, and avoid depending on the
8275         Parse routines to get this done.
8276
8277 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8278
8279         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8280         which fixes bug 51347.  This time test it.
8281
8282         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8283         attributes for example can not tell the difference between these.
8284         The difference was only a syntax feature of the language. 
8285
8286         * attribute.cs: Apply attributes to delegates.
8287
8288         * delegate.cs: Call the apply attributes method.
8289
8290 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8291
8292         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8293         comparing 0 vs Byte.MinValue, not the value
8294
8295         (ImplicitConversionRequired): When reporting a conversion error,
8296         use error 31 to print out the constant error instead of the
8297         simpler 29.
8298
8299         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8300         which fixes bug 51347.
8301
8302 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8303
8304         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8305         which fixes the -warnaserror command line option.
8306
8307 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8308
8309         * cfold.cs (DoNumericPromotions): During constant folding of
8310         additions on UIntConstant, special case intconstants with
8311         IntConstants like we do on the expression binary operator. 
8312
8313 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8314
8315         * convert.cs (ImplicitReferenceConversion): We were missing a case
8316         (System.Enum are not value types or class types, so we need to
8317         classify them separatedly).
8318
8319         * driver.cs: We do not support error 2007.
8320
8321 2003-11-12 Jackson Harper <jackson@ximian.com>
8322
8323         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8324         system directory. Also use the full file name so users can
8325         libraries names mscorlib-o-tron.dll in a non system dir.
8326
8327 2003-11-10  Martin Baulig  <martin@ximian.com>
8328
8329         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8330         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8331         calling `ResolveType()' on them, directly assign their `Type'.
8332
8333 2003-11-08  Martin Baulig  <martin@ximian.com>
8334
8335         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8336         return value and the `out parent' parameter.
8337         (TypeContainer.DefineType): Moved the CS0644 check into
8338         GetClassBases().  Don't pass the interface types to the
8339         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8340         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8341
8342         * ecore.cs (TypeExpr.IsAttribute): New property.
8343         (TypeExpr.GetInterfaces): New method.
8344
8345         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8346         TypeExpr instead of a Type.
8347         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8348         (Interface.DefineType): Don't pass the interface types to the
8349         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8350         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8351
8352         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8353         instead of a `Type[]'.
8354         (TypeManager.RegisterBuilder): Likewise.
8355         (TypeManager.AddUserInterface): Likewise.
8356         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8357         `Type[]' and also return a `TypeExpr[]'.
8358         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8359
8360 2003-11-08  Martin Baulig  <martin@ximian.com>
8361
8362         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8363         Expression.     
8364
8365 2003-11-08  Martin Baulig  <martin@ximian.com>
8366
8367         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8368         TypeManager.ResolveExpressionTypes().
8369
8370         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8371         instead of an Expression.
8372         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8373         (TypeExpression): New public class; formerly known as `TypeExpr'.
8374
8375         * expression.cs (ComposedCast): Derive from TypeExpr.
8376
8377         * typemanager.cs (TypeManager.system_*_expr): These are now
8378         TypExpr's instead of Expression's.
8379         (TypeManager.ResolveExpressionTypes): New public static function;
8380         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8381         of them.        
8382
8383 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8384
8385         * expression.cs (New.DoResolve): Do not dereference value that
8386         might be a null return.
8387
8388         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8389         sure that the constant value has the right type.  Fixes an
8390         unreported bug, similar to 50425.
8391
8392         * const.cs (Const.LookupConstantValue): Call
8393         ImplicitStandardConversionExists before doing a conversion to
8394         avoid havng the TypeManager.ChangeType do conversions.
8395
8396         Reduced the number of casts used
8397
8398         (Const.ChangeType): New routine to enable reuse of the constant
8399         type changing code from statement.
8400
8401         * typemanager.cs (ChangeType): Move common initialization to
8402         static global variables.
8403
8404         Fixes #50425.
8405
8406         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8407         every value type to go through, even if it was void.  Fix that. 
8408
8409         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8410         character of the define, and the is_identifier_part_character for
8411         the rest of the string.
8412
8413 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8414
8415         * expression.cs (UnaryMutator.EmitCode): When I updated
8416         LocalVariableReference.DoResolve, I overdid it, and dropped an
8417         optimization done on local variable references.
8418
8419 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8420
8421         * ecore.cs: Convert the return from Ldlen into an int.
8422
8423 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8424
8425         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8426         the accessibility, this is a special case for toplevel non-public
8427         classes (internal for instance).
8428
8429 2003-10-20  Nick Drochak <ndrochak@gol.com>
8430
8431         * ecore.cs: Fix typo and build.  Needed another right paren.
8432
8433 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8434
8435         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8436         `internal' case regular and protected, but not allowing protected
8437         to be evaluated later.  Bug 49840
8438
8439 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8440
8441         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8442         to kb.Nlast, and not the kb.nFirst to isolate the switch
8443         statement.
8444
8445         Extract the underlying type, so enumerations of long/ulong are
8446         treated like long/ulong.
8447
8448 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8449
8450         * expression.cs (New): Overload the meaning of RequestedType to
8451         track the possible creation of the NewDelegate type, since
8452         DoResolve is invoked more than once for new constructors on field
8453         initialization.
8454
8455         See bugs: #48800 and #37014
8456
8457         * cs-parser.jay (declare_local_constants): Take an arraylist
8458         instead of a single constant.
8459
8460         (local_constant_declaration): It should take a
8461         constant_declarators, not a constant_declarator.  Fixes 49487
8462
8463         * convert.cs: Fix error report.
8464
8465 2003-10-13 Jackson Harper <jackson@ximian.com>
8466
8467         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8468         bug #49611
8469
8470 2003-10-09  Martin Baulig  <martin@ximian.com>
8471
8472         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8473         to the .ctor.
8474         (MethodCore.DoDefineParameters): Removed the TypeContainer
8475         argument; use the DeclSpace which was passed to the .ctor instead.
8476         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8477         TypeContainer; we only need a DeclSpace here.
8478
8479 2003-10-09  Martin Baulig  <martin@ximian.com>
8480
8481         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8482         to the .ctor.
8483         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8484         EmitContext's .ctor.    
8485
8486 2003-10-09  Martin Baulig  <martin@ximian.com>
8487
8488         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8489         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8490         AsAccessible(), moved them as well.
8491
8492         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8493
8494 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8495
8496         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8497
8498 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8499
8500         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8501         generation for >=, as spotted by Paolo, bug 48679.  
8502         Patch from David Waite.
8503
8504         * cs-tokenizer.cs: Add handling for #pragma.
8505
8506         * cs-parser.jay: Allow for both yield and yield return in the
8507         syntax.  The anti-cobolization of C# fight will go on!
8508
8509         * class.cs (TypeBuilder.DefineType): Catch error condition here
8510         (Parent.DefineType erroring out and returning null).
8511
8512         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8513         coping with enumerations variables, we were mistakenly processing
8514         them as a regular value type instead of built-in types.  Fixes the
8515         bug #48063
8516
8517         * typemanager.cs (IsBuiltinOrEnum): New method.
8518
8519 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8520
8521         * cs-parser.jay: Upgrade: yield now needs the return clause.
8522
8523 2003-09-19  Martin Baulig  <martin@ximian.com>
8524
8525         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8526         `MemberCache parent' argument.  Normally, an interface doesn't
8527         have a parent type except System.Object, but we use this in gmcs
8528         for generic type parameters.
8529
8530 2003-09-18  Martin Baulig  <martin@ximian.com>
8531
8532         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8533         on `type.IsInterface'; don't check whether the type has a parent
8534         to determine whether it's an interface.
8535
8536 2003-09-15  Martin Baulig  <martin@ximian.com>
8537
8538         * class.cs (TypeContainer.DefineType): Added an error flag to
8539         avoid reporting duplicate CS0146's ("class definition is
8540         circular.").
8541
8542         * driver.cs (Driver.MainDriver): Abort if
8543         RootContext.ResolveTree() reported any errors.
8544
8545 2003-09-07  Martin Baulig  <martin@ximian.com>
8546
8547         * report.cs (Error, Warning): Added overloaded versions which take
8548         a `params object[] args' and call String.Format().
8549
8550 2003-09-07  Martin Baulig  <martin@ximian.com>
8551
8552         * decl.cs (DeclSpace..ctor): Don't call
8553         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8554         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8555         (DeclSpace.RecordDecl): New method.
8556
8557         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8558
8559 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8560
8561         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8562         value attributes to be applied to ParameterBuilders.
8563
8564         * class.cs (MethodCore.LabelParameters): Make static and more
8565         generic so that it can be used from other places - like interface
8566         methods, for instance.
8567
8568         * interface.cs (Interface.Emit): Call LabelParameters before
8569         emitting attributes on the InterfaceMethod.
8570
8571 2003-08-26  Martin Baulig  <martin@ximian.com>
8572
8573         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8574         resolving aliases; fixes #47927.
8575
8576 2003-08-26  Martin Baulig  <martin@ximian.com>
8577
8578         * statement.cs (Using.DoResolve): This is internally emitting a
8579         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8580         do not always return.  Fixes #47681.
8581
8582 2003-08-26  Martin Baulig  <martin@ximian.com>
8583
8584         * decl.cs (MemberCore): Moved WarningNotHiding(),
8585         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8586         into MemberBase.
8587         (AdditionResult): Make this nested in DeclSpace.
8588         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8589         argument; call NamespaceEntry.Define() unless we're nested in a
8590         class or struct.
8591
8592         * namespace.cs (Namespace.DefineName): New public function.  This
8593         is called from DeclSpace's .ctor to add 
8594         (Namespace.Lookup): Include DeclSpaces in the lookup.
8595
8596         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8597
8598         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8599
8600 2003-08-25  Martin Baulig  <martin@ximian.com>
8601
8602         * convert.cs (Convert.ExplicitReferenceConversion): When
8603         converting from an interface type to a class, unbox if the target
8604         type is a struct type.  Fixes #47822.
8605
8606 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8607
8608         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8609         #47854.
8610
8611 2003-08-22  Martin Baulig  <martin@ximian.com>
8612
8613         * class.cs (TypeManager.DefineType): When defining a nested type,
8614         call DefineType() on our parent; fixes #47801.
8615
8616 2003-08-22  Martin Baulig  <martin@ximian.com>
8617
8618         * class.cs (MethodData.Define): While checking if a method is an
8619         interface implementation, improve the test a bit more to fix #47654.
8620
8621 2003-08-22  Martin Baulig  <martin@ximian.com>
8622
8623         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8624         correctly; fixes #47722.
8625
8626 2003-08-22  Martin Baulig  <martin@ximian.com>
8627
8628         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8629         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8630
8631         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8632
8633 2003-08-22  Martin Baulig  <martin@ximian.com>
8634
8635         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8636         can only be assigned in static constructors.  Fixes #47161.
8637
8638 2003-08-22  Martin Baulig  <martin@ximian.com>
8639
8640         Rewrote and improved the flow analysis code.
8641
8642         * flowbranching.cs (FlowBranching): Make this class abstract.
8643         (FlowBranching.CreateBranching): New static function to create a
8644         new flow branching.
8645         (FlowBranchingBlock, FlowBranchingException): New classes.
8646         (FlowBranching.UsageVector.Type): New public readonly field.
8647         (FlowBranching.UsageVector.Breaks): Removed the setter.
8648         (FlowBranching.UsageVector.Returns): Removed the setter.
8649         (FlowBranching.UsageVector): Added Break(), Return(),
8650         NeverReachable() and Throw() methods to modify the reachability.
8651         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8652         done by FlowBranching.Merge().
8653         (FlowBranching.UsageVector.MergeChild): New method; merges the
8654         merge result into the current vector.
8655         (FlowBranching.Merge): New abstract method to merge a branching.
8656
8657 2003-08-12  Martin Baulig  <martin@ximian.com>
8658
8659         * expression.cs (Indirection.CacheTemporaries): Create the
8660         LocalTemporary with the pointer type, not its element type.
8661
8662 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8663
8664         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8665         token was a keyword or not.
8666
8667         Add `error' options where an IDENTIFIER was expected;  Provide
8668         CheckToken and CheckIdentifierToken convenience error reporting
8669         functions. 
8670
8671         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8672
8673         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8674         NameSpaceEntry NameSpaceEntry.
8675
8676         (LookupInterfaceOrClass): Avoid creating a full qualified name
8677         from namespace and name: avoid doing lookups when we know the
8678         namespace is non-existant.   Use new Tree.LookupByNamespace which
8679         looks up DeclSpaces based on their namespace, name pair.
8680
8681         * driver.cs: Provide a new `parser verbose' to display the
8682         exception thrown during parsing.  This is turned off by default
8683         now, so the output of a failure from mcs is more graceful.
8684
8685         * namespace.cs: Track all the namespaces defined in a hashtable
8686         for quick lookup.
8687
8688         (IsNamespace): New method
8689
8690 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8691
8692         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8693         we know that we need to concatenate (full typename can never be
8694         null). 
8695
8696         * class.cs: ditto.
8697
8698         * statement.cs: Use a bitfield;  Do not initialize to null things
8699         which are done by the constructor by default.
8700
8701         * cs-parser.jay: bug fix, parameter was 4, not 3.
8702
8703         * expression.cs: Just use the property;
8704
8705         * statement.cs: No need for GetVariableInfo method.
8706
8707 2003-08-08  Martin Baulig  <martin@ximian.com>
8708
8709         * flowanalysis.cs (FlowReturns): This is now nested in the
8710         `FlowBranching' class.
8711         (MyBitVector): Moved this here from statement.cs.
8712         (FlowBranching.SiblingType): New enum type.
8713         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8714
8715 2003-08-07  Martin Baulig  <martin@ximian.com>
8716
8717         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8718         `FlowBranching' class and called `BranchingType'.
8719
8720 2003-08-07  Martin Baulig  <martin@ximian.com>
8721
8722         * flowanalysis.cs: Moved all the control flow analysis code into
8723         its own file.
8724
8725 2003-08-07  Martin Baulig  <martin@ximian.com>
8726
8727         * assign.cs (Assign.DoResolve): `target' must either be an
8728         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8729         #37319.
8730
8731 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8732
8733         * expression.cs (BinaryMethod): This kind of expression is created by the
8734         Binary class if it determines that the operator has to be handled
8735         by a method.
8736
8737         (BinaryDelegate): This kind of expression is created if we are
8738         dealing with a + or - operator on delegates.
8739
8740         (Binary): remove method, argumetns, and DelegateOperator: when
8741         dealing with methods, 
8742
8743         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8744
8745         * statement.cs (Block): use bitfields for the three extra booleans
8746         we had in use.   Remove unused topblock parameter.
8747
8748         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8749
8750         * assign.cs: Drop extra unneeded tests.
8751
8752 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8753
8754         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8755
8756         * statement.cs (Foreach): Use VariableStorage instead of
8757         LocalBuilders.   
8758
8759         * codegen.cs (VariableStorage): New class used by clients that
8760         require a variable stored: locals or fields for variables that
8761         need to live across yield.
8762
8763         Maybe provide a convenience api for EmitThis+EmitLoad?
8764
8765         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8766         these bad boys.
8767
8768 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8769
8770         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8771         RemapParameterLValue): New methods that are used to turn a
8772         precomputed FieldInfo into an expression like this:
8773
8774                 instance.FieldInfo
8775
8776         The idea is to use this instead of making LocalVariableReference
8777         have more than one meaning.
8778
8779         * cs-parser.jay: Add error production to BASE.
8780
8781         * ecore.cs: Deal with TypeManager.GetField returning null, which
8782         is now a valid return value.
8783
8784         (FieldExprNoAddress): New expression for Fields whose address can
8785         not be taken.
8786
8787         * expression.cs (LocalVariableReference): During the resolve
8788         phases, create new expressions if we are in a remapping context.
8789         Remove code that dealt with remapping here.
8790
8791         (ParameterReference): same.
8792
8793         (ProxyInstance): New expression, like the `This' expression, but
8794         it is born fully resolved.  We know what we are doing, so remove
8795         the errors that are targeted to user-provided uses of `this'.
8796
8797         * statement.cs (Foreach): our variable is now stored as an
8798         Expression;  During resolution, follow the protocol, dont just
8799         assume it will return this.
8800
8801 2003-08-06  Martin Baulig  <martin@ximian.com>
8802
8803         * support.cs (SeekableStreamReader.cs): New public class.
8804
8805         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8806         SeekableStreamReader instead of the normal StreamReader.
8807
8808 2003-08-04  Martin Baulig  <martin@ximian.com>
8809
8810         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8811         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8812         deambiguate casts and delegate invocations.
8813         (parenthesized_expression): Use the new tokens to ensure this is
8814         not a cast of method invocation.
8815
8816         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8817         when reading a `)' and Deambiguate_CloseParens () was previously
8818         called.
8819
8820         * expression.cs (ParenthesizedExpression): New class.  This is
8821         just used for the CS0075 test.
8822         (Binary.DoResolve): Check for CS0075.   
8823
8824 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8825
8826         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8827         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8828         reference comparison.
8829
8830         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8831         examine the ReturnType for equality - this is necessary in the
8832         cases of implicit and explicit operators whose signature also
8833         includes the return type.
8834
8835 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8836
8837         * namespace.cs: Cache the result of the namespace computation,
8838         instead of computing it every time.
8839
8840 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8841
8842         * decl.cs: Use a global arraylist that we reuse over invocations
8843         to avoid excesive memory consumption.  Reduces memory usage on an
8844         mcs compile by one meg (45 average).
8845
8846         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8847         private, work around that.
8848
8849 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8850
8851         * literal.cs (IntLiteral): Define Zero and One static literals. 
8852
8853         * cs-parser.jay (integer_literal): use static literals to reduce
8854         memory usage for the most used literals (0, 1 and -1).  211kb
8855         reduced in memory usage.
8856
8857         Replace all calls to `new ArrayList' with `new
8858         ArrayList(4)' which is a good average number for most allocations,
8859         and also requires only 16 bytes of memory for its buffer by
8860         default. 
8861
8862         This reduced MCS memory usage in seven megabytes for the RSS after
8863         bootstrapping.
8864
8865 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8866
8867         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8868         handle params methods the correct way by forming only one
8869         applicable set with params and normal methods in them. Earlier we
8870         were looking at params methods only if we found no normal methods
8871         which was not the correct thing to do.
8872
8873         (Invocation.BetterFunction): Take separate arguments indicating
8874         when candidate and the best method are params methods in their
8875         expanded form.
8876
8877         This fixes bugs #43367 and #46199.
8878
8879         * attribute.cs: Documentation updates.
8880
8881         (CheckAttribute): Rename to CheckAttributeTarget.
8882         (GetValidPlaces): Rename to GetValidTargets.
8883
8884         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8885         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8886
8887         Fixes bug #44468.
8888
8889 2003-07-28  Martin Baulig  <martin@ximian.com>
8890
8891         * class.cs (TypeContainer.DefineMembers): Use the base type's full
8892         name when looking up the base class of a nested class.  Fixes #46977.
8893
8894 2003-07-26  Martin Baulig  <martin@ximian.com>
8895
8896         * expression.cs (Indexers.Indexer): New nested struct; contains
8897         getter, setter and the indexer's type.
8898         (Indexers.Properties): This is now an ArrayList of
8899         Indexers.Indexer's.
8900         (IndexerAccess.DoResolveLValue): Correctly set the type if the
8901         indexer doesn't have any getters.
8902
8903         * assign.cs (Assign.DoResolve): Also do the implicit conversions
8904         for embedded property and indexer assignments.
8905
8906 2003-07-26  Martin Baulig  <martin@ximian.com>
8907
8908         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
8909         preprocessor directive is not the first non-whitespace character
8910         on a line.
8911
8912 2003-07-26  Martin Baulig  <martin@ximian.com>
8913
8914         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
8915         namespace parsing, follow the spec more closely.
8916
8917         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
8918         NamespaceEntry.Lookup().
8919
8920 2003-07-25  Martin Baulig  <martin@ximian.com>
8921
8922         * MethodCore.cs (OverridesSomething): New public field; it's set
8923         from TypeContainer.DefineMembers if this method overrides
8924         something (which doesn't need to be a method).  Fix #39462.
8925
8926 2003-07-25  Ravi Pratap  <ravi@ximian.com>
8927
8928         * typemanager.cs (GetMembers): Ensure that the list of members is
8929         reversed. This keeps things in sync.
8930
8931         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
8932         find an AttributeUsage attribute.
8933
8934         * expression.cs (Invocation.OverloadResolve): Perform the check
8935         which disallows Invoke to be directly called on a Delegate.
8936
8937         (Error_InvokeOnDelegate): Report error cs1533.
8938
8939 2003-07-25  Martin Baulig  <martin@ximian.com>
8940
8941         * expression.cs (Indexers.GetIndexersForType): Only look in the
8942         interface hierarchy if the requested type is already an
8943         interface.  Fixes #46788 while keeping #46502 fixed.
8944
8945 2003-07-25  Martin Baulig  <martin@ximian.com>
8946
8947         * class.cs (TypeContainer.DefineMembers): Check whether all
8948         readonly fields have been assigned and report warning CS0649 if
8949         not.
8950
8951         * statement.cs (LocalInfo.IsFixed): Always return true if this is
8952         a valuetype.
8953
8954 2003-07-24  Ravi Pratap  <ravi@ximian.com>
8955
8956         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
8957         returned from GetMethods to make things consistent with the
8958         assumptions MCS makes about ordering of methods.
8959
8960         This should comprehensively fix bug #45127 and it does :-)
8961
8962         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
8963         ordering is actually reverse.
8964
8965         * Clean up some debug messages I left lying around.
8966
8967         * interface.cs (Populate*): Get rid of code which emits attributes
8968         since the stage in which we emit attributes is the 'Emit' stage,
8969         not the define stage.
8970
8971         (Emit): Move attribute emission for interface members here.
8972
8973 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8974
8975         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8976         closely: we eliminate methods in base types when we have an
8977         applicable method in a top-level type.
8978
8979         Please see section 14.5.5.1 for an exact description of what goes
8980         on. 
8981
8982         This fixes bug #45127 and a host of other related to corlib compilation.
8983
8984         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8985         array is the method corresponding to the top-level type (this is
8986         because of the changes made to icall.c) so we change this
8987         accordingly.
8988
8989         (MethodGroupExpr.Name): This too.
8990
8991         * typemanager.cs (GetElementType): New method which does the right
8992         thing when compiling corlib. 
8993
8994         * everywhere: Make use of the above in the relevant places.
8995
8996 2003-07-22  Martin Baulig  <martin@ximian.com>
8997
8998         * cs-parser.jay (invocation_expression): Moved
8999         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9000         `cast_expression', but create a InvocationOrCast which later
9001         resolves to either an Invocation or a Cast.
9002
9003         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9004         method; call this before EmitStatement() to make sure that this
9005         expression can be used as a statement.
9006
9007         * expression.cs (InvocationOrCast): New class; resolves to either
9008         an Invocation or a Cast.
9009
9010         * statement.cs (StatementExpression): Call ResolveStatement() on
9011         the ExpressionStatement before emitting it.
9012
9013 2003-07-21  Martin Baulig  <martin@ximian.com>
9014
9015         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9016         `ref' and `out' attributes match; fixes #46220.
9017         (MemberAccess.ResolveMemberAccess): You can't reference a type
9018         through an expression; fixes #33180.
9019         (Indexers.GetIndexersForType): Don't return the indexers from
9020         interfaces the class implements; fixes #46502.
9021
9022 2003-07-21  Martin Baulig  <martin@ximian.com>
9023
9024         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9025         CS0661 checks; fixes bug #30442.
9026
9027 2003-07-21  Martin Baulig  <martin@ximian.com>
9028
9029         * decl.cs (AdditionResult): Added `Error'.
9030
9031         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9032
9033         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9034         makes cs0031.cs actually work.
9035
9036 2003-07-20  Martin Baulig  <martin@ximian.com>
9037
9038         * namespace.cs: Fixed that bug which caused a crash when compiling
9039         the debugger's GUI.
9040
9041 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9042
9043         * typemanager.cs (LookupTypeReflection): Never expose types which
9044         are NotPublic, NestedPrivate, NestedAssembly, or
9045         NestedFamANDAssem.  We used to return these, and later do a check
9046         that would report a meaningful error, but the problem is that we
9047         would not get the real match, if there was a name override.
9048
9049 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9050
9051         * namespace.cs (Namespace, Name): Do not compute the namespace
9052         name dynamically, compute it in the constructor.  This reduced
9053         memory usage by 1697 KB.
9054
9055         * driver.cs: Use --pause to pause at the end.
9056
9057 2003-07-17  Peter Williams  <peter@newton.cx>
9058
9059         * Makefile: Change the name of the test target so that it doesn't
9060         conflict with the recursive test target.
9061
9062 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9063
9064         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9065         AddressOf): Do not use EmitThis, that was wrong, use the actual
9066         this pointer.
9067
9068 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9069
9070         * class.cs (MethodData.Define): While checking if a method is an
9071         interface implementation, improve the test: If we are not public
9072         (use new test here: use the computed MethodAttributes directly,
9073         instead of the parsed modifier flags) check if the `implementing'
9074         method comes from an interface or not.
9075
9076         * pending.cs (VerifyPendingMethods): Slightly better error
9077         message.
9078
9079         * makefile: add test target that does the mcs bootstrap.
9080
9081 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9082
9083         * interface.cs (Define): Do nothing here since there are no
9084         members to populate etc. Move the attribute emission out of here
9085         since this was just totally the wrong place to put it. Attribute
9086         application happens during the 'Emit' phase, not in the 'Define'
9087         phase.
9088
9089         (Emit): Add this method and move the attribute emission here
9090
9091         * rootcontext.cs (EmitCode): Call the Emit method on interface
9092         types too.
9093
9094 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9095
9096         * expression.cs (OverloadResolve): Report error only if Location
9097         is not 'Null' which means that there was a probe going on.
9098
9099 2003-07-14  Martin Baulig  <martin@ximian.com>
9100
9101         * expression.cs (ConditionalLogicalOperator): New public class to
9102         implement user defined conditional logical operators.
9103         This is section 14.11.2 in the spec and bug #40505.
9104
9105 2003-07-14  Martin Baulig  <martin@ximian.com>
9106
9107         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9108
9109 2003-07-14  Martin Baulig  <martin@ximian.com>
9110
9111         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9112
9113         * ecore.cs (IVariable.VerifyFixed): New interface method.
9114
9115         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9116         operator, check whether the variable is actually fixed.  Fixes bug
9117         #36055.  Set a variable definitely assigned when taking its
9118         address as required by the spec.
9119
9120         * statement.cs (LocalInfo.IsFixed): New field.
9121         (LocalInfo.MakePinned): Set `IsFixed' to true.
9122
9123 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9124
9125         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9126         for .ctors, ensure that we only ask for members declared in the
9127         attribute type (BindingFlags.DeclaredOnly).
9128
9129         Fixes bug #43632.
9130
9131         * expression.cs (Error_WrongNumArguments): Report error 1501
9132         correctly the way CSC does.
9133
9134 2003-07-13  Martin Baulig  <martin@ximian.com>
9135
9136         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9137         lookup on the fully qualified name, to make things like "X.X" work
9138         where "X.X" is a fully qualified type name, but we also have a
9139         namespace "X" in the using list.  Fixes #41975.
9140
9141 2003-07-13  Martin Baulig  <martin@ximian.com>
9142
9143         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9144         function. If we're a CompoundAssign, we need to create an embedded
9145         CompoundAssign, not an embedded Assign.
9146         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9147         Fixes #45854.
9148
9149 2003-07-13  Martin Baulig  <martin@ximian.com>
9150
9151         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9152         work to fix bug #46088.
9153
9154 2003-07-13  Ravi Pratap <ravi@ximian.com>
9155
9156         * class.cs (Operator.Emit): Do not emit attributes here - it is
9157         taken care of by the Method class that we delegate too. This takes
9158         care of bug #45876.
9159
9160 2003-07-10  Martin Baulig  <martin@ximian.com>
9161
9162         * expression.cs (TypeOfVoid): New class.
9163         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9164
9165 2003-07-10  Martin Baulig  <martin@ximian.com>
9166
9167         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9168         bug #35957.
9169
9170 2003-07-10  Martin Baulig  <martin@ximian.com>
9171
9172         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9173         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9174
9175         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9176
9177         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9178
9179 2003-07-10  Martin Baulig  <martin@ximian.com>
9180
9181         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9182         of decimal.  Fixes #42850.
9183
9184         NOTE: I also fixed the created byte blob, but this doesn't work on
9185         the MS runtime and csc never produces any byte blobs for decimal
9186         arrays.
9187
9188 2003-07-10  Martin Baulig  <martin@ximian.com>
9189
9190         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9191         structs; fixes #32068.
9192         (Block.AddChildVariableNames): Fixed #44302.
9193
9194 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9195
9196         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9197
9198 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9199
9200         * attribute.cs: And this test is onger needed.
9201
9202 2003-07-08  Martin Baulig  <martin@ximian.com>
9203
9204         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9205         inaccessible types.  Fixes #36313.
9206
9207         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9208
9209         * namespace.cs (NamespaceEntry): Create implicit entries for all
9210         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9211         implicit entries for N1.N2 and N1.
9212
9213 2003-07-08  Martin Baulig  <martin@ximian.com>
9214
9215         Rewrote the handling of namespaces to fix a lot of the issues
9216         wrt. `using' aliases etc.
9217
9218         * namespace.cs (Namespace): Splitted this class into a
9219         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9220
9221         * typemanager.cs (TypeManager.IsNamespace): Removed.
9222         (TypeManager.ComputeNamespaces): Only compute namespaces from
9223         loaded assemblies here, not the namespaces from the assembly we're
9224         currently compiling.
9225
9226 2003-07-08  Martin Baulig  <martin@ximian.com>
9227
9228         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9229
9230 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9231
9232         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9233         already fixed it.  
9234
9235         I thought about the memory savings here, but LookupTypeReflection
9236         is used under already very constrained scenarios.  Compiling
9237         corlib or mcs only exposes one hit, so it would not really reduce
9238         any memory consumption.
9239
9240 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9241
9242         * typemanager.cs: fixes bug #45889 by only adding public types from
9243         other assemblies to the list of known types.
9244
9245 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9246
9247         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9248         on the type we resolved.
9249
9250 2003-07-05  Martin Baulig  <martin@ximian.com>
9251
9252         * pending.cs (PendingImplementation.ParentImplements): Don't
9253         create the proxy if the parent is abstract.
9254
9255         * class.cs (TypeContainer.DefineIndexers): Process explicit
9256         interface implementations first.  Fixes #37714.
9257
9258 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9259
9260         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9261         defined recursively;  but since we modify the input parameters
9262         (left is set to `this' temporarily), we reset this value if the
9263         left_is_explicit is false, which gives the original semantics to
9264         the code.  
9265
9266         * literal.cs (NullPointer): new class used to represent a null
9267         literal in a pointer context.
9268
9269         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9270         type is a pointer, use a NullPointer object instead of a
9271         NullLiteral.   Closes 43687
9272
9273         (ExplicitConversion): Convert pointer values using
9274         the conv opcode to the proper type.
9275
9276         * ecore.cs (New): change ValueTypeVariable property into a method,
9277         that returns whether the valuetype is suitable for being used.
9278
9279         * expression.cs (Binary.DoNumericPromotions): Only return if we
9280         the int constant was a valid uint, and we can return both left and
9281         right as uints.  If not, we continue processing, to trigger the
9282         type conversion.  This fixes 39018.
9283
9284         * statement.cs (Block.EmitMeta): During constant resolution, set
9285         the CurrentBlock property on the emitcontext, so that we resolve
9286         constants propertly.
9287
9288 2003-07-02  Martin Baulig  <martin@ximian.com>
9289
9290         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9291         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9292
9293         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9294         than emitting it here.
9295
9296         * statement.cs: Fixed some more flow analysis bugs.
9297
9298 2003-07-02  Martin Baulig  <martin@ximian.com>
9299
9300         * class.cs (MethodData.Define): When implementing interface
9301         methods, set Final unless we're Virtual.
9302
9303         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9304         check work for interface methods.
9305
9306 2003-07-01  Martin Baulig  <martin@ximian.com>
9307
9308         * ecore.cs (EmitContext.This): Replaced this property with a
9309         GetThis() method which takes a Location argument.  This ensures
9310         that we get the correct error location for a CS0188.
9311
9312 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9313
9314         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9315         ImplicitStandardConversion.
9316
9317         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9318
9319 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9320
9321         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9322         optimization.
9323
9324 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9325
9326         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9327         constructors.
9328
9329         (MethodData.Define): Turn off initlocals for unsafe methods.
9330
9331 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9332
9333         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9334         complete;  Fixes #37521.
9335
9336         * delegate.cs: Use Modifiers.TypeAttr to compute the
9337         TypeAttributes, instead of rolling our own.  This makes the flags
9338         correct for the delegates.
9339
9340 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9341
9342         * class.cs (Constructor.Define): Set the private flag for static
9343         constructors as well.
9344
9345         * cs-parser.jay (statement_expression): Set the return value to
9346         null, to avoid a crash when we catch an error.
9347
9348 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9349
9350         * cs-parser.jay: Applied patch from Jackson that adds support for
9351         extern and unsafe modifiers to destructor declarations.
9352
9353         * expression.cs: Report error 21 if the user is trying to index a
9354         System.Array.
9355
9356         * driver.cs: Add an error message, suggested by the bug report.
9357
9358         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9359         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9360
9361 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9362
9363         * namespace.cs: Add some information to reduce FAQs.
9364
9365 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9366
9367         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9368         underlying enumeration types.  Fixes #43915.
9369
9370         * expression.cs: Treat ushort/short as legal values to be used in
9371         bitwise operations.
9372
9373 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9374
9375         * delegate.cs: transfer custom attributes for paramenters from
9376         the delegate declaration to Invoke and BeginInvoke.
9377
9378 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9379
9380         * attribute.cs: handle custom marshalers and emit marshal info
9381         for fields, too.
9382
9383 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9384
9385         * makefile.gnu: Added anonymous.cs to the compiler sources.
9386
9387 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9388
9389         * iterators.cs: Change the name of the proxy class to include two
9390         underscores.
9391
9392         * cs-parser.jay: Update grammar to include anonymous methods.
9393
9394         * anonymous.cs: new file.
9395
9396 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9397
9398         * class.cs (Field.Define): Add missing test for pointers and
9399         safety. 
9400
9401 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9402
9403         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9404         we use the stobj opcode.
9405
9406         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9407         since it wasn't the correct fix. 
9408
9409         It still is puzzling that we are required to use stobj for IntPtr
9410         which seems to be a ValueType.
9411
9412 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9413
9414         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9415         during regular simple name resolution.   Now, the trick is that
9416         instead of returning for processing the simplename, we do a
9417         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9418         contextual lookup type).   If a match is found, return that, if
9419         not, return for further composition.
9420
9421         This fixes long-standing 30485.
9422
9423         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9424         using the address to initialize an object, do an Stobj instead of
9425         using the regular Stelem.
9426
9427         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9428         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9429         Because if we are a BaseIndexerAccess that value will be true.
9430         Fixes 43643.
9431
9432         * statement.cs (GotoCase.Resolve): Return after reporting an
9433         error, do not attempt to continue. 
9434
9435         * expression.cs (PointerArithmetic.Emit): If our operand is a
9436         long, convert our constants to match the operand before
9437         multiplying.  Convert to I type before adding.   Fixes 43670.
9438
9439 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9440
9441         * enum.cs (ImplicitConversionExists) : Rename to
9442         ImplicitEnumConversionExists to remove ambiguity. 
9443
9444         * ecore.cs (NullCast): New type of cast expression class which
9445         basically is very similar to EmptyCast with the difference being
9446         it still is a constant since it is used only to cast a null to
9447         something else
9448         (eg. (string) null)
9449
9450         * convert.cs (ImplicitReferenceConversion): When casting a null
9451         literal, we return a NullCast.
9452
9453         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9454         should be around anymore.
9455
9456         The renaming (reported was slightly wrong). Corrections:
9457
9458         ConvertImplicitStandard -> ImplicitConversionStandard
9459         ConvertExplicitStandard -> ExplicitConversionStandard
9460
9461         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9462         before passing them in !
9463
9464         * convert.cs (ImplicitConversionStandard): When comparing for
9465         equal expr and target types, ensure that expr is not a
9466         NullLiteral.
9467
9468         In general, we must not be checking (expr_type ==
9469         target_type) in the top level conversion methods
9470         (ImplicitConversion, ExplicitConversion etc). This checking is
9471         done in the methods that they delegate to.
9472
9473 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9474
9475         * convert.cs: Move Error_CannotConvertType,
9476         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9477         ImplicitNumericConversion, ImplicitConversionExists,
9478         ImplicitUserConversionExists, StandardConversionExists,
9479         FindMostEncompassedType, FindMostSpecificSource,
9480         FindMostSpecificTarget, ImplicitUserConversion,
9481         ExplicitUserConversion, GetConversionOperators,
9482         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9483         TryImplicitIntConversion, Error_CannotConvertImplicit,
9484         ConvertImplicitRequired, ConvertNumericExplicit,
9485         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9486         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9487         its own file.
9488
9489         Perform the following renames:
9490
9491         StandardConversionExists -> ImplicitStandardConversionExists
9492         ConvertImplicit -> ImplicitConversion
9493         ConvertImplicitStandard -> ImplicitStandardConversion
9494         TryImplicitIntConversion -> ImplicitIntConversion
9495         ConvertImplicitRequired -> ImplicitConversionRequired
9496         ConvertNumericExplicit -> ExplicitNumericConversion
9497         ConvertReferenceExplicit -> ExplicitReferenceConversion
9498         ConvertExplicit -> ExplicitConversion
9499         ConvertExplicitStandard -> ExplicitStandardConversion
9500
9501 2003-05-19  Martin Baulig  <martin@ximian.com>
9502
9503         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9504         (TypeInfo): Added support for structs having structs as fields.
9505
9506         * ecore.cs (FieldExpr): Implement IVariable.
9507         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9508         VariableInfo for the field.
9509
9510 2003-05-18  Martin Baulig  <martin@ximian.com>
9511
9512         * expression.cs (This.DoResolve): Report a CS0027 if we're
9513         emitting a field initializer.
9514
9515 2003-05-18  Martin Baulig  <martin@ximian.com>
9516
9517         * expression.cs (This.ResolveBase): New public function.
9518         (This.DoResolve): Check for CS0188.
9519
9520         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9521         This.Resolve().
9522
9523         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9524         `instance_expression' to null if we don't have any non-static
9525         methods.
9526
9527 2003-05-18  Martin Baulig  <martin@ximian.com>
9528
9529         Reworked the way how local variables and parameters are handled by
9530         the flow analysis code.
9531
9532         * statement.cs (TypeInfo, VariableMap): New public classes.
9533         (VariableInfo): New public class.  This is now responsible for
9534         checking whether a variable has been assigned.  It is used for
9535         parameters and local variables.
9536         (Block.EmitMeta): Take the InternalParameters as argument; compute
9537         the layout of the flow vectors here.
9538         (Block.LocalMap, Block.ParameterMap): New public properties.
9539         (FlowBranching): The .ctor doesn't get the InternalParameters
9540         anymore since Block.EmitMeta() now computes the layout of the flow
9541         vector.
9542         (MyStructInfo): This class is now known as `StructInfo' and nested
9543         in `TypeInfo'; we don't access this directly anymore.
9544
9545         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9546         property and removed IsAssigned(), IsFieldAssigned(),
9547         SetAssigned() and SetFieldAssigned(); we now call them on the
9548         VariableInfo so we don't need to duplicate this code everywhere.
9549
9550         * expression.cs (ParameterReference): Added `Block block' argument
9551         to the .ctor.
9552         (LocalVariableReference, ParameterReference, This): The new
9553         VariableInfo class is now responsible for all the definite
9554         assignment stuff.
9555
9556         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9557         IsParameterAssigned, SetParameterAssigned): Removed.
9558
9559 2003-05-18  Martin Baulig  <martin@ximian.com>
9560
9561         * typemanager.cs (InitCoreTypes): Try calling
9562         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9563         the 3-args-version.  Corlib now also needs our `void_type'.
9564         (GetMethod): Added overloaded version which takes an optional
9565         `bool report_errors' to allow lookups of optional methods.
9566
9567 2003-05-12  Martin Baulig  <martin@ximian.com>
9568
9569         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9570         only used for locals and not for parameters.
9571
9572 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9573
9574         * support.cs (InternalParameters.ParameterType): Return the
9575         ExternalType of the parameter.
9576
9577         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9578         they were unused.
9579
9580 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9581
9582         * class.cs (MethodData.Define): Do not set the `newslot' on
9583         interface members, if they are also flagged as "override".
9584
9585         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9586         better code for ++i and i++.  This only works for static fields
9587         and local variables.
9588
9589         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9590         want to pull the DeclSpace out of the builder_to_declspace instead
9591         of the TypeBuilder (like in TypeContainer.FindMembers).
9592
9593         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9594         instead of LookupTypeContainer.  Fixes the crash on .NET for
9595         looking up interface members.
9596
9597         * const.cs: Create our own emit context during the Definition
9598         stage, so that constants are evaluated in the proper context, when
9599         a recursive definition happens.
9600
9601 2003-05-11  Martin Baulig  <martin@ximian.com>
9602
9603         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9604         new block for a switch section.
9605         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9606         the adding/lookup in the switch block.  Fixes #39828.
9607
9608 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9609
9610         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9611         functionality: I needed to convert the data after I had performed
9612         the add/sub operation into the operands type size.
9613
9614         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9615         pass the type for the box operation, otherwise the resulting
9616         object would have been of type object.
9617
9618         (BoxedCast): Add constructor to specify the type to box as.
9619
9620 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9621
9622         * iterators.cs: I was reusing the `count' variable inadvertently,
9623         take steps to not allow this to happen.
9624
9625 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9626
9627         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9628         by creating an array at the point where the params starts and
9629         putting all those arguments there, then adjusting the size of the
9630         array.
9631
9632 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9633
9634         * expression.cs (New.AddressOf): Implement interface
9635         IMemoryLocation.  This is used when the `new' operator is used in
9636         the context of an invocation to a method on a value type.
9637
9638         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9639         example. 
9640
9641         * namespace.cs: Also check the using aliases here.
9642
9643         * driver.cs: Move the test for using validity after the types have
9644         been entered, so we do a single pass that also includes the using
9645         aliases. 
9646
9647         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9648         in the regular case.   CreateSiblingForFinally is doing extra
9649         error checking.
9650
9651         * attribute.cs (GetAttributeArgumentExpression): Store the result
9652         on an out value, and use the return value to indicate failure
9653         instead of using null (which is a valid return for Constant.GetValue).
9654
9655         * statement.cs: Perform the analysis flow for the increment
9656         portion after the statement, because this will be the real flow of
9657         execution.  Fixes #42385
9658
9659         * codegen.cs (EmitContext.EmitArgument,
9660         EmitContext.EmitStoreArgument): New helper functions when the
9661         RemapToProxy flag is set.
9662
9663         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9664         function.
9665
9666         Add support for remapping parameters. 
9667
9668         * iterators.cs: Propagate parameter values;  Store parameter
9669         values in the proxy classes.
9670
9671 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9672
9673         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9674         need a proxy reference;  I do not know what I was thinking
9675
9676         * cs-parser.jay (constructor_initializer): catch another error,
9677         and display nice message.
9678
9679         (field_declaration): catch void field declaration
9680         to flag a better error. 
9681
9682         * class.cs (MemberBase.CheckBase): Report an error instead of a
9683         warning if a new protected member is declared in a struct. 
9684         (Field.Define): catch the error of readonly/volatile.
9685
9686         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9687
9688         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9689         volatile variable is taken
9690
9691 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9692
9693         * statement.cs (Fixed.Resolve): Report an error if we are not in
9694         an unsafe context.
9695
9696 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9697
9698         * typemanager.cs: reuse the code that handles type clashes for
9699         delegates and enumerations.
9700
9701         * class.cs (Report28): Always report.
9702
9703         * expression.cs (EncodeAsAttribute): Allow nulls here.
9704
9705 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9706
9707         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9708         the functionality for testing whether an expression is valid for
9709         an attribute here.  Also handle the case of arrays of elements
9710         being stored. 
9711
9712         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9713         encoding a linear array into an array of objects that are suitable
9714         to be passed to an CustomAttributeBuilder.
9715
9716         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9717
9718         * ecore.cs: (FieldExpr): Handle field remapping here.
9719
9720         * iteratators.cs: Pass the instance variable (if the method is an
9721         instance method) to the constructors, so we can access the field
9722         variables on the class.
9723
9724         TODO: Test this with structs.  I think the THIS variable on
9725         structs might have to be a pointer, and not a refenrece
9726
9727 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9728
9729         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9730         local variables to fields in a proxy class.
9731
9732         * iterators.cs (PopulateProxy): Rename our internal fields to
9733         <XXX>.  
9734         Create a <THIS> field if we are an instance method, so we can
9735         reference our parent container variables.
9736         (MapVariable): Called back from the EmitContext code to enter a
9737         new variable to field mapping into the proxy class (we just create
9738         a FieldBuilder).
9739
9740         * expression.cs
9741         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9742         for using the remapped locals to fields.
9743
9744         I placed the code here, because that gives the same semantics to
9745         local variables, and only changes the Emit code.
9746
9747         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9748         statements inside iterators.
9749         (VariableInfo): Add a FieldBuilder for the cases when we are
9750         remapping local variables to fields in a proxy class
9751
9752         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9753         current_block != null.
9754
9755         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9756         not cope with strings, as it has been moved to the
9757         TableSwitchEmit.  Fixed bug in switch generation.
9758
9759         * expression.cs (New.DoResolve): Provide more context for the user
9760         when reporting an error.
9761
9762         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9763         pointers. 
9764
9765         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9766         check the permissions for it.  Note than in a type-resolution
9767         context the check was already present in DeclSpace.ResolveType,
9768         but was missing from the MemberAccess.
9769
9770         (ArrayCreation.CheckIndices): warn if the user has
9771         more nested levels of expressions, but there are no more
9772         dimensions specified.  Avoids crash on bug 41906.
9773
9774 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9775
9776         * statement.cs (Block): replace Implicit bool, for a generic
9777         flags.   
9778         New flag: `Unchecked'.  This is used during the EmitMeta phase
9779         (which is out-of-line with the regular Resolve/Emit process for a
9780         statement, as this is done ahead of time, but still gets a chance
9781         to call constant resolve).
9782
9783         (Block.Flags): new enum for adding a new flag.
9784
9785         (Block.EmitMeta): track the state of unchecked.
9786
9787         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9788         to enable constant resolution to work there as well.
9789
9790 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9791
9792         * typemanager.cs (ienumerable_type): Also look up
9793         System.Collections.IEnumerable. 
9794
9795 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9796
9797         TODO: Test more than one conditional per method.
9798
9799         * class.cs (Indexer.Define): Report the location where the user is
9800         referencing the unsupported feature.
9801
9802         (MethodData): Overload the use of `conditionals' to
9803         minimize the creation of needless ArrayLists.   This saves roughly
9804         212kb on my machine.
9805
9806         (Method): Implement the new IIteratorContainer interface.
9807         (Method.SetYields): Implement the method by setting the ModFlags
9808         to contain METHOD_YIELDS.
9809
9810         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9811         which just got set to null.
9812
9813         * iterators.cs: New file.
9814
9815         (Yield, YieldBreak): New statements.
9816
9817         * statement.cs (Return.Resolve): Flag an error if we are used in
9818         an iterator method.
9819
9820         * codegen.cs (InIterator): New flag set if the code is being
9821         compiled in an iterator method.
9822
9823         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9824         internal modifier, and we just use it to avoid adding extra
9825         fields, as this is seldom used.  
9826
9827         * cs-parser.jay: Add yield_statement (yield and yield break).
9828
9829         * driver.cs: New flag -v2 to turn on version 2 features. 
9830
9831         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9832         hashtable when v2 is enabled.
9833
9834 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9835
9836         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9837         there is already a namespace defined with this name.
9838
9839         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9840         people upgraded their corlibs.
9841
9842         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9843         always use fully qualified types, no need to use the compiler
9844         front end.
9845
9846         (TypeManager.IsNamespace): Use binarysearch.
9847
9848         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9849         AddDelegate): I did not quite use the new IsValid API properly: I
9850         have to pass the short-name and the fullname.  I was passing only
9851         the basename instead of the fullname sometimes. 
9852
9853         (TypeContainer.DefineType): call NamespaceClash.
9854
9855         * interface.cs (Interface.DefineType): use NamespaceClash before
9856         defining the type.
9857
9858         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9859         defining the type.
9860
9861         * enum.cs: (Enum.DefineType): use NamespaceClash before
9862         defining the type.
9863
9864         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9865         speed increase.  First, use the negative_hits cache when we get a
9866         negative.  Second, add the type with its full original name
9867         instead of the new . and + encoded name (reflection uses + to
9868         separate type from a nested type).  Use LookupTypeReflection
9869         directly which bypasses the type->name hashtable (that we already
9870         know does not contain the type.
9871
9872         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9873         location/container type. 
9874
9875         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9876
9877 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9878
9879         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9880
9881         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9882         method is being referenced in the method group from a static
9883         context, and report error 120 if so.
9884
9885         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9886         Error118. 
9887
9888         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9889         is created, we create the A namespace).
9890
9891         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9892         Fixes #41591
9893
9894 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9895
9896         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9897         invocation to ModuleBuilder.GetType with the same values will
9898         return a new type instance, so we need to cache its return
9899         values. 
9900
9901         * expression.cs (Binary.ResolveOperator): Only allow the compare
9902         operators on enums if they are of the same type.
9903
9904         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9905         types of ValueType on their own case.  Before we were giving them
9906         the same treatment as objects.
9907
9908         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9909         fullname.  Short name is used to compare against container name.
9910         Fullname is used to check against defined namespace names.
9911
9912         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9913         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9914
9915         (Method.CheckBase): Call parent.
9916         (MemberBase.CheckBase): Check for protected members on sealed
9917         classes.
9918         (PropertyBase.CheckBase): Call parent.
9919         (Field.Define): Call parent.
9920
9921         * report.cs: Negative error codes are now mapped to 8000 - code,
9922         so that the display is render more nicely.
9923
9924         * typemanager.cs: Do not use try/catch, instead report a regular
9925         error. 
9926
9927         (GetPointerType, GetReferenceType): These methods provide
9928         mechanisms to obtain the T* and T& from a T.  We had the code
9929         previously scattered around the code base, and it also used
9930         TypeManager.LookupType that would go through plenty of caches.
9931         This one goes directly to the type source.
9932
9933         In some places we did the Type.GetType followed by
9934         ModuleBuilder.GetType, but not in others, so this unifies the
9935         processing as well.
9936
9937         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9938         statements now that we have namespace information.
9939
9940         * typemanager.cs (IsNamespace): New method, returns whether the
9941         string presented is a namespace or not.
9942
9943         (ComputeNamespaces): New public entry point, computes the list of
9944         available namespaces, using the GetNamespaces API call in Mono, or
9945         the slower version in MS.NET.   
9946
9947         Now before we start the semantic analysis phase, we have a
9948         complete list of namespaces including everything that the user has
9949         provided.
9950
9951         Deleted old code to cache namespaces in .nsc files.
9952
9953 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9954
9955         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9956         class/struct location definition Location for the implicit
9957         constructor location.
9958
9959         (Operator.Define): Use the location of the operator for the
9960         implicit Method definition.
9961
9962         (Constructor.Emit): use the constructor location for the implicit
9963         base initializer constructor.
9964
9965         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9966         and the Expression class now contains two new methods:
9967
9968         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9969         isolate type lookup from the rest of the resolution process.
9970
9971         Since we use Expressions to hold type definitions due to the way
9972         we parse the input we have historically overloaded Resolve to
9973         perform the Type lookups if a special flag is passed.  Now this is
9974         eliminated and two methods take their place. 
9975
9976         The differences in the two methods between xStep and xTerminal is
9977         that xStep is involved in our current lookup system that uses
9978         SimpleNames to compose a name, while xTerminal is used just to
9979         catch the case where the simplename lookup failed.
9980
9981 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9982
9983         * expression.cs (ResolveMemberAccess): Remove redundant code.
9984         TypeExpr expressions are always born fully resolved.
9985
9986         * interface.cs (PopulateMethod): Do not lookup the types twice.
9987         We were doing it once during SemanticAnalysis and once during
9988         PopulateMethod.
9989
9990         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9991         in local variable type definitions, were being returned as a
9992         SimpleName (we decomposed everything into a string), that is
9993         because primary_expression was being used instead of a type in the
9994         grammar (reduce/reduce conflicts).
9995
9996         The part that was wrong is that we converted the expression into a
9997         string (an oversimplification in one hand, compounded with primary
9998         expressions doing string concatenation).
9999
10000         So things like:
10001
10002         A.B.C [] x;
10003
10004         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10005         using clauses from working on this particular context.  And a type
10006         was being matched directly against "A.B.C[]".
10007
10008         We now use the correct approach, and allow for ComposedCast to be
10009         part of the unary expression.  So the "A.B.C []" become a composed
10010         cast of "A.B.C" (as a nested group of MemberAccess with a
10011         SimpleName at the end) plus the rank composition "[]". 
10012
10013         Also fixes 35567
10014
10015 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10016
10017         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10018         for the access level checking.
10019
10020         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10021         `TypeContainer container', because I kept getting confused when I
10022         was debugging this code.
10023
10024         * expression.cs (Indexers): Instead of tracking getters/setters,
10025         we now track them in parallel.  We create one arraylist less, but
10026         most importantly it is possible now for the LValue code to find a
10027         matching get for a set.
10028
10029         (IndexerAccess.DoResolveLValue): Update the code.
10030         GetIndexersForType has been modified already to extract all the
10031         indexers from a type.  The code assumed it did not.
10032
10033         Also make the code set the correct return type for the indexer.
10034         This was fixed a long time ago for properties, but was missing for
10035         indexers.  It used to be void_type.
10036
10037         (Binary.Emit): Test first for doubles instead of
10038         floats, as they are more common.
10039
10040         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10041         when dealing with floats and the <=, >= operators.  This fixes bug
10042         #39314 
10043
10044         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10045         to load the array value by emitting a load on the foreach variable
10046         type.  This was incorrect.  
10047
10048         We now emit the code to load an element using the the array
10049         variable type, and then we emit the conversion operator.
10050
10051         Fixed #40176
10052
10053 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10054
10055         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10056
10057 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10058
10059         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10060         test for protection before we test for signatures. 
10061
10062         (MethodSignature.ToString): implement.
10063
10064         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10065         to the case where we reduced into a LongConstant.
10066
10067         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10068         depend on whether the information is acurrate, because the
10069         Microsoft runtime will always claim that the array type is public,
10070         regardless of the real state.
10071
10072         If the type is a pointer, another problem happens: the type is
10073         reported as non-public in Microsoft.  
10074
10075         In both cases we have to call CheckAccessLevel recursively with
10076         the underlying type as the argument to be tested.
10077
10078 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10079
10080         * assign.cs (Assign.Emit): If we are dealing with a compound
10081         assignment expression, we should use the code path that stores the
10082         intermediate result in a temporary value.  This fixes #40903.
10083
10084         *expression.cs (Indirection.ToString): Provide ToString method for
10085         debugging. 
10086
10087 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10088
10089         * class.cs: Null out fields holding references to Block objects so
10090         they can be garbage collected.
10091
10092         * expression.cs (OverloadResolve): Remove unused local.
10093
10094 2003-04-07  Martin Baulig  <martin@ximian.com>
10095
10096         * codegen.cs (EmitContext.CurrentFile): New public field.
10097         (EmitContext.Mark): Use the CurrentFile to check whether the
10098         location is in the correct file.
10099         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10100
10101 2003-04-07  Martin Baulig  <martin@ximian.com>
10102
10103         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10104
10105         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10106         location.  [FIXME: The location argument which gets passed to this
10107         method is sometimes wrong!]
10108
10109 2003-04-07  Nick Drochak <ndrochak@gol.com>
10110
10111         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10112
10113 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10114
10115         * expression.cs (Indirection.EmitAssign): We were using the
10116         temporary, but returning immediately instead of continuing the
10117         EmitAssing flow.
10118
10119 2003-04-06  Martin Baulig  <martin@ximian.com>
10120
10121         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10122         if it's a nested child, but also deriving from the outer class.
10123         See test 190.cs.
10124
10125         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10126         nested child, but also deriving from the outer class.  See
10127         test-190.cs.
10128         (FilterWithClosure): We may access private members of the outer
10129         class if we're a nested child and deriving from the outer class.
10130         (RealMemberLookup): Only set `closure_private_ok' if the
10131         `original_bf' contained BindingFlags.NonPublic.
10132
10133 2003-04-05  Martin Baulig  <martin@ximian.com>
10134
10135         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10136
10137 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10138
10139         * class.cs (Event.Define): Do not allow abstract events to have
10140         initializers. 
10141
10142 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10143
10144         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10145         block in event declarations.
10146
10147         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10148         value type, get its address.
10149
10150         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10151         leaving a class on the stack instead of a boolean value (int
10152         0/1).  Change the code so we compare against null, and then the
10153         result against zero.
10154
10155         * class.cs (TypeContainer.GetClassBases): We were checking for the
10156         parent class being sealed too late.
10157
10158         * expression.cs (Binary.Emit): For <= and >= when dealing with
10159         floating point values, use cgt.un and clt.un instead of cgt and
10160         clt alone.
10161
10162 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10163
10164         * statement.cs: Apply the same optimization as MS: skip the 
10165         GetEnumerator returning an IEnumerator, and use the one returning a 
10166         CharEnumerator instead. This allows us to avoid the try-finally block 
10167         and the boxing.
10168
10169 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10170
10171         * cs-parser.jay: Attributes cannot be applied to
10172                          namespaces. Fixes #40473
10173
10174 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10175
10176         * class.cs:
10177         (Add*): check if the name is valid using the full name for constants,
10178         fields, properties and events.
10179
10180 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10181
10182         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10183         char constants to be part of the enumeration.
10184
10185         * expression.cs (Conditional.DoResolve): Add support for operator
10186         true. Implements the missing functionality from 14.12
10187
10188         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10189         operator true/false as required by the spec.
10190
10191         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10192         implicit conversion to boolean.
10193
10194         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10195         also one where the type implements `operator true'. 
10196
10197         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10198         get an expression that will invoke operator true based on an
10199         expression.  
10200
10201         (GetConversionOperators): Removed the hack that called op_True
10202         here.  
10203
10204         (Expression.ResolveBoolean): Move this from Statement.
10205
10206 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10207
10208         * ecore.cs (FieldExpr): do not allow initialization of initonly
10209         fields on derived classes
10210
10211 2003-03-13  Martin Baulig  <martin@ximian.com>
10212
10213         * statement.cs (Block.Emit): Call ig.BeginScope() and
10214         ig.EndScope() when compiling with debugging info; call
10215         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10216
10217 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10218
10219         * expression.cs (Indexers): Do not construct immediately, allow
10220         for new members to be appended as we go.  Fixes 38143
10221
10222 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10223
10224         * expression.cs: save/restore context when resolving an unchecked
10225         expression.
10226
10227 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * cfold.cs: Catch division by zero in modulus operator during
10230         constant folding.
10231
10232 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10233
10234         * interface.cs (Interface.DefineMembers): Avoid defining members
10235         twice. 
10236
10237 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10238
10239         * driver.cs: handle the +/- options for -noconfig
10240
10241         * statement.cs (Unckeched.Resolve): Also track the state of
10242         unchecked in the Resolve phase.
10243
10244 2003-02-27  Martin Baulig  <martin@ximian.com>
10245
10246         * ecore.cs (Expression.MemberLookup): Don't create a
10247         MethodGroupExpr for something which is not a method.  Fixes #38291.
10248
10249 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10250
10251         * class.cs (MemberBase.CheckParameters): Also check that the type
10252         is unmanaged if it is a pointer.
10253
10254         * expression.cs (SizeOf.Resolve): Add location information.
10255
10256         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10257         a managed type is declared.
10258
10259         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10260         parameter modifiers as well.  Fixes bug 38606
10261
10262         * class.cs: Very sad.  Am backing out the speed up changes
10263         introduced by the ArrayList -> Array in the TypeContainer, as they
10264         were not actually that much faster, and introduced a bug (no error
10265         reports on duplicated methods).
10266
10267         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10268         source first, this will guarantee that we have a valid expression
10269         before calling in lower levels functions that will require a
10270         resolved object.  Then use this original_source in the
10271         target.ResolveLValue instead of the original source that was
10272         passed to us.
10273
10274         Another change.  Use target.Resolve instead of LValueResolve.
10275         Although we are resolving for LValues, we will let the Assign code
10276         take care of that (it will be called again from Resolve).  This
10277         basically allows code like this:
10278
10279         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10280         class Y { void A (X x) { x [0] += o; }
10281
10282         The problem was that the indexer was trying to resolve for
10283         set_Item (idx, object o) and never finding one.  The real set_Item
10284         was set_Item (idx, X).  By delaying the process we get the right
10285         semantics. 
10286
10287         Fixes bug 36505
10288
10289 2003-02-23  Martin Baulig  <martin@ximian.com>
10290
10291         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10292         while calling DoEmit ().
10293
10294         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10295         source files; if you use the #line directive inside a method, the
10296         compiler stops emitting line numbers for the debugger until it
10297         reaches the end of the method or another #line directive which
10298         restores the original file.
10299
10300 2003-02-23  Martin Baulig  <martin@ximian.com>
10301
10302         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10303
10304 2003-02-23  Martin Baulig  <martin@ximian.com>
10305
10306         * statement.cs (Block.AddChildVariableNames): We need to call this
10307         recursively, not just for our immediate children.
10308
10309 2003-02-23  Martin Baulig  <martin@ximian.com>
10310
10311         * class.cs (Event.Define): Always make the field private, like csc does.
10312
10313         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10314         actually work, fixes bug #37521.
10315
10316 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10317
10318         * delegate.cs: When creating the various temporary "Parameters"
10319         classes, make sure that we call the ComputeAndDefineParameterTypes
10320         on those new parameters (just like we do with the formal ones), to
10321         allow them to be resolved in the context of the DeclSpace.
10322
10323         This fixes the bug that Dick observed in Bugzilla #38530.
10324
10325 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10326
10327         * expression.cs (ResolveMemberAccess): When resolving a constant,
10328         do not attempt to pull a constant if the value was not able to
10329         generate a valid constant.
10330
10331         * const.cs (LookupConstantValue): Do not report more errors than required.
10332
10333 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10334
10335         * expression.cs: fixes bug #38328.
10336
10337 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10338
10339         * class.cs: Changed all the various members that can be part of a
10340         class from being an ArrayList to be an Array of the right type.
10341         During the DefineType type_list, interface_list, delegate_list and
10342         enum_list are turned into types, interfaces, delegates and enums
10343         arrays.  
10344
10345         And during the member population, indexer_list, event_list,
10346         constant_list, field_list, instance_constructor_list, method_list,
10347         operator_list and property_list are turned into their real arrays.
10348
10349         Although we could probably perform this operation earlier, for
10350         good error reporting we need to keep the lists and remove the
10351         lists for longer than required.
10352
10353         This optimization was triggered by Paolo profiling the compiler
10354         speed on the output of `gen-sample-program.pl' perl script. 
10355
10356         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10357         not crash in methods like MemberLookupFailed that use this field.  
10358
10359         This problem arises when the compiler fails to resolve a type
10360         during interface type definition for example.
10361
10362 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10363
10364         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10365         inherit from System.Object, so we have to stop at null, not only
10366         when reaching System.Object.
10367
10368 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10369
10370         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10371         DeclaredOnly because the parent indexer might have had a different
10372         name, but did not loop until the top of the hierarchy was reached.
10373
10374         The problem this one fixes is 35492: when a class implemented an
10375         indexer from an interface, we were getting the interface method
10376         (which was abstract) and we were flagging an error (can not invoke
10377         abstract method).
10378
10379         This also keeps bug 33089 functioning, and test-148 functioning.
10380
10381         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10382         out if a method is special is to see if it is declared in a
10383         property or event, or whether it is one of the predefined operator
10384         names.   This should fix correctly #36804.
10385
10386 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10387
10388         The goal here is to remove the dependency on EmptyCast.Peel ().
10389         Killing it completely.
10390
10391         The problem is that currently in a number of places where
10392         constants are expected, we have to "probe" for an EmptyCast, and
10393         Peel, which is not the correct thing to do, as this will be
10394         repetitive and will likely lead to errors. 
10395
10396         The idea is to remove any EmptyCasts that are used in casts that
10397         can be reduced to constants, so we only have to cope with
10398         constants. 
10399
10400         This bug hunt was triggered by Bug 37363 and the desire to remove
10401         the duplicate pattern where we were "peeling" emptycasts to check
10402         whether they were constants.  Now constants will always be
10403         constants.
10404
10405         * ecore.cs: Use an enumconstant here instead of wrapping with
10406         EmptyCast.  
10407
10408         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10409         throwing me off.  By handling this we can get rid of a few hacks.
10410
10411         * statement.cs (Switch): Removed Peel() code.
10412
10413 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10414
10415         * class.cs: Location information for error 508
10416
10417         * expression.cs (New.DoResolve): Add a guard against double
10418         resolution of an expression.  
10419
10420         The New DoResolve might be called twice when initializing field
10421         expressions (see EmitFieldInitializers, the call to
10422         GetInitializerExpression will perform a resolve on the expression,
10423         and later the assign will trigger another resolution
10424
10425         This leads to bugs (#37014)
10426
10427         * delegate.cs: The signature for EndInvoke should contain any ref
10428         or out parameters as well.  We were not doing this in the past. 
10429
10430         * class.cs (Field.Define): Do not overwrite the type definition
10431         inside the `volatile' group.  Turns out that volatile enumerations
10432         were changing the type here to perform a validity test, which
10433         broke conversions. 
10434
10435 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10436
10437         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10438         and structs, we do not want to load the instance variable
10439
10440         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10441         enum_type has to be handled like an object reference (implicit
10442         conversions exists from this to object), but the regular IsClass
10443         and IsValueType tests will never return true for this one.
10444
10445         Also we use TypeManager.IsValueType instead of type.IsValueType,
10446         just for consistency with the rest of the code (this is only
10447         needed if we ever use the construct exposed by test-180.cs inside
10448         corlib, which we dont today).
10449
10450 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10451
10452         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10453         just InternalCall.
10454
10455 2003-02-09  Martin Baulig  <martin@ximian.com>
10456
10457         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10458         (Namespace.DefineNamespaces): New static public method; this is
10459         called when we're compiling with debugging to add all namespaces
10460         to the symbol file.
10461
10462         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10463         pass it to the Namespace's .ctor.
10464
10465         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10466         and MethodBase arguments; pass the namespace ID to the symwriter;
10467         pass the MethodBase instead of the token to the symwriter.
10468         (SymbolWriter.DefineNamespace): New method to add a namespace to
10469         the symbol file.
10470
10471 2003-02-09  Martin Baulig  <martin@ximian.com>
10472
10473         * symbolwriter.cs: New file.  This is a wrapper around
10474         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10475         methods here in near future.
10476
10477 2003-02-09  Martin Baulig  <martin@ximian.com>
10478
10479         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10480         ILGenerator.MarkSequencePoint() which are actually used by the
10481         symbol writer.
10482
10483 2003-02-09  Martin Baulig  <martin@ximian.com>
10484
10485         * location.cs (SourceFile): New public sealed class.  This
10486         contains the name and an index which is used in the location's token.
10487         (Location): Reserve an appropriate number of bits in the token for
10488         the source file instead of walking over that list, this gives us a
10489         really huge performance improvement when compiling with debugging.
10490
10491         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10492         `SourceFile' argument instead of a string.
10493         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10494         but don't parse/tokenize here, we need to generate the list of all
10495         source files before we do that.
10496         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10497         the files.
10498
10499         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10500         instead of a string.
10501
10502         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10503         of a string.
10504
10505 2003-02-09  Martin Baulig  <martin@ximian.com>
10506
10507         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10508         filename on `#line default'.
10509
10510 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10511
10512         * statement.cs: don't clear the pinned var when the fixed statement
10513         returns from the method (fixes bug#37752).
10514
10515 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10516
10517         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10518         to IsValueType.
10519
10520 2003-02-07  Martin Baulig  <martin@ximian.com>
10521
10522         * driver.cs: Removed the `--debug-args' command line argument.
10523
10524         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10525         automatically by the AsssemblyBuilder.
10526         (CodeGen.InitializeSymbolWriter): We don't need to call any
10527         initialization function on the symbol writer anymore.  This method
10528         doesn't take any arguments.
10529
10530 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10531
10532         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10533         from referenced assemblies as well.
10534
10535 2003-02-02  Martin Baulig  <martin@ximian.com>
10536
10537         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10538
10539 2003-02-02  Martin Baulig  <martin@ximian.com>
10540
10541         * class.cs (Constructor.Emit): Open the symbol writer before
10542         emitting the constructor initializer.
10543         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10544         single-stepping through constructor initializers.
10545
10546 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10547
10548         * class.cs: Handle error 549: do not allow virtual methods in
10549         sealed classes. 
10550
10551 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10552
10553         * decl.cs: Check access levels when resolving types
10554
10555 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10556
10557         * statement.cs: Add parameters and locals set in catch blocks that might 
10558         return to set vector
10559
10560 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10561
10562         * class.cs (Operator): Set the SpecialName flags for operators.
10563
10564         * expression.cs (Invocation.DoResolve): Only block calls to
10565         accessors and operators on SpecialName methods.
10566
10567         (Cast.TryReduce): Handle conversions from char constants.
10568
10569
10570 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10571
10572         * statement.cs: small memory and time optimization in FlowBranching.
10573
10574 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10575
10576         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10577         problem that the last fix but in the other sid (Set).
10578
10579         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10580         access when there is no indexer in the hierarchy.
10581
10582 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10583
10584         * class.cs: Combine some if statements.
10585
10586 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10587
10588         * driver.cs: fixed bug #37187.
10589
10590 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10591
10592         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10593         any indexer, it's needed to build a list with all the indexers in the
10594         hierarchy (AllGetters), else we have problems. Fixes #35653.
10595
10596 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10597
10598         * class.cs (MethodData.Define): It is wrong for an interface
10599         implementation to be static in both cases: explicit and implicit.
10600         We were only handling this in one case.
10601
10602         Improve the if situation there to not have negations.
10603
10604         * class.cs (Field.Define): Turns out that we do not need to check
10605         the unsafe bit on field definition, only on usage.  Remove the test.
10606
10607 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10608
10609         * driver.cs: use assembly.Location instead of Codebase (the latest
10610         patch made mcs fail when using MS assemblies).
10611
10612 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10613
10614         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10615         get the path to *corlib.dll.
10616
10617 2003-01-21  Nick Drochak <ndrochak@gol.com>
10618
10619         * cs-tokenizer.cs:
10620         * pending.cs:
10621         * typemanager.cs: Remove compiler warnings
10622
10623 2003-01-20  Duncan Mak  <duncan@ximian.com>
10624
10625         * AssemblyInfo.cs: Bump the version number to 0.19.
10626
10627 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10628
10629         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10630
10631 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10632
10633         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10634
10635 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10636
10637         * cs-parser.jay: Small fix: we were not comparing the constructor
10638         name correctly.   Thanks to Zoltan for the initial pointer.
10639
10640 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10641
10642         * cs-tokenizer.cs: Set file name when specified with #line
10643
10644 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10645
10646         * cs-parser.jay: Only perform the constructor checks here if we
10647         are named like the class;  This will help provider a better
10648         error.  The constructor path is taken when a type definition is
10649         not found, but most likely the user forgot to add the type, so
10650         report that rather than the constructor error.
10651
10652 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10653
10654         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10655         allocations.
10656
10657 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10658
10659         * cs-parser.jay: Add cleanup call.
10660
10661 2003-01-13  Duncan Mak  <duncan@ximian.com>
10662
10663         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10664         consistent with other methods.
10665
10666 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10667
10668         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10669
10670 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10671
10672         * attribute.cs: only set GuidAttr to true when we have a
10673         GuidAttribute.
10674
10675 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10676
10677         * ecore.cs:
10678         * expression.cs:
10679         * typemanager.cs: fixes to allow mcs compile corlib with the new
10680         Type.IsSubclassOf fix.
10681
10682 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10683
10684         * expression.cs (LocalVariableReference.DoResolve): Classify a
10685         constant as a value, not as a variable.   Also, set the type for
10686         the variable.
10687
10688         * cs-parser.jay (fixed_statement): take a type instead of a
10689         pointer_type, so we can produce a better error message later.
10690
10691         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10692         as an error.  
10693
10694         (For.DoEmit): Make inifinite loops have a
10695         non-conditional branch back.
10696
10697         (Fixed.DoEmit): First populate the pinned variables, then emit the
10698         statement, then clear the variables.  Before I was emitting the
10699         code once for each fixed piece.
10700
10701
10702 2003-01-08  Martin Baulig  <martin@ximian.com>
10703
10704         * statement.cs (FlowBranching.MergeChild): A break in a
10705         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10706
10707 2003-01-08  Martin Baulig  <martin@ximian.com>
10708
10709         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10710         lives in the same number space than `param_map'.  Fixes #36154.
10711
10712 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10713
10714         * cs-parser.jay (constructor_declaration): Set the
10715         Constructor.ModFlags before probing for it.  This makes the
10716         compiler report 514, 515 and 132 (the code was there, but got
10717         broken). 
10718
10719         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10720         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10721         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10722
10723 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10724
10725         * enum.cs: create the enum static fields using the enum type.
10726
10727 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10728
10729         * class.cs: don't try to create the ParamBuilder for the return
10730         type if it's not needed (and handle it breaking for the ms runtime
10731         anyway).
10732
10733 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10734
10735         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10736
10737 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10738
10739         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10740         the command.   This showed up while compiling the JANET source
10741         code, which used \r as its only newline separator.
10742
10743 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10744
10745         * class.cs (Method.Define): If we are an operator (because it
10746         reuses our code), then set the SpecialName and HideBySig.  #36128
10747
10748 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10749
10750         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10751         exception, report error 120 `object reference required'.
10752
10753         * driver.cs: Add --pause option, used during to measure the size
10754         of the process as it goes with --timestamp.
10755
10756         * expression.cs (Invocation.DoResolve): Do not allow methods with
10757         SpecialName to be invoked.
10758
10759 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10760
10761         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10762         number before adding it.
10763
10764 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10765
10766         * ecore.cs (StandardImplicitConversion): When in an unsafe
10767         context, we allow conversion between void * to any other pointer
10768         type. This fixes bug #35973.
10769
10770 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10771
10772         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10773         is not thrown when extensionless outputs are used 
10774
10775 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10776
10777         * rootcontext.cs: fixed compilation of corlib.
10778
10779 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10780
10781         * attribute.cs (Attributes.Contains): Add new method.
10782
10783         * class.cs (MethodCore.LabelParameters): if the parameter is an
10784         `out' parameter, check that no attribute `[In]' has been passed.
10785
10786         * enum.cs: Handle the `value__' name in an enumeration.
10787
10788 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10789
10790         * decl.cs: Added special case to allow overrides on "protected
10791         internal" methods
10792
10793 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10794
10795         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10796         since it makes much more sense.
10797
10798         (Attributes.ctor): Don't require a Location parameter.
10799
10800         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10801
10802         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10803         since we already have that information per attribute.
10804
10805         * everywhere : make appropriate changes.
10806
10807         * class.cs (LabelParameters): Write the code which actually
10808         applies attributes to the return type. We can't do this on the MS
10809         .NET runtime so we flag a warning in the case an exception is
10810         thrown.
10811
10812 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10813
10814         * const.cs: Handle implicit null conversions here too.
10815
10816 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10817
10818         * class.cs (MethodCore.LabelParameters): Remove the extra
10819         Type [] parameter since it is completely unnecessary. Instead
10820         pass in the method's attributes so that we can extract
10821         the "return" attribute.
10822
10823 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10824
10825         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10826         of ignoring it and letting the compile continue.
10827
10828         * typemanager.cs (ChangeType): use an extra argument to return an
10829         error condition instead of throwing an exception.
10830
10831 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10832
10833         * expression.cs (Unary.TryReduce): mimic the code for the regular
10834         code path.  Perform an implicit cast in the cases where we can
10835         implicitly convert to one of the integral types, and then reduce
10836         based on that constant.   This fixes bug #35483.
10837
10838 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10839
10840         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10841
10842 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10843
10844         * namespace.cs: fixed bug #35489.
10845
10846 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10847
10848         * class.cs: Remove some dead code.
10849
10850         * cs-parser.jay: Estimate the number of methods needed
10851         (RootContext.MethodCount);
10852
10853         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10854         numbers instead of StringBuilders.
10855
10856         * support.cs (PtrHashtable): Add constructor with initial size;
10857         We can now reduce reallocations of the method table.
10858
10859 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10860
10861         * attribute.cs (ApplyAttributes): Keep track of the emitted
10862         attributes on a per-target basis. This fixes bug #35413.
10863
10864 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10865
10866         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10867         default to the Windows 1252 encoding.
10868
10869         (UnixParseOption): Support version, thanks to Alp for the missing
10870         pointer. 
10871
10872         * AssemblyInfo.cs: Add nice assembly information.
10873
10874         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10875         (bug 35169).
10876
10877         * cs-parser.jay: Allow a trailing comma before the close bracked
10878         in the attribute_section production.
10879
10880         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10881         address of the instance was being taken, I will take this out,
10882         because we take the address of the object immediately here.
10883
10884 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10885
10886         * typemanager.cs (AreMultipleAllowed): Take care of the most
10887         obvious case where attribute type is not in the current assembly -
10888         stupid me ;-)
10889
10890 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10891
10892         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10893         definitions, instead of doing that afterwards.  
10894
10895         Also we use a nice little hack, depending on the constructor, we
10896         know if we are a "composed" name or a simple name.  Hence, we
10897         avoid the IndexOf test, and we avoid 
10898
10899         * codegen.cs: Add code to assist in a bug reporter to track down
10900         the source of a compiler crash. 
10901
10902 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10903
10904         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10905         types have been emitted for a given element and flag an error
10906         if something which does not have AllowMultiple set is used more
10907         than once.
10908
10909         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10910         attribute types and their corresponding AllowMultiple properties
10911
10912         (AreMultipleAllowed): Check the property for a given type.
10913
10914         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10915         property in the case we have a TypeContainer.
10916
10917         (Attributes.AddAttribute): Detect duplicates and just skip on
10918         adding them. This trivial fix catches a pretty gross error in our
10919         attribute emission - global attributes were being emitted twice!
10920
10921         Bugzilla bug #33187 is now fixed.
10922
10923 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10924
10925         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10926         instead of pp_and).
10927
10928         * expression.cs (Binary.ResolveOperator): I can only use the
10929         Concat (string, string, string) and Concat (string, string,
10930         string, string) if the child is actually a concatenation of
10931         strings. 
10932
10933 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10934
10935         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10936         context where we need a 2-character lookahead.
10937
10938         * pending.cs (PendingImplementation): Rework so we can keep track
10939         of interface types all the time, and flag those which were
10940         implemented by parents as optional.
10941
10942 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10943
10944         * expression.cs (Binary.ResolveOperator): Use
10945         String.Concat(string,string,string) or
10946         String.Concat(string,string,string,string) when possible. 
10947
10948         * typemanager: More helper methods.
10949
10950
10951 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10952
10953         * pending.cs: remove the bogus return from GetMissingInterfaces()
10954         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10955
10956 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10957
10958         * namespace.cs: avoid duplicated 'using xxx' being added to
10959         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10960         when we get more than one 'using' statement for the same namespace.
10961         Report a CS0105 warning for it.
10962
10963 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10964
10965         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10966         of calling getChar/putback, uses internal knowledge of it.    
10967
10968         (xtoken): Reorder tokenizer so most common patterns are checked
10969         first.  This reduces the compilation time in another 5% (from 8.11s
10970         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10971
10972         The parsing time is 22% of the compilation in mcs, and from that
10973         64% is spent on the tokenization process.  
10974
10975         I tried using a binary search for keywords, but this is slower
10976         than the hashtable.  Another option would be to do a couple of
10977         things:
10978
10979                 * Not use a StringBuilder, instead use an array of chars,
10980                   with a set value.  Notice that this way we could catch
10981                   the 645 error without having to do it *afterwards*.
10982
10983                 * We could write a hand-parser to avoid the hashtable
10984                   compares altogether.
10985
10986         The identifier consumption process takes 37% of the tokenization
10987         time.  Another 15% is spent on is_number.  56% of the time spent
10988         on is_number is spent on Int64.Parse:
10989
10990                 * We could probably choose based on the string length to
10991                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10992                   computations. 
10993
10994         Another 3% is spend on wrapping `xtoken' in the `token' function.
10995
10996         Handle 0xa0 as whitespace (#34752)
10997
10998 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10999
11000         * typemanager.cs (IsCLRType): New routine to tell whether a type
11001         is one of the builtin types.  
11002
11003         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11004         typecode in more places instead of doing pointer comparissions.
11005         We could leverage some knowledge about the way the typecodes are
11006         laid out.
11007
11008         New code to cache namespaces in assemblies, it is currently not
11009         invoked, to be used soon.
11010
11011         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11012
11013         * expression.cs (Binary.ResolveOperator): specially handle
11014         strings, and do not perform user-defined operator overloading for
11015         built-in types.
11016
11017 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11018
11019         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11020         internalcall as it is a pretty simple operation;  Avoid whenever
11021         possible to call Char.IsLetter.
11022
11023         (consume_identifier): Cut by half the number of
11024         hashtable calls by merging the is_keyword and GetKeyword behavior.
11025
11026         Do not short-circuit, because if we do, we
11027         report errors (ie, #if false && true would produce an invalid
11028         directive error);
11029
11030
11031 2002-11-24  Martin Baulig  <martin@ximian.com>
11032
11033         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11034         check constant ranges and report a CS0221.  Fixes #33186.
11035
11036 2002-11-24  Martin Baulig  <martin@ximian.com>
11037
11038         * cs-parser.jay: Make this work for uninitialized variable
11039         declarations in the `for' initializer.  Fixes #32416.
11040
11041 2002-11-24  Martin Baulig  <martin@ximian.com>
11042
11043         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11044         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11045
11046 2002-11-24  Martin Baulig  <martin@ximian.com>
11047
11048         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11049         argument; if true, we also check for user-defined conversions.
11050         This is only needed if both arguments are of a user-defined type.
11051         Fixes #30443, added test-175.cs.
11052         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11053
11054         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11055
11056 2002-11-24  Martin Baulig  <martin@ximian.com>
11057
11058         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11059         function to get the store opcode.
11060         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11061         only emit the Ldelema if the store opcode is Stobj.  You must run
11062         both test-34 and test-167 to test this.  Fixes #34529.
11063
11064 2002-11-23  Martin Baulig  <martin@ximian.com>
11065
11066         * ecore.cs (Expression.MemberLookup): Added additional
11067         `qualifier_type' argument which is used when we're being called
11068         from MemberAccess.DoResolve() and null if we're called from a
11069         SimpleName lookup.
11070         (Expression.MemberLookupFailed): New method to report errors; this
11071         does the CS1540 check and reports the correct error message.
11072
11073         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11074         argument for the CS1540 check and redone the way how we're dealing
11075         with private members.  See the comment in the source code for details.
11076         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11077         `closure_start_type' to `closure_qualifier_type' and check whether
11078         it's not null.  It was not this filter being broken, it was just
11079         being called with the wrong arguments.
11080
11081         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11082         and pass it the correct `qualifier_type'; this also does the error
11083         handling for us.
11084
11085 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11086
11087         * expression.cs (Invocation.EmitParams): If the we are dealing
11088         with a non-built-in value type, load its address as well.
11089
11090         (ArrayCreation): Use a a pretty constant instead
11091         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11092         static initializers.  
11093
11094         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11095         because they are not really value types, just glorified integers. 
11096
11097         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11098
11099         * ecore.cs: Remove redundant code for enumerations, make them use
11100         the same code path as everything else, fixes the casting issue
11101         with enumerations in Windows.Forms.
11102
11103         * attribute.cs: Do only cast to string if it is a string, the
11104         validation happens later.
11105
11106         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11107         people upgrade their corlibs.
11108
11109         * ecore.cs: Oops, enumerations were not following the entire code path
11110
11111 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11112
11113         * typemanager.cs (FilterWithClosure): Commented out the test for
11114         1540 in typemanager.cs, as it has problems when accessing
11115         protected methods from a parent class (see test-174.cs). 
11116
11117         * attribute.cs (Attribute.ValidateGuid): new method.
11118         (Attribute.Resolve): Use above.
11119
11120 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11121
11122         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11123
11124         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11125         handling for enumerations, as we only needed the TypeContainer
11126         functionality to begin with (this is required for the fix below to
11127         work for enums that reference constants in a container class for
11128         example). 
11129
11130         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11131
11132         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11133         a valid TypeBuilder to perform lookups on.o
11134
11135         * class.cs (InheritableMemberSignatureCompare): Use true in the
11136         call to GetGetMethod and GetSetMethod, because we are comparing
11137         the signature, and we need to get the methods *even* if they are
11138         private. 
11139
11140         (PropertyBase.CheckBase): ditto.
11141
11142         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11143         GotoCase.Resolve): Use Peel on EmpytCasts.
11144
11145         * ecore.cs (EmptyCast): drop child, add Peel method.
11146
11147 2002-11-17  Martin Baulig  <martin@ximian.com>
11148
11149         * ecore.cs (EmptyCast.Child): New public property.
11150
11151         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11152         label resolved to an EmptyCast.  Fixes #34162.
11153         (GotoCase.Resolve): Likewise.
11154         (Block.EmitMeta): Likewise.
11155
11156 2002-11-17  Martin Baulig  <martin@ximian.com>
11157
11158         * expression.cs (Invocation.BetterConversion): Prefer int over
11159         uint; short over ushort; long over ulong for integer literals.
11160         Use ImplicitConversionExists instead of StandardConversionExists
11161         since we also need to check for user-defined implicit conversions.
11162         Fixes #34165.  Added test-173.cs.
11163
11164 2002-11-16  Martin Baulig  <martin@ximian.com>
11165
11166         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11167         with the `true' and `false' literals.  Fixes #33151.
11168
11169 2002-11-16  Martin Baulig  <martin@ximian.com>
11170
11171         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11172         October 22nd; don't do the cs1540 check for static members.
11173
11174         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11175         now using our own filter here and doing the cs1540 check again.
11176
11177 2002-11-16  Martin Baulig  <martin@ximian.com>
11178
11179         * support.cs (InternalParameters): Don't crash if we don't have
11180         any fixed parameters.  Fixes #33532.
11181
11182 2002-11-16  Martin Baulig  <martin@ximian.com>
11183
11184         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11185         when looking up static methods to make this work on Windows.
11186         Fixes #33773.
11187
11188 2002-11-16  Martin Baulig  <martin@ximian.com>
11189
11190         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11191         a setter rather than using PropertyInfo.CanWrite.
11192
11193 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11194
11195         * class.cs: Allow acces to block member by subclasses. Fixes build
11196         breaker.
11197
11198 2002-11-14  Martin Baulig  <martin@ximian.com>
11199
11200         * class.cs (Constructor.Emit): Added the extern/block check.
11201         Fixes bug #33678.
11202
11203 2002-11-14  Martin Baulig  <martin@ximian.com>
11204
11205         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11206         iteration while looking for indexers, this is needed because the
11207         indexer may have a different name in our base classes.  Fixed the
11208         error reporting (no indexers at all, not get accessor, no
11209         overloaded match).  Fixes bug #33089.
11210         (IndexerAccess.DoResolveLValue): Likewise.
11211
11212 2002-11-14  Martin Baulig  <martin@ximian.com>
11213
11214         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11215         indexers.  Fixes the first part of bug #33089.
11216         (MethodSignature.InheritableMemberSignatureCompare): Added support
11217         for properties.
11218
11219 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11220
11221         * attribute.cs (Attribute.Resolve): Catch the
11222         NullReferenceException and report it since it isn't supposed to
11223         happen. 
11224
11225 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11226
11227         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11228         LogicalOr and LogicalAnd that can benefit from recursively
11229         handling EmitBranchable.  The code now should be nice for Paolo.
11230
11231 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11232
11233         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11234         the Type lookups, as we perform quite a number of lookups on
11235         non-Types.  This can be removed once we can deterministically tell
11236         whether we have a type or a namespace in advance.
11237
11238         But this might require special hacks from our corlib.
11239
11240         * TODO: updated.
11241
11242         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11243         and double which avoids a conversion from an integer to a double.
11244
11245         * expression.cs: tiny optimization, avoid calling IsConstant,
11246         because it effectively performs the lookup twice.
11247
11248 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11249
11250         But a bogus return here to keep the semantics of the old code
11251         until the Mono runtime is fixed.
11252
11253         * pending.cs (GetMissingInterfaces): New method used to remove all
11254         the interfaces that are already implemented by our parent
11255         classes from the list of pending methods. 
11256
11257         * interface.cs: Add checks for calls after ResolveTypeExpr.
11258
11259 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11260
11261         * class.cs (Class.Emit): Report warning 67: event not used if the
11262         warning level is beyond 3.
11263
11264         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11265         being a NullLiteral.
11266
11267         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11268         specifiers. 
11269
11270         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11271         path that might fail if a type can not be resolved.
11272
11273         * expression.cs (Binary.Emit): Emit unsigned versions of the
11274         operators. 
11275
11276         * driver.cs: use error 5.
11277
11278 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11279
11280         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11281
11282 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11283
11284         * cs-parser.jay (switch_section): A beautiful patch from Martin
11285         Baulig that fixed 33094.
11286
11287 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11288
11289         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11290         Check whether the base is abstract and report an error if so.
11291
11292         * expression.cs (IndexerAccess.DoResolveLValue,
11293         IndexerAccess.DoResolve): ditto. 
11294
11295         (Invocation.DoResolve): ditto.
11296
11297         (Invocation.FullMethodDesc): Improve the report string.
11298
11299         * statement.cs (Block): Eliminate IsVariableDefined as it is
11300         basically just a wrapper for GetVariableInfo.
11301
11302         * ecore.cs (SimpleName): Use new 
11303
11304         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11305         type, as we return the actual parameter ref/unref state on a
11306         different call.
11307
11308 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11309
11310         * support.cs: Return proper flags REF/OUT fixing the previous
11311         commit.  
11312
11313         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11314         not used to mean `ref' but `ref or out' in ParameterReference
11315
11316         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11317         full type signature instead of calling TypeManger.CSharpName
11318         ourselves. 
11319
11320         * support.cs (InternalParameters.ParameterDesc): Do not compare
11321         directly to the modflags, because REF/OUT will actually be bitsets
11322         if set. 
11323
11324         * delegate.cs (VerifyMethod): Check also the modifiers.
11325
11326         * cs-tokenizer.cs: Fix bug where floating point values with an
11327         exponent where a sign was missing was ignored.
11328
11329         * driver.cs: Allow multiple assemblies to be specified in a single
11330         /r: argument
11331
11332 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11333
11334         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11335         because identifiers after a parenthesis would end up in this kind
11336         of production, and we needed to desamiguate it for having casts
11337         like:
11338
11339                 (UserDefinedType *) xxx
11340
11341 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11342
11343         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11344         we should set on the Bindingflags.NonPublic, but not turn on
11345         private_ok.  private_ok controls whether a Private member is
11346         returned (this is chekced on the filter routine), while the
11347         BindingFlags.NonPublic just controls whether private/protected
11348         will be allowed.   This fixes the problem part of the problem of
11349         private properties being allowed to be used in derived classes.
11350
11351         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11352         so we can call the children DoResolveLValue method (this will
11353         properly signal errors on lvalue assignments to base properties)
11354
11355         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11356         getter are null, and we have a property info, we know that this
11357         happened because the lookup failed, so we report an error 122 for
11358         protection level violation.
11359
11360         We also silently return if setter and getter are null in the
11361         resolve functions, this condition only happens if we have flagged
11362         the error before.  This is the other half of the problem. 
11363
11364         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11365         not have accessibility information, that is why we were returning
11366         true in the filter function in typemanager.cs.
11367
11368         To properly report 122 (property is inaccessible because of its
11369         protection level) correctly, we report this error in ResolveAccess
11370         by failing if both the setter and the getter are lacking (ie, the
11371         lookup failed). 
11372
11373         DoResolve and DoLResolve have been modified to check for both
11374         setter/getter being null and returning silently, the reason being
11375         that I did not want to put the knowledge about this error in upper
11376         layers, like:
11377
11378         int old = Report.Errors;
11379         x = new PropertyExpr (...);
11380         if (old != Report.Errors)
11381                 return null;
11382         else
11383                 return x;
11384
11385         So the property expr is returned, but it is invalid, so the error
11386         will be flagged during the resolve process. 
11387
11388         * class.cs: Remove InheritablePropertySignatureCompare from the
11389         class, as we no longer depend on the property signature to compute
11390         whether it is possible to implement a method or not.
11391
11392         The reason is that calling PropertyInfo.GetGetMethod will return
11393         null (in .NET, in Mono it works, and we should change this), in
11394         cases where the Get Method does not exist in that particular
11395         class.
11396
11397         So this code:
11398
11399         class X { public virtual int A { get { return 1; } } }
11400         class Y : X { }
11401         class Z : Y { public override int A { get { return 2; } } }
11402
11403         Would fail in Z because the parent (Y) would not have the property
11404         defined.  So we avoid this completely now (because the alternative
11405         fix was ugly and slow), and we now depend exclusively on the
11406         method names.
11407
11408         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11409         reference method, instead of using the property.
11410
11411         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11412         routines are gone now.
11413
11414         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11415         names, they were incorrectly named.
11416
11417         * cs-tokenizer.cs: Return are more gentle token on failure. 
11418
11419         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11420         had an out-of-sync index variable, which caused it to remove from
11421         the list of pending methods the wrong method sometimes.
11422
11423 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11424
11425         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11426         CanWrite, because those refer to this particular instance of the
11427         property, and do not take into account the fact that we can
11428         override single members of a property.
11429
11430         Constructor requires an EmitContext.  The resolution process does
11431         not happen here, but we need to compute the accessors before,
11432         because the resolution does not always happen for properties.
11433
11434         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11435         subclass, before we did not update this flag, but we did update
11436         bindingflags. 
11437
11438         (GetAccessors): Drop this routine, as it did not work in the
11439         presence of partially overwritten set/get methods. 
11440
11441         Notice that this broke the cs1540 detection, but that will require
11442         more thinking. 
11443
11444 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11445
11446         * class.cs:
11447         * codegen.cs:
11448         * driver.cs: issue a warning instead of an error if we don't support
11449         debugging for the platform. Also ignore a couple of errors that may
11450         arise when trying to write the symbols. Undo my previous patch.
11451
11452 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11453
11454         * driver.cs: ignore /debug switch except for Unix platforms.
11455
11456 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11457
11458         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11459
11460 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11461
11462         * driver.cs: Do not make mcs-debug conditional, so we do not break
11463         builds that use it.
11464
11465         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11466         review this patch.  But basically after all the children variables
11467         have been merged, the value of "Breaks" was not being set to
11468         new_breaks for Switch blocks.  I think that it should be set after
11469         it has executed.  Currently I set this to the value of new_breaks,
11470         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11471         conservative, but I do not understand this code very well.
11472
11473         I did not break anything in the build, so that is good ;-)
11474
11475         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11476
11477 2002-10-20  Mark Crichton  <crichton@gimp.org>
11478
11479         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11480
11481 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11482
11483         * cfold.cs: Fixed compile blocker.
11484
11485 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11486
11487         * driver.cs: I was chekcing the key, not the file.
11488
11489 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11490
11491         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11492         message that we were generating - we just need to silently return
11493         a null.
11494
11495 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11496
11497         * class.cs (Event.Define): Change my previous commit, as this
11498         breaks the debugger.  This is a temporary hack, as it seems like
11499         the compiler is generating events incorrectly to begin with.
11500
11501         * expression.cs (Binary.ResolveOperator): Added support for 
11502         "U operator - (E x, E y)"
11503
11504         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11505         y)".
11506
11507         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11508         init-only variables, but this path did not take into account that
11509         there might be also instance readonly variables.  Correct this
11510         problem. 
11511
11512         This fixes bug 32253
11513
11514         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11515         delegates as well.
11516
11517         * driver.cs: Change the extension for modules to `netmodule'
11518
11519         * cs-parser.jay: Improved slightly the location tracking for
11520         the debugger symbols.
11521
11522         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11523         modifiers that were specified instead of the hardcoded value
11524         (FamAndAssem).  This was basically ignoring the static modifier,
11525         and others.  Fixes 32429.
11526
11527         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11528         fixed a bug in the process (32476)
11529
11530         * expression.cs (ArrayAccess.EmitAssign): Patch from
11531         hwang_rob@yahoo.ca that fixes bug 31834.3
11532
11533 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11534
11535         * driver.cs: Make the module extension .netmodule.
11536
11537 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11538
11539         * driver.cs: Report an error if the resource file is not found
11540         instead of crashing.
11541
11542         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11543         false, like Emit does.
11544
11545 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11546
11547         * typemanager.cs: Remove unused private member.  Also reported mcs
11548         bug to report this as a warning like csc.
11549
11550 2002-10-15  Martin Baulig  <martin@gnome.org>
11551
11552         * statement.cs (Statement.Emit): Made this a virtual method; emits
11553         the line number info and calls DoEmit().
11554         (Statement.DoEmit): New protected abstract method, formerly knows
11555         as Statement.Emit().
11556
11557         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11558
11559 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11560
11561         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11562         have fixed a remaining problem: not every AddXXXX was adding a
11563         fully qualified name.  
11564
11565         Now everyone registers a fully qualified name in the DeclSpace as
11566         being defined instead of the partial name.  
11567
11568         Downsides: we are slower than we need to be due to the excess
11569         copies and the names being registered this way.  
11570
11571         The reason for this is that we currently depend (on the corlib
11572         bootstrap for instance) that types are fully qualified, because
11573         we dump all the types in the namespace, and we should really have
11574         types inserted into the proper namespace, so we can only store the
11575         basenames in the defined_names array.
11576
11577 2002-10-10  Martin Baulig  <martin@gnome.org>
11578
11579         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11580         from bug #31834, see the bug report for a testcase which is
11581         miscompiled.
11582
11583 2002-10-10  Martin Baulig  <martin@gnome.org>
11584
11585         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11586         flow analysis code for this.
11587
11588         * statement.cs (Do, While, For): Tell the flow analysis code about
11589         infinite loops.
11590         (FlowBranching.UsageVector): Added support for infinite loops.
11591         (Block.Resolve): Moved the dead code elimination here and use flow
11592         analysis to do it.
11593
11594 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11595
11596         * class.cs (Field.Define): Catch cycles on struct type
11597         definitions. 
11598
11599         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11600         fields if the fields are static.  We only need to check instance
11601         fields. 
11602
11603         * expression.cs (As.DoResolve): Test for reference type.
11604
11605         * statement.cs (Using.ResolveExpression): Use
11606         ConvertImplicitRequired, not ConvertImplicit which reports an
11607         error on failture
11608         (Using.ResolveLocalVariableDecls): ditto.
11609
11610         * expression.cs (Binary.ResolveOperator): Report errors in a few
11611         places where we had to.
11612
11613         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11614
11615 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11616
11617         * expression.cs: Use StoreFromPtr instead of extracting the type
11618         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11619
11620         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11621         an enumeration value to a System.Enum, but System.Enum is not a
11622         value type, but an class type, so we need to box.
11623
11624         (Expression.ConvertExplicit): One codepath could return
11625         errors but not flag them.  Fix this.  Fixes #31853
11626
11627         * parameter.cs (Resolve): Do not allow void as a parameter type.
11628
11629 2002-10-06  Martin Baulig  <martin@gnome.org>
11630
11631         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11632         if it's a class type and not a struct.  Fixes #31815.
11633
11634 2002-10-06  Martin Baulig  <martin@gnome.org>
11635
11636         * statement.cs: Reworked the flow analysis code a bit to make it
11637         usable for dead code elimination.
11638
11639 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11640
11641         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11642
11643 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11644
11645         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11646         to fix the test 165, will investigate deeper.
11647
11648 2002-10-04  Martin Baulig  <martin@gnome.org>
11649
11650         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11651         finally blocks actually work.
11652         (Try.Resolve): We don't need to create a sibling for `finally' if
11653         there is no finally block.
11654
11655 2002-10-04  Martin Baulig  <martin@gnome.org>
11656
11657         * class.cs (Constructor.Define): The default accessibility for a
11658         non-default constructor is private, not public.
11659
11660 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11661
11662         * class.cs (Constructor): Make AllowedModifiers public, add
11663         EXTERN.
11664
11665         * cs-parser.jay: Perform the modifiers test here, as the
11666         constructor for the Constructor class usually receives a zero
11667         because of the way we create it (first we create, later we
11668         customize, and we were never checking the modifiers).
11669
11670         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11671         is a version of LookupTypeReflection that includes the type-name
11672         cache.  This can be used as a fast path for functions that know
11673         the fully qualified name and are only calling into *.GetType() to
11674         obtain a composed type.
11675
11676         This is also used by TypeManager.LookupType during its type
11677         composition.
11678
11679         (LookupType): We now also track the real type name, as sometimes
11680         we can get a quey for the real type name from things like
11681         ComposedCast.  This fixes bug 31422.
11682
11683         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11684         complete type fullname, it does not have to go through the type
11685         resolution system to obtain the composed version of the type (for
11686         obtaining arrays or pointers).
11687
11688         (Conditional.Emit): Use the EmitBoolExpression to
11689         generate nicer code, as requested by Paolo.
11690
11691         (ArrayCreation.CheckIndices): Use the patch from
11692         hwang_rob@yahoo.ca to validate the array initializers. 
11693
11694 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11695
11696         * class.cs (ConstructorInitializer.Emit): simplify code by using
11697         Invocation.EmitCall, and at the same time, fix the bugs in calling
11698         parent constructors that took variable arguments. 
11699
11700         * ecore.cs (Expression.ConvertNumericExplicit,
11701         Expression.ImplicitNumericConversion): Remove the code that
11702         manually wrapped decimal (InternalTypeConstructor call is now gone
11703         as well).
11704
11705         * expression.cs (Cast.TryReduce): Also handle decimal types when
11706         trying to perform a constant fold on the type.
11707
11708         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11709
11710         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11711         that only turned off an error report, and did nothing else. 
11712
11713 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11714
11715         * driver.cs: Handle and ignore /fullpaths
11716
11717 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11718
11719         * expression.cs (Binary.ResolveOperator): Catch the case where
11720         DoNumericPromotions returns true, 
11721
11722         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11723
11724 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11725
11726         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11727         report error 70.
11728
11729 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11730
11731         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11732         conversion exists, but it is also required that the conversion be
11733         performed.  This manifested in "(Type64Enum) 2".  
11734
11735         * class.cs (TypeManager.AddMethod): The fix is not to change
11736         AddEnum, because that one was using a fully qualified name (every
11737         DeclSpace derivative does), but to change the AddMethod routine
11738         that was using an un-namespaced name.  This now correctly reports
11739         the duplicated name.
11740
11741         Revert patch until I can properly fix it.  The issue
11742         is that we have a shared Type space across all namespaces
11743         currently, which is wrong.
11744
11745         Options include making the Namespace a DeclSpace, and merge
11746         current_namespace/current_container in the parser.
11747
11748 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11749
11750         * cs-parser.jay: Improve error reporting when we get a different
11751         kind of expression in local_variable_type and
11752         local_variable_pointer_type. 
11753
11754         Propagate this to avoid missleading errors being reported.
11755
11756         * ecore.cs (ImplicitReferenceConversion): treat
11757         TypeManager.value_type as a target just like object_type.   As
11758         code like this:
11759
11760         ValueType v = 1;
11761
11762         Is valid, and needs to result in the int 1 being boxed before it
11763         is assigned to the value type v.
11764
11765         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11766         to validate the enumeration name.
11767
11768         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11769         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11770         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11771
11772         * ecore.cs (TryImplicitIntConversion): When doing an
11773         implicit-enumeration-conversion, check if the type is 64-bits and
11774         perform a conversion before passing to EnumConstant.
11775
11776 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11777
11778         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11779         report ambiguous type references.  Unlike the MS version, we
11780         report what the ambiguity is.   Innovation at work ;-)
11781
11782         (DeclSpace.FindType): Require a location argument to
11783         display when we display an ambiguous error.
11784
11785         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11786
11787         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11788
11789         * expression.cs (EmitDynamicInitializers): Apply patch from
11790         hwang_rob@yahoo.ca that fixes the order in which we emit our
11791         initializers. 
11792
11793 2002-09-21  Martin Baulig  <martin@gnome.org>
11794
11795         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11796         delegate takes no arguments.
11797
11798 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11799
11800         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11801         from integers.
11802
11803         * expression.cs: Extract the underlying type.
11804
11805         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11806
11807         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11808
11809 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11810
11811         * class.cs (TypeContainer.DefineType): We can not use the nice
11812         PackingSize with the size set to 1 DefineType method, because it
11813         will not allow us to define the interfaces that the struct
11814         implements.
11815
11816         This completes the fixing of bug 27287
11817
11818         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11819         means also structs.  This fixes part of the problem. 
11820         (Expresion.ImplicitReferenceConversionExists): ditto.
11821
11822         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11823         error if there were no errors reported during the type lookup
11824         process, to avoid duplicates or redundant errors.  Without this
11825         you would get an ambiguous errors plus a type not found.  We have
11826         beaten the user enough with the first error.  
11827
11828         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11829         reference. 
11830
11831         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11832         during the resolution process, stop the lookup, this avoids
11833         repeated error reports (same error twice).
11834
11835         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11836
11837         * typemanager.cs (LookupType): Redo the type lookup code to match
11838         the needs of System.Reflection.  
11839
11840         The issue is that System.Reflection requires references to nested
11841         types to begin with a "+" sign instead of a dot.  So toplevel
11842         types look like: "NameSpace.TopLevelClass", and nested ones look
11843         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11844         levels. 
11845
11846 2002-09-19  Martin Baulig  <martin@gnome.org>
11847
11848         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11849         says that a method always returns or always throws an exception,
11850         don't report the CS0161.
11851
11852         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11853         set `Returns = new_returns'.
11854
11855 2002-09-19  Martin Baulig  <martin@gnome.org>
11856
11857         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11858         to an enum constant, check for a CS0176.
11859
11860 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11861
11862         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11863         for operators that must be in pairs and report errors.
11864
11865         * ecore.cs (SimpleName.DoResolveType): During the initial type
11866         resolution process, when we define types recursively, we must
11867         check first for types in our current scope before we perform
11868         lookups in the enclosing scopes.
11869
11870         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11871
11872         (Invocation.VerifyArgumentsCompat): Call
11873         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11874         I thought we were supposed to always call this, but there are a
11875         few places in the code where we dont do it.
11876
11877 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11878
11879         * driver.cs: Add support in -linkres and -resource to specify the
11880         name of the identifier.
11881
11882 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11883
11884         * ecore.cs (StandardConversionExists): Sync with the conversion
11885         code: allow anything-* to void* conversions.
11886
11887         (FindMostSpecificSource): Use an Expression argument
11888         instead of a Type, because we might be handed over a Literal which
11889         gets a few more implicit conversions that plain types do not.  So
11890         this information was being lost.
11891
11892         Also, we drop the temporary type-holder expression when not
11893         required.
11894
11895 2002-09-17  Martin Baulig  <martin@gnome.org>
11896
11897         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11898         this is an explicit interface implementation.
11899
11900 2002-09-17  Martin Baulig  <martin@gnome.org>
11901
11902         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11903         different `IndexerName' attributes.
11904
11905         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11906         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11907         virtual CommonResolve().
11908
11909 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11910
11911         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11912         and convert that to the UnderlyingType.
11913
11914         * statement.cs (Foreach.Resolve): Indexers are just like variables
11915         or PropertyAccesses.
11916
11917         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11918         inside quoted strings, we were not doing this before.
11919
11920 2002-09-16  Martin Baulig  <martin@gnome.org>
11921
11922         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11923         resolve it.  This is needed for the definite assignment check of the
11924         instance expression, fixes bug #29846.
11925         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11926
11927 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11928
11929         * parameter.cs: Fix compile error.  Cannot reference static member
11930         from an instance object.  Is this an mcs bug?
11931
11932 2002-09-14  Martin Baulig  <martin@gnome.org>
11933
11934         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11935         multiple times.  Fixes bug #30295, added test-166.cs.
11936
11937 2002-09-14  Martin Baulig  <martin@gnome.org>
11938
11939         * statement.cs (Block.Emit): Don't emit unreachable code.
11940         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11941         `break' statements.
11942         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11943
11944 2002-09-14  Martin Baulig  <martin@gnome.org>
11945
11946         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11947         is set.
11948
11949 2002-09-14  Martin Baulig  <martin@gnome.org>
11950
11951         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11952         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11953         be false on the ms runtime.
11954
11955 2002-09-13  Martin Baulig  <martin@gnome.org>
11956
11957         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11958         the CS0038 error message.
11959
11960 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11961
11962         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11963         constant inside, return it.
11964
11965 2002-09-12  Martin Baulig  <martin@gnome.org>
11966
11967         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11968         implicit conversion can be done between enum types.
11969
11970         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11971         check whether an implicit conversion to the current enum's UnderlyingType
11972         exists and report an error if not.
11973
11974         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11975         without debugging support.
11976
11977         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11978         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11979
11980 2002-09-12  Martin Baulig  <martin@gnome.org>
11981
11982         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11983
11984         * ecore.cs (IMemberExpr.DeclaringType): New property.
11985         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11986         nonstatic member of an outer type (CS0038).
11987
11988 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11989
11990         * driver.cs: Activate the using-error detector at warning level
11991         4 (at least for MS-compatible APIs).
11992
11993         * namespace.cs (VerifyUsing): Small buglett fix.
11994
11995         * pending.cs (PendingImplementation): pass the container pointer. 
11996
11997         * interface.cs (GetMethods): Allow for recursive definition.  Long
11998         term, I would like to move every type to support recursive
11999         definitions, not the current ordering mechanism that we have right
12000         now.
12001
12002         The situation is this: Attributes are handled before interfaces,
12003         so we can apply attributes to interfaces.  But some attributes
12004         implement interfaces, we will now handle the simple cases
12005         (recursive definitions will just get an error).  
12006
12007         * parameter.cs: Only invalidate types at the end if we fail to
12008         lookup all types.  
12009
12010 2002-09-09  Martin Baulig  <martin@gnome.org>
12011
12012         * ecore.cs (PropertyExpr.Emit): Also check for
12013         TypeManager.system_int_array_get_length so this'll also work when
12014         compiling corlib.  Fixes #30003.
12015
12016 2002-09-09  Martin Baulig  <martin@gnome.org>
12017
12018         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12019         and throw an exception if we can't get the type's size.  Fixed #30040,
12020         added test-165.cs.
12021
12022 2002-09-09  Martin Baulig  <martin@gnome.org>
12023
12024         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12025
12026         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12027         context.  Fixes bug #30027.
12028
12029         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12030         virtual functions.  Fixes bug #30043, added test-164.cs.
12031
12032 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12033
12034         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12035
12036 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12037
12038         * driver.cs: Use an object to get the windows codepage since it's not a
12039         static property.
12040
12041 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12042
12043         * statement.cs (For.Emit): for infinite loops (test == null)
12044         return whether there is a break inside, not always "true".
12045
12046         * namespace.cs (UsingEntry): New struct to hold the name of the
12047         using definition, the location where it is defined, and whether it
12048         has been used in a successful type lookup.
12049
12050         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12051         strings.
12052
12053         * decl.cs: ditto.
12054
12055 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12056
12057         * attribute.cs : Fix incorrect code which relied on catching
12058         a NullReferenceException to detect a null being passed in
12059         where an object was expected.
12060
12061 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12062
12063         * statement.cs (Try): flag the catch variable as assigned
12064
12065         * expression.cs (Cast): Simplified by using ResolveType instead of
12066         manually resolving.
12067
12068         * statement.cs (Catch): Fix bug by using ResolveType.
12069
12070 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12071
12072         * expression.cs (BetterConversion): Special case for when we have
12073         a NullLiteral as the argument and we have to choose between string
12074         and object types - we choose string the way csc does.
12075
12076         * attribute.cs (Attribute.Resolve): Catch the
12077         NullReferenceException and report error #182 since the Mono
12078         runtime no more has the bug and having this exception raised means
12079         we tried to select a constructor which takes an object and is
12080         passed a null.
12081
12082 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12083
12084         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12085         message (1502, 1503) when we can't locate a method after overload
12086         resolution. This is much more informative and closes the bug
12087         Miguel reported.
12088
12089         * interface.cs (PopulateMethod): Return if there are no argument
12090         types. Fixes a NullReferenceException bug.
12091
12092         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12093         expressions too. Previously we were checking only in one place for
12094         positional arguments leaving out named arguments.
12095
12096         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12097         type to the enum type is not allowed. Remove code corresponding to
12098         that.
12099
12100         (ConvertNumericExplicit): Allow explicit conversions from
12101         the underlying type to enum type. This precisely follows the spec
12102         and closes a bug filed by Gonzalo.
12103
12104 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12105
12106         * compiler.csproj:
12107         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12108
12109 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12110
12111         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12112         it was important that we stored the right value after the
12113         reduction in `converted'.
12114
12115 2002-09-04  Martin Baulig  <martin@gnome.org>
12116
12117         * location.cs (Location.SymbolDocument): Use full pathnames for the
12118         source files.
12119
12120 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12121
12122         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12123         of the expression resolve mechanism, because that will catch the
12124         SimpleName error failures.
12125
12126         (Conditional): If we can not resolve the
12127         expression, return, do not crash.
12128
12129 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12130
12131         * cs-tokenizer.cs:
12132         (location): display token name instead of its number.
12133
12134 2002-08-28  Martin Baulig  <martin@gnome.org>
12135
12136         * expression.cs (Binary.ResolveOperator): Don't silently return
12137         but return an error if an operator cannot be applied between two
12138         enum types.
12139
12140 2002-08-28  Martin Baulig  <martin@gnome.org>
12141
12142         * class.cs (Constructor.Define): Set the permission attributes
12143         correctly instead of making all constructors public.
12144
12145 2002-08-28  Martin Baulig  <martin@gnome.org>
12146
12147         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12148         for private members before reporting a CS0103; if we find anything,
12149         it's a CS0122.
12150
12151 2002-08-28  Martin Baulig  <martin@gnome.org>
12152
12153         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12154         to check whether `closure_start_type == closure_invocation_type',
12155         we also need to check whether `m.DeclaringType == closure_invocation_type'
12156         before bypassing the permission checks.  We might be accessing
12157         protected/private members from the base class.
12158         (TypeManager.RealMemberLookup): Only set private_ok if private
12159         members were requested via BindingFlags.NonPublic.
12160
12161         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12162
12163         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12164         MethodGroupExpr.IsExplicitImpl if appropriate.
12165         (Invocation.DoResolve): Don't report the CS0120 for explicit
12166         interface implementations.
12167
12168 2002-08-27  Martin Baulig  <martin@gnome.org>
12169
12170         * expression.cs (Invocation.DoResolve): If this is a static
12171         method and we don't have an InstanceExpression, we must report
12172         a CS0120.
12173
12174 2002-08-25  Martin Baulig  <martin@gnome.org>
12175
12176         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12177         `==' between a valuetype and an object.
12178
12179 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12180
12181         * ecore.cs (TypeExpr): Provide a ToString method.
12182
12183 2002-08-24  Martin Baulig  <martin@gnome.org>
12184
12185         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12186         now called proggie.dbg and it's a binary file.
12187
12188 2002-08-23  Martin Baulig  <martin@gnome.org>
12189
12190         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12191
12192 2002-08-23  Martin Baulig  <martin@gnome.org>
12193
12194         * struct.cs (MyStructInfo.ctor): Make this work with empty
12195         structs; it's not allowed to use foreach() on null.
12196
12197 2002-08-23  Martin Baulig  <martin@gnome.org>
12198
12199         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12200         writer the full pathname of the generated assembly.
12201
12202 2002-08-23  Martin Baulig  <martin@gnome.org>
12203
12204         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12205         A `finally' block never returns or breaks; improved handling of
12206         unreachable code.
12207
12208 2002-08-23  Martin Baulig  <martin@gnome.org>
12209
12210         * statement.cs (Throw.Resolve): Allow `throw null'.
12211
12212 2002-08-23  Martin Baulig  <martin@gnome.org>
12213
12214         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12215         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12216         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12217         MemberLookup would return a wrong event if this is an explicit
12218         interface implementation and the class has an event with the same
12219         name.
12220
12221 2002-08-23  Martin Baulig  <martin@gnome.org>
12222
12223         * statement.cs (Block.AddChildVariableNames): New public method.
12224         (Block.AddChildVariableName): Likewise.
12225         (Block.IsVariableNameUsedInChildBlock): Likewise.
12226         (Block.AddVariable): Check whether a variable name has already
12227         been used in a child block.
12228
12229         * cs-parser.jay (declare_local_variables): Mark all variable names
12230         from the current block as being used in a child block in the
12231         implicit block.
12232
12233 2002-08-23  Martin Baulig  <martin@gnome.org>
12234
12235         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12236         find the symbol writer.
12237
12238         * driver.cs: csc also allows the arguments to /define being
12239         separated by commas, not only by semicolons.
12240
12241 2002-08-23  Martin Baulig  <martin@gnome.org>
12242
12243         * interface.cs (Interface.GetMembers): Added static check for events.
12244
12245 2002-08-15  Martin Baulig  <martin@gnome.org>
12246
12247         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12248         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12249
12250         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12251         why the MethodData.EmitDestructor() change was necessary.
12252
12253 2002-08-20  Martin Baulig  <martin@gnome.org>
12254
12255         * class.cs (TypeContainer.FindMembers): Added static check for events.
12256
12257         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12258
12259         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12260         use Type.GetEvents(), not Type.FindMembers().
12261
12262 2002-08-20  Martin Baulig  <martin@gnome.org>
12263
12264         * decl.cs (MemberCache): Added a special method cache which will
12265         be used for method-only searched.  This ensures that a method
12266         search will return a MethodInfo with the correct ReflectedType for
12267         inherited methods.      
12268
12269 2002-08-20  Martin Baulig  <martin@gnome.org>
12270
12271         * decl.cs (DeclSpace.FindMembers): Made this public.
12272
12273 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12274
12275         * delegate.cs: fixed build on windows.
12276         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12277
12278 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12279
12280         * ecore.cs (StandardConversionExists): Return a false
12281         if we are trying to convert the void type to anything else
12282         since that is not allowed.
12283
12284         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12285         we flag error 70 in the event an event is trying to be accessed
12286         directly from outside the declaring type.
12287
12288 2002-08-20  Martin Baulig  <martin@gnome.org>
12289
12290         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12291         MemberCache from typemanager.cs to decl.cs.
12292
12293 2002-08-19  Martin Baulig  <martin@gnome.org>
12294
12295         * class.cs (TypeContainer): Implement IMemberContainer.
12296         (TypeContainer.DefineMembers): Create the MemberCache.
12297         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12298         return public members if BindingFlags.Public was given, check
12299         whether members are static.
12300
12301 2002-08-16  Martin Baulig  <martin@gnome.org>
12302
12303         * decl.cs (DeclSpace.Define): Splitted this in Define and
12304         DefineMembers.  DefineMembers is called first and initializes the
12305         MemberCache.
12306
12307         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12308         DefineMembers() on all our DeclSpaces.
12309
12310         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12311         but call DefineMembers() on all nested interfaces.  We call their
12312         Define() in our new Define() function.
12313
12314         * interface.cs (Interface): Implement IMemberContainer.
12315         (Interface.Define): Moved all code except the attribute stuf to
12316         DefineMembers().
12317         (Interface.DefineMembers): Initialize the member cache.
12318
12319         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12320         need this anymore since we can use MemberCache.FindMembers directly.
12321
12322 2002-08-19  Martin Baulig  <martin@gnome.org>
12323
12324         * typemanager.cs (MemberCache): When creating the cache for an
12325         interface type, add all inherited members.
12326         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12327         to `out bool used_cache' and documented it.
12328         (TypeManager.MemberLookup): If we already used the cache in the first
12329         iteration, we don't need to do the interfaces check.
12330
12331 2002-08-19  Martin Baulig  <martin@gnome.org>
12332
12333         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12334         here from IMemberFinder and don't implement this interface anymore.
12335         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12336
12337         * typemanager.cs (IMemberFinder): This interface is now only used by
12338         classes which actually support the member cache.
12339         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12340         since we only put DeclSpaces into this Hashtable.
12341         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12342         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12343
12344 2002-08-16  Martin Baulig  <martin@gnome.org>
12345
12346         * typemanager.cs (ICachingMemberFinder): Removed.
12347         (IMemberFinder.MemberCache): New property.
12348         (TypeManager.FindMembers): Merged this with RealFindMembers().
12349         This function will never be called from TypeManager.MemberLookup()
12350         so we can't use the cache here, just the IMemberFinder.
12351         (TypeManager.MemberLookup_FindMembers): Check whether the
12352         IMemberFinder has a MemberCache and call the cache's FindMembers
12353         function.
12354         (MemberCache): Rewrote larger parts of this yet another time and
12355         cleaned it up a bit.
12356
12357 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12358
12359         * driver.cs (LoadArgs): Support quoting.
12360
12361         (Usage): Show the CSC-like command line arguments.
12362
12363         Improved a few error messages.
12364
12365 2002-08-15  Martin Baulig  <martin@gnome.org>
12366
12367         * typemanager.cs (IMemberContainer.Type): New property.
12368         (IMemberContainer.IsInterface): New property.
12369
12370         The following changes are conditional to BROKEN_RUNTIME, which is
12371         defined at the top of the file.
12372
12373         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12374         class'es members, but add all members from TypeHandle.ObjectType
12375         if we're an interface.
12376         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12377         is the current type.
12378         (MemberCache.CacheEntry.Container): Removed this field.
12379         (TypeHandle.GetMembers): Include inherited members.
12380
12381 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12382
12383         * typemanager.cs: fixed compilation and added a comment on a field that
12384         is never used.
12385
12386 2002-08-15  Martin Baulig  <martin@gnome.org>
12387
12388         * class.cs (ConstructorInitializer.Resolve): In the
12389         Expression.MemberLookup call, use the queried_type as
12390         invocation_type.
12391
12392         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12393         declared' attribute, it's always true.
12394         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12395         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12396         temporary wrapper for FindMembers which tells MemberLookup whether
12397         members from the base classes are included in the return value.
12398         This will go away soon.
12399         (TypeManager.MemberLookup): Use this temporary hack here; once the
12400         new MemberCache is completed, we don't need to do the DeclaredOnly
12401         looping here anymore since the MemberCache will take care of this.
12402         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12403         (MemberCache): When creating the MemberCache for a class, get
12404         members from the current class and all its base classes.
12405         (MemberCache.CacheEntry.Container): New field.  This is a
12406         temporary hack until the Mono runtime is fixed to distinguish
12407         between ReflectedType and DeclaringType.  It allows us to use MCS
12408         with both the MS runtime and the unfixed Mono runtime without
12409         problems and without accecting performance.
12410         (MemberCache.SearchMembers): The DeclaredOnly looping from
12411         TypeManager.MemberLookup is now done here.      
12412
12413 2002-08-14  Martin Baulig  <martin@gnome.org>
12414
12415         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12416         Type.GetFields on dynamic types but get the fields from the
12417         corresponding TypeContainer.
12418         (MyStructInfo.GetStructInfo): Added check for enum types.
12419
12420         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12421         (MemberList.SyncRoot): Implemented.
12422         (TypeManager.FilterWithClosure): No need to check permissions if
12423         closure_start_type == closure_invocation_type, don't crash if
12424         closure_invocation_type is null.
12425
12426 2002-08-13  Martin Baulig  <martin@gnome.org>
12427
12428         Rewrote TypeContainer.FindMembers to use a member cache.  This
12429         gives us a speed increase of about 35% for the self-hosting MCS
12430         build and of about 15-20% for the class libs (both on GNU/Linux).
12431
12432         * report.cs (Timer): New class to get enhanced profiling.  This
12433         whole class is "TIMER" conditional since it remarkably slows down
12434         compilation speed.
12435
12436         * class.cs (MemberList): New class.  This is an IList wrapper
12437         which we're now using instead of passing MemberInfo[]'s around to
12438         avoid copying this array unnecessarily.
12439         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12440         (ICachingMemberFinder, IMemberContainer): New interface.
12441         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12442         has already been checked, otherwise use it for the name comparision.
12443         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12444         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12445         if possible.  Returns a MemberList, not a MemberInfo [].
12446         (TypeHandle): New class, implements IMemberContainer.  We create
12447         one instance of this class per type, it contains a MemberCache
12448         which is used to do the member lookups.
12449         (MemberCache): New class.  Each instance of this class contains
12450         all members of a type and a name-based hash table.
12451         (MemberCache.FindMembers): This is our new member lookup
12452         function.  First, it looks up all members of the requested name in
12453         the hash table.  Then, it walks this list and sorts out all
12454         applicable members and returns them.
12455
12456 2002-08-13  Martin Baulig  <martin@gnome.org>
12457
12458         In addition to a nice code cleanup, this gives us a performance
12459         increase of about 1.4% on GNU/Linux - not much, but it's already
12460         half a second for the self-hosting MCS compilation.
12461
12462         * typemanager.cs (IMemberFinder): New interface.  It is used by
12463         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12464         Enum, Delegate or Interface.
12465         (TypeManager.finder_to_member_finder): New PtrHashtable.
12466         (TypeManager.finder_to_container): Removed.
12467         (TypeManager.finder_to_delegate): Removed.
12468         (TypeManager.finder_to_interface): Removed.
12469         (TypeManager.finder_to_enum): Removed.
12470
12471         * interface.cs (Interface): Implement IMemberFinder.
12472
12473         * delegate.cs (Delegate): Implement IMemberFinder.
12474
12475         * enum.cs (Enum): Implement IMemberFinder.
12476
12477         * class.cs (TypeContainer): Implement IMemberFinder.
12478
12479 2002-08-12  Martin Baulig  <martin@gnome.org>
12480
12481         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12482
12483 2002-08-12  Martin Baulig  <martin@gnome.org>
12484
12485         * ecore.cs (ITypeExpression): New interface for expressions which
12486         resolve to a type.
12487         (TypeExpression): Renamed to TypeLookupExpression.
12488         (Expression.DoResolve): If we're doing a types-only lookup, the
12489         expression must implement the ITypeExpression interface and we
12490         call DoResolveType() on it.
12491         (SimpleName): Implement the new ITypeExpression interface.
12492         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12493         hack, the situation that we're only looking up types can't happen
12494         anymore when this method is called.  Moved the type lookup code to
12495         DoResolveType() and call it.
12496         (SimpleName.DoResolveType): This ITypeExpression interface method
12497         is now doing the types-only lookup.
12498         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12499         (ResolveFlags): Added MaskExprClass.
12500
12501         * expression.cs (MemberAccess): Implement the ITypeExpression
12502         interface.
12503         (MemberAccess.DoResolve): Added support for a types-only lookup
12504         when we're called via ITypeExpression.DoResolveType().
12505         (ComposedCast): Implement the ITypeExpression interface.
12506
12507         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12508         Expression.Resolve() with ResolveFlags.Type instead.
12509
12510 2002-08-12  Martin Baulig  <martin@gnome.org>
12511
12512         * interface.cs (Interface.Define): Apply attributes.
12513
12514         * attribute.cs (Attribute.ApplyAttributes): Added support for
12515         interface attributes.
12516
12517 2002-08-11  Martin Baulig  <martin@gnome.org>
12518
12519         * statement.cs (Block.Emit): Only check the "this" variable if we
12520         do not always throw an exception.
12521
12522         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12523         whether the property has a set accessor.
12524
12525 2002-08-11  Martin Baulig  <martin@gnome.org>
12526
12527         Added control flow analysis support for structs.
12528
12529         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12530         with control flow analysis turned off.
12531         (IVariable): New interface.
12532         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12533         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12534         (FieldExpr.DoResolve): Resolve the instance expression with flow
12535         analysis turned off and do the definite assignment check after the
12536         resolving when we know what the expression will resolve to.
12537
12538         * expression.cs (LocalVariableReference, ParameterReference):
12539         Implement the new IVariable interface, only call the flow analysis
12540         code if ec.DoFlowAnalysis is true.
12541         (This): Added constructor which takes a Block argument.  Implement
12542         the new IVariable interface.
12543         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12544         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12545         This does the definite assignment checks for struct members.
12546
12547         * class.cs (Constructor.Emit): If this is a non-static `struct'
12548         constructor which doesn't have any initializer, call
12549         Block.AddThisVariable() to tell the flow analysis code that all
12550         struct elements must be initialized before control returns from
12551         the constructor.
12552
12553         * statement.cs (MyStructInfo): New public class.
12554         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12555         argument to this indexer.  If non-zero, check an individual struct
12556         member, not the whole struct.
12557         (FlowBranching.CheckOutParameters): Check struct members.
12558         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12559         overloaded versions of these methods which take an additional
12560         `int field_idx' argument to check struct members.
12561         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12562         overloaded versions of these methods which take an additional
12563         `string field_name' argument to check struct member.s
12564         (VariableInfo): Implement the IVariable interface.
12565         (VariableInfo.StructInfo): New public property.  Returns the
12566         MyStructInfo instance of the variable if it's a struct or null.
12567         (Block.AddThisVariable): New public method.  This is called from
12568         Constructor.Emit() for non-static `struct' constructor which do
12569         not have any initializer.  It creates a special variable for the
12570         "this" instance variable which will be checked by the flow
12571         analysis code to ensure that all of the struct's fields are
12572         initialized before control returns from the constructor.
12573         (UsageVector): Added support for struct members.  If a
12574         variable/parameter is a struct with N members, we reserve a slot
12575         in the usage vector for each member.  A struct is considered fully
12576         initialized if either the struct itself (slot 0) or all its
12577         members are initialized.
12578
12579 2002-08-08  Martin Baulig  <martin@gnome.org>
12580
12581         * driver.cs (Driver.MainDriver): Only report an error CS5001
12582         if there were no compilation errors.
12583
12584         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12585         `UnsafeContext' property to determine whether the parent is in
12586         unsafe context rather than checking the parent's ModFlags:
12587         classes nested in an unsafe class are unsafe as well.
12588
12589 2002-08-08  Martin Baulig  <martin@gnome.org>
12590
12591         * statement.cs (UsageVector.MergeChildren): Distinguish between
12592         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12593         we return.  Added test17() and test18() to test-154.cs.
12594
12595 2002-08-08  Martin Baulig  <martin@gnome.org>
12596
12597         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12598         Family access, make sure the invoking type isn't a subclass of the
12599         queried type (that'd be a CS1540).
12600
12601         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12602         this method which takes an additional `Type invocation_type'.
12603
12604         * expression.cs (BaseAccess.DoResolve): Use the base type as
12605         invocation and query type.
12606         (MemberAccess.DoResolve): If the lookup failed and we're about to
12607         report a CS0122, try a lookup with the ec.ContainerType - if this
12608         succeeds, we must report a CS1540.
12609
12610 2002-08-08  Martin Baulig  <martin@gnome.org>
12611
12612         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12613         (MethodGroupExpr): Implement the IMemberExpr interface.
12614
12615         * expression (MemberAccess.ResolveMemberAccess): No need to have
12616         any special code for MethodGroupExprs anymore, they're now
12617         IMemberExprs.   
12618
12619 2002-08-08  Martin Baulig  <martin@gnome.org>
12620
12621         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12622         Family, FamANDAssem and FamORAssem permissions.
12623         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12624
12625 2002-08-08  Martin Baulig  <martin@gnome.org>
12626
12627         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12628         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12629         or loop block.
12630
12631 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12632
12633         * driver.cs: implemented /resource option to embed managed resources.
12634
12635 2002-08-07  Martin Baulig  <martin@gnome.org>
12636
12637         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12638         (FieldBase.HasFieldInitializer): New public property.
12639         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12640         returns the field initializer and makes sure it is only resolved once.
12641         (TypeContainer.EmitFieldInitializers): Call
12642         FieldBase.GetInitializerExpression to get the initializer, this ensures
12643         that it isn't resolved multiple times.
12644
12645         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12646         the resolving process (SimpleName/MemberLookup) that we're currently
12647         emitting a field initializer (which must not access any instance members,
12648         this is an error CS0236).
12649
12650         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12651         argument, if the `IsFieldInitializer' flag is set, we must report and
12652         error CS0236 and not an error CS0120.   
12653
12654 2002-08-07  Martin Baulig  <martin@gnome.org>
12655
12656         * ecore.cs (IMemberExpr): New public interface.
12657         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12658         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12659         if the expression is an IMemberExpr.
12660
12661         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12662         to be null, implicitly default to `this' if we're non-static in
12663         this case.  Simplified the code a lot by using the new IMemberExpr
12664         interface.  Also fixed bug #28176 here.
12665
12666 2002-08-06  Martin Baulig  <martin@gnome.org>
12667
12668         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12669         ParameterReferences during semantic analysis so that we can do a
12670         type-only search when resolving Cast, TypeOf and SizeOf.
12671         (block): Pass the `current_local_parameters' to the Block's
12672         constructor.
12673
12674         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12675         argument to the constructor.
12676         (ConstructorInitializer.Resolve): Create a temporary implicit
12677         block with the parameters.
12678
12679         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12680         references here if we aren't doing a type-only search.
12681
12682         * statement.cs (Block): Added constructor which takes a
12683         `Parameters parameters' argument.
12684         (Block.Parameters): New public property.
12685
12686         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12687         to `Parameters' and made it public readonly.
12688
12689 2002-08-06  Martin Baulig  <martin@gnome.org>
12690
12691         * ecore.cs (Expression.Warning): Made this public as well.
12692
12693         * report.cs (Report.Debug): Print the contents of collections.
12694
12695 2002-08-06  Martin Baulig  <martin@gnome.org>
12696
12697         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12698         used to tell Resolve() which kinds of expressions it may return.
12699         (Expression.Resolve): Added overloaded version of this method which
12700         takes a `ResolveFlags flags' argument.  This can be used to tell
12701         Resolve() which kinds of expressions it may return.  Reports a
12702         CS0118 on error.
12703         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12704         ResolveFlags.SimpleName.
12705         (Expression.Error118): Added overloaded version of this method which
12706         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12707         which kinds of expressions are allowed.
12708
12709         * expression.cs (Argument.ResolveMethodGroup): New public method.
12710         Resolves an argument, but allows a MethodGroup to be returned.
12711         This is used when invoking a delegate.
12712
12713         * TODO: Updated a bit.
12714
12715 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12716
12717         Fixed compilation with csc.
12718
12719         * ecore.cs: Expression.Error made public. Is this correct? Should
12720         Warning be made public too?
12721
12722         * expression.cs: use ea.Location instead of ea.loc.
12723         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12724
12725 2002-08-06  Martin Baulig  <martin@gnome.org>
12726
12727         * ecore.cs (Expression.loc): Moved the location here instead of
12728         duplicating it in all derived classes.
12729         (Expression.Location): New public property.
12730         (Expression.Error, Expression.Warning): Made them non-static and
12731         removed the location argument.
12732         (Expression.Warning): Added overloaded version which takes an
12733         `int level' argument.
12734         (Expression.Error118): Make this non-static and removed the
12735         expression and location arguments.
12736         (TypeExpr): Added location argument to the constructor.
12737
12738         * expression.cs (StaticCallExpr): Added location argument to
12739         the constructor.
12740         (Indirection, PointerArithmetic): Likewise.
12741         (CheckedExpr, UnCheckedExpr): Likewise.
12742         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12743         (StringPtr): Likewise.
12744
12745
12746 2002-08-05  Martin Baulig  <martin@gnome.org>
12747
12748         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12749
12750         * assign.cs (Assign.DoResolve): Check whether the source
12751         expression is a value or variable.
12752
12753         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12754         while resolving the corresponding blocks.
12755
12756         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12757         an error, don't silently return null.
12758
12759         * statement.cs (Block.AddVariable): Do the error reporting here
12760         and distinguish between CS0128 and CS0136.
12761         (Block.DoResolve): Report all unused labels (warning CS0164).
12762         (LabeledStatement): Pass the location to the constructor.
12763         (LabeledStatement.HasBeenReferenced): New property.
12764         (LabeledStatement.Resolve): Set it to true here.
12765
12766         * statement.cs (Return.Emit): Return success even after reporting
12767         a type mismatch error (CS0126 or CS0127), this is what csc does and
12768         it avoids confusing the users with any consecutive errors.
12769
12770 2002-08-05  Martin Baulig  <martin@gnome.org>
12771
12772         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12773
12774         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12775
12776         * expression.cs (MemberAccess.DoResolve): Silently return if an
12777         error has already been reported.
12778
12779         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12780         error has already been reported.
12781
12782 2002-08-05  Martin Baulig  <martin@gnome.org>
12783
12784         * statement.cs (UsageVector): Only initialize the `parameters'
12785         vector if we actually have any "out" parameters.
12786
12787 2002-08-05  Martin Baulig  <martin@gnome.org>
12788
12789         * expression.cs (Binary.ResolveOperator): When combining delegates,
12790         they must have the same type.
12791
12792 2002-08-05  Martin Baulig  <martin@gnome.org>
12793
12794         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12795         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12796         work with the ms runtime and we also don't need it: if we're a
12797         PropertyBuilder and not in the `indexer_arguments' hash, then we
12798         are a property and not an indexer.
12799
12800         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12801         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12802         since the latter one doesn't work with the ms runtime.
12803
12804 2002-08-03  Martin Baulig  <martin@gnome.org>
12805
12806         Fixed bugs #27998 and #22735.
12807
12808         * class.cs (Method.IsOperator): New public field.
12809         (Method.CheckBase): Report CS0111 if there's already a method
12810         with the same parameters in the current class.  Report CS0508 when
12811         attempting to change the return type of an inherited method.
12812         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12813         and it's not marked abstract or extern.
12814         (PropertyBase): New abstract base class for Property and Indexer.
12815         (PropertyBase.CheckBase): Moved here from Property and made it work
12816         for indexers.
12817         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12818         the same so we can reuse it there.
12819         (Property, Indexer): Derive from PropertyBase.
12820         (MethodSignature.inheritable_property_signature_filter): New delegate
12821         to find properties and indexers.
12822
12823         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12824         argument and improved error reporting.
12825
12826         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12827         EmptyReadOnlyParameters and made it a property.
12828
12829         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12830         version of this method which takes a `PropertyInfo indexer'.
12831         (TypeManager.RegisterIndexer): New method.
12832
12833         * class.cs: Added myself as author of this file :-)
12834
12835 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12836
12837         * class.cs: fixed compilation on windoze.
12838
12839 2002-08-03  Martin Baulig  <martin@gnome.org>
12840
12841         * interface.cs (Interface.GetInterfaceBases): Check whether all
12842         base interfaces are at least as accessible than the current one.
12843
12844         * class.cs (TypeContainer.GetClassBases): Check whether base types
12845         are at least as accessible than the current type.
12846         (TypeContainer.AsAccessible): Implemented and made non-static.
12847         (MemberBase.CheckParameters): Report errors if the accessibility
12848         checks fail.
12849
12850         * delegate.cs (Delegate.Delegate): The default visibility is
12851         internal for top-level types and private for nested types.
12852         (Delegate.Define): Report errors if the accessibility checks fail.
12853
12854         * enum.cs (Enum.Enum): The default visibility is internal for
12855         top-level types and private for nested types.
12856         (Enum.DefineType): Compute the correct visibility.
12857
12858         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12859         function which takes a `bool is_toplevel' instead of a TypeContainer.
12860
12861         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12862         builtin type.
12863
12864 2002-08-02  Martin Baulig  <martin@gnome.org>
12865
12866         * expression.cs (LocalVariableReferenc): Added constructor which
12867         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12868         (LocalVariableReference.IsReadOnly): New property.
12869         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12870         variable is readonly, use our own readonly flag to do this; you can
12871         use the new constructor to get a writable reference to a read-only
12872         variable.
12873
12874         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12875         reference to the local variable.
12876
12877 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12878
12879         * rootcontext.cs (ResolveCore): Also include System.Exception
12880
12881         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12882         we reach an EmptyStatement.
12883
12884         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12885         is also fine.
12886
12887         * expression.cs (Binary.ResolveOperator): Check error result in
12888         two places.
12889
12890         use brtrue/brfalse directly and avoid compares to null.
12891
12892 2002-08-02  Martin Baulig  <martin@gnome.org>
12893
12894         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12895         Fixes bug #28407, added test-155.cs.
12896
12897 2002-08-01  Martin Baulig  <martin@gnome.org>
12898
12899         * class.cs (Event.EmitDefaultMethod): Make this work with static
12900         events.  Fixes #28311, added verify-3.cs.
12901
12902 2002-08-01  Martin Baulig  <martin@gnome.org>
12903
12904         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12905         `is_disposable' fields.
12906         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12907         `hm.is_disposable' if we're using the collection pattern.
12908         (Foreach.EmitCollectionForeach): Use the correct type for the
12909         enumerator's local variable, only emit the try/finally block if
12910         necessary (fixes #27713).
12911
12912 2002-08-01  Martin Baulig  <martin@gnome.org>
12913
12914         * ecore.cs (Expression.report118): Renamed to Error118 and made
12915         it public static.
12916
12917         * statement.cs (Throw.Resolve): Check whether the expression is of
12918         the correct type (CS0118) and whether the type derives from
12919         System.Exception (CS0155).
12920         (Catch.Resolve): New method.  Do the type lookup here and check
12921         whether it derives from System.Exception (CS0155).
12922         (Catch.CatchType, Catch.IsGeneral): New public properties.
12923
12924         * typemanager.cs (TypeManager.exception_type): Added.
12925
12926 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12927
12928         * driver.cs: Updated About function.
12929
12930 2002-07-31  Martin Baulig  <martin@gnome.org>
12931
12932         Implemented Control Flow Analysis.
12933
12934         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12935         (EmitContext.CurrentBranching): Added.
12936         (EmitContext.StartFlowBranching): Added.
12937         (EmitContext.EndFlowBranching): Added.
12938         (EmitContext.KillFlowBranching): Added.
12939         (EmitContext.IsVariableAssigned): Added.
12940         (EmitContext.SetVariableAssigned): Added.
12941         (EmitContext.IsParameterAssigned): Added.
12942         (EmitContext.SetParameterAssigned): Added.
12943         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12944         Added control flow analysis stuff here.
12945
12946         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12947         resolve the expression as lvalue.
12948         (LocalVariableReference.DoResolve): Check whether the variable has
12949         already been assigned.
12950         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12951         the parameter as assigned here.
12952         (ParameterReference.DoResolve): Check whether the parameter has already
12953         been assigned.
12954         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12955         expression as lvalue.
12956
12957         * statement.cs (FlowBranching): New class for the flow analysis code.
12958         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12959         (LabeledStatement.IsDefined): New public property.
12960         (LabeledStatement.AddUsageVector): New public method to tell flow
12961         analyis that the label may be reached via a forward jump.
12962         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12963         flow analysis.
12964         (VariableInfo.Number): New public field.  This is used by flow analysis
12965         to number all locals of a block.
12966         (Block.CountVariables): New public property.  This is the number of
12967         local variables in this block (including the locals from all parent
12968         blocks).
12969         (Block.EmitMeta): Number all the variables.
12970
12971         * statement.cs: Added flow analysis support to all classes.
12972
12973 2002-07-31  Martin Baulig  <martin@gnome.org>
12974
12975         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12976         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12977         then use this argument.
12978
12979         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12980
12981         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12982         use this to specify /define options.
12983
12984 2002-07-29  Martin Baulig  <martin@gnome.org>
12985
12986         * statement.cs (Fixed): Moved all code that does variable lookups
12987         and resolvings from Emit to Resolve.
12988
12989         * statement.cs (For): Moved all code that does variable lookups
12990         and resolvings from Emit to Resolve.
12991
12992         * statement.cs (Using): Moved all code that does variable lookups
12993         and resolvings from Emit to Resolve.
12994
12995 2002-07-29  Martin Baulig  <martin@gnome.org>
12996
12997         * attribute.cs (Attribute.Resolve): Explicitly catch a
12998         System.NullReferenceException when creating the
12999         CustromAttributeBuilder and report a different warning message.
13000
13001 2002-07-29  Martin Baulig  <martin@gnome.org>
13002
13003         * support.cs (ParameterData.ParameterName): Added method to
13004         get the name of a parameter.
13005
13006         * typemanager.cs (TypeManager.IsValueType): New public method.
13007
13008 2002-07-29  Martin Baulig  <martin@gnome.org>
13009
13010         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13011         is a flag which specifies that it's either ref or out.
13012         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13013         the out parameter to `out Parameter.Modifier mod', also set the
13014         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13015
13016         * support.cs (InternalParameters.ParameterModifier): Distinguish
13017         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13018         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13019
13020         * expression.cs (Argument.GetParameterModifier): Distinguish
13021         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13022         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13023
13024 2002-07-29  Martin Baulig  <martin@gnome.org>
13025
13026         * expression.cs (ParameterReference.ParameterReference): Added
13027         `Location loc' argument to the constructor.
13028
13029         * cs-parser.jay: Pass location to ParameterReference.
13030
13031 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13032
13033         * statement.cs (Try): Initialize the location.
13034
13035         * cs-parser.jay: pass location to Try.
13036
13037         * expression.cs (Unary.Reduce): Change the prototype to return
13038         whether a constant fold could be performed or not.  The result is
13039         returned in an out parameters.  In the case of Indirection and
13040         AddressOf, we want to perform the full tests.
13041
13042 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13043
13044         * statement.cs (Statement.Emit): Flag dead code.
13045
13046 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13047
13048         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13049
13050 2002-07-27  Martin Baulig  <martin@gnome.org>
13051
13052         * class.cs (MethodData.Define): Put back call to
13053         TypeManager.AddMethod(), accidentally commented this out.
13054
13055         * report.cs (Debug): New public method to print debugging information,
13056         this is `[Conditional ("DEBUG")]'.
13057
13058 2002-07-26  Martin Baulig  <martin@gnome.org>
13059
13060         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13061         (switch_statement): Push the current_block to the switch_stack and
13062         pop it again when we're done with the switch.
13063         (switch_section): The new block is a child of the current_block.
13064         Fixes bug #24007, added test-152.cs.
13065
13066 2002-07-27  Martin Baulig  <martin@gnome.org>
13067
13068         * expression.cs (Invocation.EmitArguments): When calling a varargs
13069         function with only its fixed arguments, we need to pass an empty
13070         array.
13071
13072 2002-07-27  Martin Baulig  <martin@gnome.org>
13073
13074         Mono 0.13 has been released.
13075
13076 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13077
13078         * driver.cs: Rename --resource to --linkres, because that is what
13079         we do currently, we dont support --resource yet.
13080
13081         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13082
13083 2002-07-25  Martin Baulig  <martin@gnome.org>
13084
13085         * class.cs (MethodData): New public class.  This is a `method builder'
13086         class for a method or one accessor of a Property/Indexer/Event.
13087         (MethodData.GetMethodFlags): Moved here from MemberBase.
13088         (MethodData.ApplyAttributes): Likewise.
13089         (MethodData.ApplyObsoleteAttribute): Likewise.
13090         (MethodData.ApplyConditionalAttribute): Likewise.
13091         (MethodData.ApplyDllImportAttribute): Likewise.
13092         (MethodData.CheckAbstractAndExternal): Likewise.
13093         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13094         (MethodData.Emit): Formerly known as Method.Emit().
13095         (MemberBase): Moved everything which was specific to a single
13096         accessor/method to MethodData.
13097         (Method): Create a new MethodData and call Define() and Emit() on it.
13098         (Property, Indexer, Event): Create a new MethodData objects for each
13099         accessor and call Define() and Emit() on them.
13100
13101 2002-07-25  Martin Baulig  <martin@gnome.org>
13102
13103         Made MethodCore derive from MemberBase to reuse the code from there.
13104         MemberBase now also checks for attributes.
13105
13106         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13107         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13108         as virtual.
13109         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13110         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13111         (MemberBase.ApplyAttributes): New virtual method; applies the
13112         attributes to a method or accessor.
13113         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13114         (MemberBase.ApplyConditionalAttribute): Likewise.
13115         (MemberBase.ApplyDllImportAttribute): Likewise.
13116         (MemberBase.CheckAbstractAndExternal): Likewise.
13117         (MethodCore.ParameterTypes): This is now a property instead of a
13118         method, it's initialized from DoDefineParameters().
13119         (MethodCore.ParameterInfo): Removed the set accessor.
13120         (MethodCore.DoDefineParameters): New protected virtual method to
13121         initialize ParameterTypes and ParameterInfo.
13122         (Method.GetReturnType): We can now simply return the MemberType.
13123         (Method.GetMethodFlags): Override the MemberBase version and add
13124         the conditional flags.
13125         (Method.CheckBase): Moved some code from Define() here, call
13126         DoDefineParameters() here.
13127         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13128         here to avoid some larger code duplication.
13129         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13130         ensure that abstract and external accessors don't declare a body.
13131
13132         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13133         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13134         lookup in the attribute's parent classes, so we need to abort as soon
13135         as we found the first match.
13136         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13137         the attribute has no arguments.
13138
13139         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13140         of a Method.
13141
13142 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13143
13144         * cs-parser.jay: reverted previous patch.
13145
13146 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13147
13148         * cs-parser.jay: fixed bug #22119.
13149
13150 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13151
13152         * attribute.cs: fixed compilation. The error was:
13153         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13154         be assigned to before control leaves the current method."
13155         [FIXME:  Filed as bug #28186: MCS must report this error.]
13156
13157 2002-07-25  Martin Baulig  <martin@gnome.org>
13158
13159         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13160         method to pull the condition name ouf of a Conditional attribute.
13161         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13162         the obsolete message and error flag out of an Obsolete attribute.
13163
13164         * class.cs (Method.GetMethodFlags): New public method to get the
13165         TypeManager.MethodFlags for this method.
13166         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13167         private methods.
13168         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13169         if we're overriding a virtual function, set the new private variable
13170         `parent_method'; call the new TypeManager.AddMethod().
13171
13172         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13173         the MethodBuilder and the Method in a PtrHashtable.
13174         (TypeManager.builder_to_method): Added for this purpose.
13175         (TypeManager.MethodFlags): Added IsObsoleteError.
13176         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13177         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13178         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13179         the message from the attribute.
13180
13181 2002-07-24  Martin Baulig  <martin@gnome.org>
13182
13183         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13184         preprocessor directives, ensure that the argument to #define/#undef is
13185         exactly one identifier and that it's actually an identifier.
13186
13187         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13188         did not work ....
13189
13190 2002-07-24  Martin Baulig  <martin@gnome.org>
13191
13192         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13193         initialize it to TypeManager.object_type in the constructor.
13194         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13195         of the `hm.get_current' method if we're using the collection pattern.
13196         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13197         for the explicit conversion to make it work when we're using the collection
13198         pattern and the `Current' property has a different return type than `object'.
13199         Fixes #27713.
13200
13201 2002-07-24  Martin Baulig  <martin@gnome.org>
13202
13203         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13204         does not match, but don't report any errors.  This method is called in
13205         order for all methods in a MethodGroupExpr until a matching method is
13206         found, so we don't want to bail out if the first method doesn't match.
13207         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13208         matches, report the 123.  Fixes #28070.
13209
13210 2002-07-24  Martin Baulig  <martin@gnome.org>
13211
13212         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13213         TypeManager.TypeToCoreType() to the top of the method so the
13214         following equality checks will work.  Fixes #28107.
13215
13216 2002-07-24  Martin Baulig  <martin@gnome.org>
13217
13218         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13219         operand is of type uint, and the other operand is of type sbyte,
13220         short or int, the operands are converted to type long." -
13221         Actually do what this comment already told us.  Fixes bug #28106,
13222         added test-150.cs.
13223
13224 2002-07-24  Martin Baulig  <martin@gnome.org>
13225
13226         * class.cs (MethodBase): New abstract class.  This is now a base
13227         class for Property, Indexer and Event to avoid some code duplication
13228         in their Define() and DefineMethods() methods.
13229         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13230         generic methods for Define() and DefineMethods().
13231         (FieldBase): Derive from MemberBase, not MemberCore.
13232         (Property): Derive from MemberBase, not MemberCore.
13233         (Property.DefineMethod): Moved all the code from this method to the
13234         new MethodBase.DefineAccessor(), just call it with appropriate
13235         argumetnts.
13236         (Property.Define): Call the new Property.DoDefine(), this does some
13237         sanity checks and we don't need to duplicate the code everywhere.
13238         (Event): Derive from MemberBase, not MemberCore.
13239         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13240         accessors, this will also make them work with interface events.
13241         (Indexer): Derive from MemberBase, not MemberCore.
13242         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13243         (Indexer.Define): Use the new MethodBase functions.
13244
13245         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13246         argument to the constructor.
13247         (Interface.FindMembers): Added support for interface events.
13248         (Interface.PopluateEvent): Implemented.
13249
13250         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13251
13252 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13253
13254         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13255         but this is required to check for a method name being the same as
13256         the containing class.  
13257
13258         Handle this now.
13259
13260 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13261
13262         * interface.cs: initialize variable.
13263
13264 2002-07-23  Martin Baulig  <martin@gnome.org>
13265
13266         Implemented the IndexerName attribute in interfaces.
13267
13268         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13269         name if this is an explicit interface implementation.
13270         (Indexer.InterfaceIndexerName): New public variable.  If we're
13271         implementing an interface indexer, this is the IndexerName in that
13272         interface.  Otherwise, it's the IndexerName.
13273         (Indexer.DefineMethod): If we're implementing interface indexer,
13274         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13275         and Pending.ImplementIndexer methods.
13276         (Indexer.Define): Also define the PropertyBuilder if we're
13277         implementing an interface indexer and this is neither an explicit
13278         interface implementation nor do the IndexerName match the one in
13279         the interface.
13280
13281         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13282         If a method is defined here, then we always need to create a proxy
13283         for it.  This is used when implementing interface indexers.
13284         (Pending.IsInterfaceIndexer): New public method.
13285         (Pending.ImplementIndexer): New public method.
13286         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13287         This is used when implementing interface indexers to define a proxy
13288         if necessary.
13289         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13290         define a proxy if necessary.
13291
13292         * interface.cs (Interface.IndexerName): New public variable.
13293         (Interface.PopulateIndexer): Set the IndexerName.
13294         (Interface.DefineIndexers): New private method.  Populate all the
13295         indexers and make sure their IndexerNames match.
13296
13297         * typemanager.cs (IndexerPropertyName): Added support for interface
13298         indexers.
13299
13300 2002-07-22  Martin Baulig  <martin@gnome.org>
13301
13302         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13303         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13304         ret if HasReturnLabel.
13305         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13306         variables.
13307
13308         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13309         and set the ec.LoopBeginTryCatchLevel.
13310         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13311         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13312         the current ec.TryCatchLevel, the branch goes out of an exception
13313         block.  In this case, we need to use Leave and not Br.
13314
13315 2002-07-22  Martin Baulig  <martin@gnome.org>
13316
13317         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13318         block unless the block does not always return or it is contained in
13319         another try { ... } catch { ... } block.  Fixes bug #26506.
13320         Added verify-1.cs to the test suite.
13321
13322 2002-07-22  Martin Baulig  <martin@gnome.org>
13323
13324         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13325         then we do not always return.  Fixes bug #24985.
13326
13327 2002-07-22  Martin Baulig  <martin@gnome.org>
13328
13329         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13330         lookup on a per-class level; ie. walk up the class hierarchy until we
13331         found at least one applicable method, then choose the best among them.
13332         Fixes bug #24463 and test-29.cs.
13333
13334 2002-07-22  Martin Baulig  <martin@gnome.org>
13335
13336         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13337         return types of the methods.  The return type is not part of the
13338         signature and we must not check it to make the `new' modifier work.
13339         Fixes bug #27999, also added test-147.cs.
13340         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13341
13342         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13343         on the method's return type.
13344
13345 2002-07-21  Martin Baulig  <martin@gnome.org>
13346
13347         * assign.cs: Make this work if the rightmost source is a constant and
13348         we need to do an implicit type conversion.  Also adding a few more tests
13349         to test-38.cs which should have caught this.
13350
13351         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13352         target in the makefile for this.  The makefile.gnu is primarily intended
13353         for end-users who don't want to debug the compiler.
13354
13355 2002-07-21  Martin Baulig  <martin@gnome.org>
13356
13357         * assign.cs: Improved the Assign class so it can now handle embedded
13358         assignments (X = Y = Z = something).  As a side-effect this'll now also
13359         consume less local variables.  test-38.cs now passes with MCS, added
13360         a few new test cases to that test.
13361
13362 2002-07-20  Martin Baulig  <martin@gnome.org>
13363
13364         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13365         instructions.  Fixes bug #27977, also added test-146.cs.
13366
13367 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13368
13369         * cs-tokenizer.cs: fixed getHex ().
13370
13371 2002-07-19  Martin Baulig  <martin@gnome.org>
13372
13373         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13374         not Type.GetType() to lookup the array type.  This is needed when
13375         we're constructing an array of a user-defined type.
13376         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13377         single-dimensional arrays, but also for single-dimensial arrays of
13378         type decimal.
13379
13380 2002-07-19  Martin Baulig  <martin@gnome.org>
13381
13382         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13383         this function is called, it's not allowed to share LocalBuilders
13384         among ILGenerators.
13385
13386 2002-07-19  Martin Baulig  <martin@gnome.org>
13387
13388         * expression.cs (Argument.Resolve): Report an error 118 when trying
13389         to pass a type as argument.
13390
13391 2002-07-18  Martin Baulig  <martin@gnome.org>
13392
13393         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13394         Conv_R_Un for the signed `long' type.
13395
13396 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13397
13398         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13399         `expr' for the temporary result, as that will fail if we do
13400         multiple resolves on the same expression.
13401
13402 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13403
13404         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13405         ec.TypeContainer for looking up aliases. 
13406
13407         * class.cs (TypeContainer): Remove LookupAlias from here.
13408
13409         * decl.cs (DeclSpace); Move here.
13410
13411 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13412
13413         * class.cs (FindMembers): Only call filter if the constructor
13414         bulider is not null.
13415
13416         Also handle delegates in `NestedTypes' now.  Now we will perform
13417         type lookups using the standard resolution process.  This also
13418         fixes a bug.
13419
13420         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13421         This uses Expressions (the limited kind that can be parsed by the
13422         tree) instead of strings.
13423
13424         * expression.cs (ComposedCast.ToString): Implement, used to flag
13425         errors since now we have to render expressions.
13426
13427         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13428         FormArrayType. 
13429
13430         * ecore.cs (SimpleName.ToString): ditto.
13431
13432         * cs-parser.jay: Instead of using strings to assemble types, use
13433         Expressions to assemble the type (using SimpleName, ComposedCast,
13434         MemberAccess).  This should fix the type lookups in declarations,
13435         because we were using a different code path for this.
13436
13437         * statement.cs (Block.Resolve): Continue processing statements
13438         even when there is an error.
13439
13440 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13441
13442         * class.cs (Event.Define): Also remove the `remove' method from
13443         the list of pending items.
13444
13445         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13446         generate more compact code. 
13447
13448 2002-07-17  Martin Baulig  <martin@gnome.org>
13449
13450         * const.cs (Const.LookupConstantValue): Add support for constant
13451         `unchecked' and `checked' expressions.
13452         Also adding test case test-140.cs for this.
13453
13454 2002-07-17  Martin Baulig  <martin@gnome.org>
13455
13456         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13457         check whether mi.ReturnType implements the IEnumerator interface; the
13458         `==' and the IsAssignableFrom() will fail in this situation.
13459
13460 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13461
13462         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13463         here too.
13464
13465 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13466
13467         * expression.cs: fixed bug #27811.
13468
13469 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13470
13471         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13472         Molaro: when we are a ref, the value already contains a pointer
13473         value, do not take the address of it.
13474
13475 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13476         * removed mb-parser.jay and mb-tokenizer.cs
13477
13478 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13479
13480         * expression.cs: check against the building corlib void type.
13481
13482 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13483
13484         * ecore.cs: fix for valuetype static readonly fields: when 
13485         initializing them, we need their address, not the address of a copy.
13486
13487 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13488
13489         * typemanager.cs: register also enum_type in corlib.
13490
13491 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13492
13493         * class.cs: allow calling this (but not base) initializers in structs.
13494
13495 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13496
13497         * ecore.cs: make sure we compare against the building base types
13498         in GetTypeSize ().
13499
13500 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13501
13502         * typemanager.cs: fix TypeToCoreType() to handle void and object
13503         (corlib gets no more typerefs after this change).
13504
13505 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13506
13507         * expression.cs (ArrayCreation.EmitArrayArguments): use
13508         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13509
13510         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13511         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13512         array indexes, the runtime actually forbids them.
13513
13514         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13515         for array arguments here.
13516
13517         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13518         instead of the default for ValueTypes.
13519
13520         (New.DoEmit): Use IsValueType instead of
13521         IsSubclassOf (value_type)
13522         (New.DoResolve): ditto.
13523         (Invocation.EmitCall): ditto.
13524
13525         * assign.cs (Assign): ditto.
13526
13527         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13528         Statements *are* currently doing part of their resolution during
13529         Emit.  
13530
13531         Expressions do always resolve during resolve, but statements are
13532         only required to propagate resolution to their children.
13533
13534 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13535
13536         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13537
13538         (LoadAssembly): Do not add the dll if it is already specified
13539
13540         (MainDriver): Add the System directory to the link path at the end,
13541         after all the other -L arguments. 
13542
13543         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13544         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13545         ldelem.u1) and using the opposite for sbytes.
13546
13547         This fixes Digger, and we can finally run it.
13548
13549         * driver.cs (UnixParseOption): Move the option parsing here.  
13550         (CSCParseOption): Implement CSC-like parsing of options.
13551
13552         We now support both modes of operation, the old Unix way, and the
13553         new CSC-like way.  This should help those who wanted to make cross
13554         platform makefiles.
13555
13556         The only thing broken is that /r:, /reference: and /lib: are not
13557         implemented, because I want to make those have the same semantics
13558         as the CSC compiler has, and kill once and for all the confussion
13559         around this.   Will be doing this tomorrow.
13560
13561         * statement.cs (Unsafe.Resolve): The state is checked during
13562         resolve, not emit, so we have to set the flags for IsUnsfe here.
13563
13564 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13565
13566         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13567         not catch the Error_ObjectRefRequired in SimpleName (as it is
13568         possible to have a class/instance variable name that later gets
13569         deambiguated), we have to check this here.      
13570
13571 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13572
13573         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13574         make static and put into Expression.
13575
13576         (Event.Define): Register the private field of the event with the 
13577         TypeManager so that GetFieldFromEvent can get at it.
13578
13579         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13580         keep track of the private field associated with an event which
13581         has no accessors.
13582
13583         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13584         private field.
13585
13586         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13587
13588 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13589
13590         * expression.cs (Binary.EmitBranchable): this routine emits the
13591         Binary expression in a branchable context.  This basically means:
13592         we need to branch somewhere, not just get the value on the stack.
13593
13594         This works together with Statement.EmitBoolExpression.
13595
13596         * statement.cs (Statement.EmitBoolExpression): Use
13597         EmitBranchable. 
13598
13599 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13600
13601         * statement.cs (For): Reduce the number of jumps in loops.
13602
13603         (For): Implement loop inversion for the For statement.
13604
13605         (Break): We can be breaking out of a Try/Catch controlled section
13606         (foreach might have an implicit try/catch clause), so we need to
13607         use Leave instead of Br.
13608
13609         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13610         now).  If the instace expression supports IMemoryLocation, we use
13611         the AddressOf method from the IMemoryLocation to extract the
13612         address instead of emitting the instance.
13613
13614         This showed up with `This', as we were emitting the instance
13615         always (Emit) instead of the Address of This.  Particularly
13616         interesting when This is a value type, as we dont want the Emit
13617         effect (which was to load the object).
13618
13619 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13620
13621         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13622
13623         * statement.cs (Checked): Set the CheckedState during the resolve
13624         process too, as the ConvCast operations track the checked state on
13625         the resolve process, and not emit.
13626
13627         * cs-parser.jay (namespace_member_declaration): Flag that we have
13628         found a declaration when we do.  This is used to flag error 1529
13629
13630         * driver.cs: Report ok when we display the help only.
13631
13632 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13633
13634         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13635
13636 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13637
13638         * cs-tokenizer.cs (define): We also have to track locally the
13639         defines.  AllDefines is just used for the Conditional Attribute,
13640         but we also need the local defines for the current source code. 
13641
13642 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13643
13644         * statement.cs (While, For, Do): These loops can exit through a
13645         Break statement, use this information to tell whether the
13646         statement is the last piece of code.
13647
13648         (Break): Flag that we break.
13649
13650         * codegen.cs (EmitContexts): New `Breaks' state variable.
13651
13652 2002-07-03  Martin Baulig  <martin@gnome.org>
13653
13654         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13655         modifiers in method declarations in structs.  Otherwise, you won't
13656         be able to override things like Object.Equals().
13657
13658 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13659
13660         * class.cs (Method, Property, Indexer): Do not allow the public
13661         modifier to be used in explicit interface implementations.
13662
13663         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13664         override modifiers in method declarations in structs
13665
13666 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13667
13668         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13669         integer or real overflow, report an error
13670
13671 2002-07-02  Martin Baulig  <martin@gnome.org>
13672
13673         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13674         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13675         to tell the runtime about our newly created System.Object and
13676         System.ValueType types.
13677
13678 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13679
13680         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13681         struct instead of Ldarg/Starg.
13682
13683 2002-07-02  Martin Baulig  <martin@gnome.org>
13684
13685         * expression.cs (Indirection.Indirection): Call
13686         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13687
13688 2002-07-02  Martin Baulig  <martin@gnome.org>
13689
13690         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13691         ValueType, call TypeManager.TypeToCoreType() on it.
13692         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13693         the OpCodes.Newarr argument.
13694
13695 2002-07-02  Martin Baulig  <martin@gnome.org>
13696
13697         * expression.cs (Invocation.EmitCall): When compiling corlib,
13698         replace all calls to the system's System.Array type to calls to
13699         the newly created one.
13700
13701         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13702         System.Array methods.
13703         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13704         from the system's System.Array type which must be replaced.
13705
13706 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13707
13708         * typemanager.cs: load unverifiable_code_ctor so we can build
13709         corlib using the correct type. Avoid using GetTypeCode() with
13710         TypeBuilders.
13711         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13712         TypeManager.object_type to allow building corlib.
13713
13714 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13715
13716         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13717
13718 2002-07-01  Martin Baulig  <martin@gnome.org>
13719
13720         * class.cs: Make the last change actually work, we need to check
13721         whether `ifaces != null' to avoid a crash.
13722
13723 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13724
13725         * class.cs: when we build structs without fields that implement
13726         interfaces, we need to add the interfaces separately, since there is
13727         no API to both set the size and add the interfaces at type creation
13728         time.
13729
13730 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13731
13732         * expression.cs: the dimension arguments to the array constructors
13733         need to be converted if they are a long.
13734
13735 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13736
13737         * class.cs: don't emit ldarg.0 if there is no parent constructor
13738         (fixes showstopper for corlib).
13739
13740 2002-06-29  Martin Baulig  <martin@gnome.org>
13741
13742         MCS now compiles corlib on GNU/Linux :-)
13743
13744         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13745         ie. check for MethodImplOptions.InternalCall.
13746
13747         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13748         and TypeManager.attribute_type are null, so we must explicitly check
13749         whether parent is not null to find out whether it's an attribute type.
13750         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13751         and SetBuilder, not only if the property is neither abstract nor external.
13752         This is necessary to set the MethodImplOptions on the accessor methods.
13753         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13754         SetBuilder, see Property.Emit().
13755
13756         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13757         populate "System.Object", "System.ValueType" and "System.Attribute" since
13758         they've already been populated from BootCorlib_PopulateCoreTypes().
13759
13760 2002-06-29  Martin Baulig  <martin@gnome.org>
13761
13762         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13763         is the NullLiteral, we also need to make sure that target_type is not
13764         an enum type.   
13765
13766 2002-06-29  Martin Baulig  <martin@gnome.org>
13767
13768         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13769         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13770         before calling BootstrapCorlib_ResolveDelegate ().
13771
13772 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13773
13774         * statement.cs: fixed build-breaker. All tests passed ok.
13775
13776 2002-06-27  Martin Baulig  <martin@gnome.org>
13777
13778         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13779         for System.Decimal when compiling corlib.
13780
13781 2002-06-27  Martin Baulig  <martin@gnome.org>
13782
13783         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13784         switch blocks which contain nothing but a default clause.
13785
13786 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13787
13788        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13789
13790 2002-06-27  Martin Baulig  <martin@gnome.org>
13791
13792         * ecore.cs (PropertyExpr.PropertyExpr): Call
13793         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13794
13795         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13796         is already a TypeBuilder.
13797
13798 2002-06-27  Martin Baulig  <martin@gnome.org>
13799
13800         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13801         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13802         the "from an array-type to System.Array" case.  This makes it work
13803         when compiling corlib.
13804
13805 2002-06-27  Martin Baulig  <martin@gnome.org>
13806
13807         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13808         non-static PropertyExpr, set its InstanceExpression.  This makes
13809         the `ICollection.Count' property work in System/Array.cs.
13810
13811 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13812
13813         * driver.cs: Made error handling more consistent.  Errors now
13814         tracked by Report class, so many methods which used to return int
13815         now return void.  Main() now prints success/failure and 
13816         errors/warnings message.
13817
13818         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13819         the magic number return values (123 and 124).  Now, if the
13820         expected error occurs, the compiler exits with success (exit value
13821         0).  If the compilation completes without seeing that particular
13822         error, the compiler exits with failure (exit value 1).  The
13823         makefile in mcs/errors has been changed to handle the new behaviour.
13824
13825         * report.cs: Made 'expected error' number a property and renamed
13826         it from 'Probe' to 'ExpectedError'.
13827
13828         * genericparser.cs: Removed error handling support, since it is
13829         now all done by Report class.
13830
13831         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13832         class, so parse() no longer returns an int.
13833
13834         * namespace.cs: Use Report.Error instead of GenericParser.error
13835
13836 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13837
13838         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13839         TypeContainer.AddOperator): At the front of the list put the
13840         explicit implementations, so they get resolved/defined first. 
13841
13842 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13845         interface type is implemented by this TypeContainer.  Used during
13846         explicit interface implementation.
13847
13848         (Property.Define, Indexer.Define, Method.Define): Validate that
13849         the given interface in the explicit implementation is one of the
13850         base classes for the containing type.
13851
13852         Also if we are explicitly implementing an interface, but there is
13853         no match in the pending implementation table, report an error.
13854
13855         (Property.Define): Only define the property if we are
13856         not explicitly implementing a property from an interface.  Use the
13857         correct name also for those properties (the same CSC uses,
13858         although that is really not needed).
13859
13860         (Property.Emit): Do not emit attributes for explicitly implemented
13861         properties, as there is no TypeBuilder.
13862
13863         (Indexer.Emit): ditto.
13864
13865         Hiding then means that we do not really *implement* a pending
13866         implementation, which makes code fail.
13867
13868 2002-06-22  Martin Baulig  <martin@gnome.org>
13869
13870         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13871         the return value of Object.GetType().  [FIXME: we need to do this whenever
13872         we get a type back from the reflection library].
13873
13874 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13875
13876         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13877
13878 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13879
13880         * attribute.cs: Return null if we can not look up the type.
13881
13882         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13883         the interface types found.
13884
13885         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13886         interface types found.
13887
13888         * typemanager.cs (GetInterfaces): Make this routine returns alll
13889         the interfaces and work around the lame differences between
13890         System.Type and System.Reflection.Emit.TypeBuilder in the results
13891         result for GetInterfaces.
13892
13893         (ExpandInterfaces): Given an array of interface types, expand and
13894         eliminate repeated ocurrences of an interface.  This expands in
13895         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13896         be IA, IB, IC.
13897
13898 2002-06-21  Martin Baulig  <martin@gnome.org>
13899
13900         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13901         on System.Enum.
13902
13903 2002-06-21  Martin Baulig  <martin@gnome.org>
13904
13905         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13906         and called with one of the core types, return the corresponding typebuilder for
13907         that type.
13908
13909         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13910         element type.
13911
13912 2002-06-21  Martin Baulig  <martin@gnome.org>
13913
13914         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13915         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13916         (Expression.ConvertReferenceExplicit): Likewise.
13917
13918         * expression.cs (ElementAccess.DoResolve): Likewise.
13919         (ElementAccess.DoResolveLValue): Likewise.
13920
13921 2002-06-10  Martin Baulig  <martin@gnome.org>
13922
13923         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13924         add the "value" parameter to the parameter list.
13925
13926         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13927         to our caller.
13928
13929 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13930
13931         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13932         the argument to an int, uint, long or ulong, per the spec.  Also
13933         catch negative constants in array creation.
13934
13935 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13936
13937         * class.cs: do not allow the same interface to appear twice in
13938         the definition list.
13939
13940 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13941
13942         * ecore.cs: don't use ldlen with System.Array.
13943
13944 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13945
13946         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13947
13948 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13949
13950         * modifiers.cs: produce correct field attributes for protected
13951         internal. Easy fix so miguel can work on ther harder stuff:-)
13952
13953 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13954
13955         * pending.cs: New file.  Move the code from class.cs here.
13956         Support clearning the pending flag for all methods (when not doing
13957         explicit interface implementation).
13958
13959 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13960
13961         * rootcontext.cs: added a couple more types needed to bootstrap.
13962
13963 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13964
13965         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13966         constructor in the type, instead of any constructor in the type
13967         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13968         a bug in the Mono runtime when applying the params attribute). 
13969
13970 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13971         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13972
13973 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13974
13975         * expression.cs (Unary.ResolveOperator): Use TypeManager
13976         to resolve the type.
13977
13978 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13979
13980         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13981         attached.
13982
13983         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13984         with each member too.
13985
13986         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13987         field builders too - this takes care of the enum member case.
13988
13989 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13990
13991         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13992         address-of operator on both value types and pointers.
13993
13994 2002-06-10  Martin Baulig  <martin@gnome.org>
13995
13996         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13997         PropertyBuilder to the `property_builders' list.
13998
13999         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14000         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14001         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14002         find any indexers which are inherited from an interface.
14003
14004 2002-06-09  Martin Baulig  <martin@gnome.org>
14005
14006         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14007         the same type as the constant if necessary.  There's also a test-130.cs
14008         for this.
14009
14010         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14011
14012         * typemanager.cs (TypeManager.ChangeType): Previously known as
14013         Enum.ChangeEnumType().
14014
14015 2002-06-09  Martin Baulig  <martin@gnome.org>
14016
14017         * expression.cs (Cast.TryReduce): Added support for consts.
14018
14019 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14020
14021         * class.cs (Accessor): Hold attributes information so we can pass
14022         it along.
14023
14024         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14025         Modify to pass in attributes attached to the methods.
14026
14027         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14028
14029         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14030         to handle the Accessor kind :-)
14031
14032         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14033
14034 2002-06-08  Martin Baulig  <martin@gnome.org>
14035
14036         * expression.cs (Unary.TryReduceNegative): Added support for
14037         ULongConstants.
14038
14039 2002-06-08  Martin Baulig  <martin@gnome.org>
14040
14041         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14042         name can't be found in the `defined_names' - the caller will do a
14043         MemberLookup in this case and thus find methods in System.Enum
14044         such as Enum.IsDefined().
14045
14046 2002-06-08  Martin Baulig  <martin@gnome.org>
14047
14048         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14049         Convert.ChangeType() which works with TypeBuilder created types.
14050         (Enum.LookupEnumValue, Enum.Define): Use it here.
14051
14052         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14053         `TypeBuilder.BaseType != null' check.
14054         (TypeContainer.FindMembers): Only lookup parent members if we
14055         actually have a parent.
14056         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14057         (ConstructorInitializer.Resolve): Likewise.
14058
14059         * interface.cs (Interface.FindMembers): Added
14060         `TypeBuilder.BaseType != null' check.
14061
14062         * rootcontext.cs (RootContext.ResolveCore): Added
14063         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14064         classes_second_stage.
14065
14066         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14067         debug_type and trace_type when compiling with --nostdlib.       
14068
14069 2002-06-07  Martin Baulig  <martin@gnome.org>
14070
14071         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14072         (AddField): Set it to true when adding a non-static field.
14073         (DefineType): Use `have_nonstatic_fields' to find out whether we
14074         have non-static fields, not `Fields != null'.
14075
14076 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14077
14078         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14079         dereferencing a null on the static-field code path)
14080
14081 2002-05-30  Martin Baulig  <martin@gnome.org>
14082
14083         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14084         to take command line arguments.  Use reflection to call the new
14085         custom `Initialize' function on the symbol writer and pass it the
14086         command line arguments.
14087
14088         * driver.cs (--debug-args): New command line argument to pass command
14089         line arguments to the symbol writer.
14090
14091 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14092
14093         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14094         the target type for indexers and properties.  Thanks to Joe for
14095         catching this.
14096
14097 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14098
14099         * typemanager.cs (MethodFlags): returns the method flags
14100         (Obsolete/ShouldIgnore) that control warning emission and whether
14101         the invocation should be made, or ignored. 
14102
14103         * expression.cs (Invocation.Emit): Remove previous hack, we should
14104         not do this on matching a base type, we should do this based on an attribute
14105
14106         Only emit calls to System.Diagnostics.Debug and
14107         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14108         on the command line.
14109
14110         * rootcontext.cs: Global settings for tracing and debugging.
14111
14112         * cs-tokenizer.cs (define): New utility function to track
14113         defines.   Set the global settings for TRACE and DEBUG if found.
14114
14115 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14116
14117         * interface.cs (Populate*): Pass in the TypeContainer as well as
14118         the DeclSpace as parameters so that we can create EmitContexts and
14119         then use that to apply attributes etc.
14120
14121         (PopulateMethod, PopulateEvent, PopulateProperty)
14122         (PopulateIndexer): Apply attributes everywhere.
14123
14124         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14125         etc.
14126
14127         (ApplyAttributes): Update accordingly.
14128
14129         We now apply interface attributes for all members too.
14130
14131 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14132
14133         * class.cs (Indexer.Define); Correctly check if we are explicit
14134         implementation (instead of checking the Name for a ".", we
14135         directly look up if the InterfaceType was specified).
14136
14137         Delay the creation of the PropertyBuilder.
14138
14139         Only create the PropertyBuilder if we are not an explicit
14140         interface implementation.   This means that explicit interface
14141         implementation members do not participate in regular function
14142         lookups, and hence fixes another major ambiguity problem in
14143         overload resolution (that was the visible effect).
14144
14145         (DefineMethod): Return whether we are doing an interface
14146         implementation. 
14147
14148         * typemanager.cs: Temporary hack until we get attributes in
14149         interfaces (Ravi is working on that) and we get IndexerName
14150         support in interfaces.
14151
14152         * interface.cs: Register the indexers as properties.
14153
14154         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14155         warning, I have verified that this is a bug in the .NET runtime
14156         (JavaScript suffers of the same problem).
14157
14158         * typemanager.cs (MemberLookup): When looking up members for
14159         interfaces, the parent of an interface is the implicit
14160         System.Object (so we succeed in searches of Object methods in an
14161         interface method invocation.  Example:  IEnumerable x;  x.ToString
14162         ()) 
14163
14164 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14165
14166         * class.cs (Event): Events should also register if they do
14167         implement the methods that an interface requires.
14168
14169         * typemanager.cs (MemberLookup); use the new GetInterfaces
14170         method. 
14171
14172         (GetInterfaces): The code used to lookup interfaces for a type is
14173         used in more than one place, factor it here. 
14174
14175         * driver.cs: Track the errors at the bottom of the file, we kept
14176         on going.
14177
14178         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14179         instance if the method we are calling is static!
14180
14181 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14182
14183         * attribute.cs (ApplyAttributes): Make this function filter out
14184         the IndexerName attribute (as that attribute in reality is never
14185         applied) and return the string constant for the IndexerName
14186         attribute. 
14187
14188         * class.cs (TypeContainer.Emit): Validate that all the indexers
14189         have the same IndexerName attribute, and if so, set the
14190         DefaultName attribute on the class. 
14191
14192         * typemanager.cs: The return value might contain other stuff (not
14193         only methods).  For instance, consider a method with an "Item"
14194         property and an Item method.
14195
14196         * class.cs: If there is a problem with the parameter types,
14197         return. 
14198
14199 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14200
14201         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14202         looks at user defined conversion after making a call to 
14203         StandardConversionExists - we need this for overload resolution.
14204
14205         * expression.cs : Update accordingly the various method calls.
14206
14207         This fixes 2 bugs filed against implicit user defined conversions 
14208
14209 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14210
14211         * statement.cs: Track the result of the assignment.
14212
14213 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14214
14215         * expression.cs (MemberAccess): Improved error reporting for
14216         inaccessible members.
14217
14218 2002-05-22  Martin Baulig  <martin@gnome.org>
14219
14220         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14221         itself with debugging support.
14222
14223 2002-05-22  Martin Baulig  <martin@gnome.org>
14224
14225         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14226         Removed, this isn't needed anymore.
14227
14228 2002-05-20  Martin Baulig  <martin@gnome.org>
14229
14230         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14231         be underlying type for an enum.
14232
14233 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14234
14235         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14236         that splits out the loading of just the core types.
14237
14238         * rootcontext.cs (ResolveCore): Split the struct resolution in
14239         two, so we can load the enumeration underlying types before any
14240         enums are used.
14241
14242         * expression.cs (Is): Bandaid until we fix properly Switch (see
14243         bug #24985 for details).
14244
14245         * typemanager.cs (ImplementsInterface): The hashtable will contain
14246         a null if there are no interfaces implemented.
14247
14248 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14249
14250         * cs-parser.jay (indexer_declarator): It is fine to have array
14251         parameters
14252
14253 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14254
14255         * typemanager.cs: (RegisterBuilder): New function used to register
14256         TypeBuilders that implement interfaces.  Since
14257         TypeBuilder.GetInterfaces (as usual) does not work with lame
14258         Reflection.Emit. 
14259         (AddUserType): register interfaces.
14260
14261         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14262         dealing with TypeBuilder.  Also, arrays are showing up as
14263         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14264         methods can not be invoked on them!
14265
14266         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14267         (ImplicitReferenceConversionExists): Split out from
14268         StandardConversionExists. 
14269
14270         * expression.cs (As): We were only implementing one of the three
14271         cases for the as operator.  We now implement them all.
14272         (Is): Implement the various other cases for Is as well.
14273
14274         * typemanager.cs (CACHE): New define used to control if we want or
14275         not the FindMembers cache.  Seems to have a negative impact on
14276         performance currently
14277
14278         (MemberLookup): Nested types have full acess to
14279         enclosing type members
14280
14281         Remove code that coped with instance/static returns for events, we
14282         now catch this in RealFindMembers.
14283
14284         (RealFindMembers): only perform static lookup if the instance
14285         lookup did not return a type or an event.  
14286
14287 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14288
14289         * assign.cs (CompoundAssign): We pass more semantic information
14290         now to Compound Assignments than we did before: now we have all
14291         the information at hand, and now we resolve the target *before* we
14292         do the expression expansion, which allows the "CacheValue" method
14293         to have the effect we intended (before, a [x] += 1 would generate
14294         two differen ArrayAccess expressions from the ElementAccess,
14295         during the resolution process).
14296
14297         (CompoundAssign.DoResolve): Resolve target and original_source here.
14298
14299 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14300
14301         * expression.cs (ArrayAccess): dropped debugging information. 
14302
14303         * typemanager.cs: Small bug fix: I was always returning i_members,
14304         instead of one of i_members or s_members (depending on which had
14305         the content).
14306
14307         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14308         method is invoked before any code generation takes place, and it
14309         is a mechanism to inform that the expression will be invoked more
14310         than once, and that the method should use temporary values to
14311         avoid having side effects
14312
14313         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14314
14315         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14316         implementation.
14317
14318         * expression.cs (Indirection, ArrayAccess): Add support for
14319         CacheTemporaries in these two bad boys. 
14320
14321         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14322         ldobj or ldind_ref.  
14323         (StoreFromPtr): Handle stobj as well.
14324
14325         * expression.cs (UnaryMutator): Share more code.
14326
14327         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14328         down: I was not tracking the Filter function as well, which
14329         was affecting the results of the cache.
14330
14331 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14332
14333         * attribute.cs: Remove the hack to handle the CharSet property on
14334         StructLayouts. 
14335
14336 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14337
14338         * attribute.cs (DoResolve): More uglyness, we now only try to
14339         resolve the attribute partially, to extract the CharSet
14340         information (only if we are a StructLayout attribute).  Otherwise 
14341
14342         (GetExtraTypeInfo): Add some code to conditionally kill in the
14343         future this.   I am more and more convinced that the .NET
14344         framework has special code to handle the attribute setting on
14345         certain elements.
14346
14347         * expression.cs (IsParamsMethodApplicable): Revert my previous
14348         foreach change here, it was wrong.
14349
14350 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14351
14352         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14353         (pp_expr): do not abort on unknown input, just return.
14354         (eval): abort if there are pending chars.
14355
14356         * attribute.cs (Attribute.Resolve): Positional parameters are
14357         optional.  Deal with that case.
14358
14359         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14360         the Ansi/Unicode/Auto information for the type.
14361
14362         (TypeContainer.DefineType): instantiate the EmitContext here, as
14363         we will be using it during the type definition (to resolve
14364         attributes) and during the emit phase.
14365
14366         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14367         to pull type information out of the attributes
14368
14369         (Attribute.Resolve): track the constructor builder, and allow for
14370         multiple invocations (structs and classes will use this).
14371
14372         * ecore.cs (MemberLookupFinal): new version with all the
14373         parameters customizable.
14374
14375         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14376         constructors.  Return if the result value is null (as the error
14377         would have been flagged already by MemberLookupFinal)
14378
14379         Do not allow instances of abstract classes or interfaces to be
14380         created.
14381
14382         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14383         We have to compare the assembly property here when dealing with
14384         FamANDAssem and Assembly access modifiers, because we might be
14385         creating an assembly from *modules* (that means that we are not
14386         getting TypeBuilders for types defined in other modules that are
14387         part of this assembly).
14388
14389         (Method.Emit): If the method is marked abstract and has a body,
14390         emit an error. 
14391
14392         (TypeContainer.DefineMembers): If both the defined member and the
14393         parent name match are methods, then do not emit any warnings: let
14394         the Method.Define routine take care of flagging warnings.  But if
14395         there is a mismatch (method overrides something else, or method is
14396         overriwritten by something, then emit warning).
14397
14398         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14399         set to null, this means `do not check for the return type on the
14400         signature'. 
14401
14402         (Method.Define): set the return type for the method signature to
14403         null, so that we get methods with the same name and parameters and
14404         different return types.  This is used to flag warning 114 (you are
14405         hiding a method, and you probably want to use the new/override
14406         keywords instead).
14407
14408         * typemanager.cs (MemberLookup): Implemented proper access
14409         control, closing a long standing set of bug reports.  The problem
14410         was that the Framework only has two bits: Public and NonPublic,
14411         and NonPublic includes private and protected methods, but we need
14412         to enforce the FamANDAssem, FamOrAssem and Family. 
14413
14414 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14415
14416         * statement.cs (GotoCase): Return true: Ammounts to giving up
14417         knowledge on whether we return or not, and letting the other case
14418         be responsible for it.
14419
14420 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14421
14422         * driver.cs: Do not load directories for each file processed, only
14423         do it if there is a pattern.
14424
14425         * ecore.cs: Report readonly assigns here as well, as we might have
14426         been resolved only by MemberAccess.
14427
14428         (SimpleName.SimpleNameResolve): Also be useful for LValue
14429         resolution.   We need this to propagate assign to local readonly variables
14430
14431         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14432         do not want to reuse potential criteria memory.
14433
14434         * class.cs (MyEventBuilder): Set reflected_type;
14435
14436         * ecore.cs (Constantify): Added support for constifying bools.
14437
14438         (RootContext.LookupType): Added a cache for values looked up in
14439         the declaration space.
14440
14441         * typemanager.cs (FindMembers): Now is a front-end to
14442         RealFindMembers, and provides a two-level hashtable-based cache to
14443         the request.  
14444
14445         15% performance improvement: from 22.5 to 19.2 seconds.
14446
14447         * expression.cs (IsParamsMethodApplicable): use foreach.
14448         (Invocation.DoResolve): ditto.
14449         (New.DoResolve): ditto.
14450         (ArrayCreation.DoResolve): ditto.
14451
14452         * ecore.cs (FindMostEncompassingType): use foreach.
14453
14454         * delegate.cs (NewDelegate.DoResolve): Use foreach
14455
14456         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14457         (RemoveMethods): use foreach.
14458
14459         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14460         nested foreach statements instead of for, and also break out of
14461         the inner loop once a match is found.
14462
14463         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14464
14465 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14466
14467         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14468         we actually unwrap the expression to allow for extra information
14469         to be extracted. 
14470
14471         * expression.cs: Use Shr_Un on unsigned operations. 
14472
14473 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14474
14475         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14476         applicable operators was not being considered correctly. This closes
14477         the bug Miguel reported.
14478
14479 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14480
14481         * attribute.cs: check that the type derives from System.Attribute
14482         and report the correct error in that case (moved the duplicate code to
14483         its own method, too).
14484
14485 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14486
14487         * attribute.cs: lookup attribute type name as the spec says: first the
14488         bare attribute name and then name + "Attribute" (nant compiles with
14489         mcs after this fix).
14490
14491 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14492
14493         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14494         Because of the way we parse things, we should try to see if a
14495         UIntConstant can fit in an integer.
14496
14497 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14498
14499         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14500         when we are in an explicit context.
14501
14502         (ConvertReferenceExplicit): When converting from Iface type S to Class
14503         T make sure the rules are implemented as an OR.
14504
14505         * parameter.cs (ParameterType): Make it a property for now although the
14506         purpose really isn't anything immediate.
14507
14508         * expression.cs (Is*Applicable): Do better checking on the parameter type
14509         of a ref/out parameter. The ones from the system assemblies are already 
14510         marked with the correct type so we don't need to do any correction.
14511
14512         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14513         the object type is standard too so include that.
14514
14515 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14516
14517         * ecore.cs (StandardConversionExists): Augment with missing code:
14518         deal with IntConstant, LongConstants and Enumerations.
14519
14520         * assign.cs: Report the error, instead of failing silently
14521
14522         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14523         typecontainer that they are declared, because the
14524         typecontainer/namespace will have the list of using clauses that
14525         need to be applied.
14526
14527         Assembly Attributes were escaping the normal registration
14528         mechanism. 
14529
14530         (EmitCode): Apply attributes within an EmitContext that represents
14531         the container they were declared on.
14532
14533         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14534
14535 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14536
14537         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14538         Revamp completely - make much cleaner as we now operate only
14539         on a set of Types.
14540
14541         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14542         to implement the logic detailed in the spec more correctly.
14543
14544         (UserDefinedConversion): Update accordingly.
14545
14546 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14547
14548         * statement.cs: Return flow analysis information up.
14549
14550         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14551         and the default.
14552
14553         (token): Do not consume an extra character before calling
14554         decimal_digits.
14555
14556 2002-05-06  Piers Haken <piersh@friskit.com>
14557
14558         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14559
14560 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14561
14562         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14563         EmitContext during the instance constructor initializer
14564         resolution, to stop access to instance variables.
14565
14566         This is mandated by the spec, last paragraph of the `constructor
14567         initializers' section. 
14568
14569 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14570
14571         * cs-parser.jay, class.cs (Accessor): new class used to represent
14572         an accessor (get or set).  In the past we used `null' to represent
14573         a missing accessor.  But this is ambiguous because there was no
14574         way to tell in abstract indexers/properties if one of them was
14575         specified.
14576
14577         Now there is a way of addressing that.
14578
14579         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14580         instead of FindMembers.
14581
14582         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14583         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14584
14585         * attribute.cs: Treat indexers and properties as the same in terms
14586         of applying attributes
14587
14588         * ecore.cs (FindMostEncompassedType): Use statically initialized
14589         EmptyExpressions()s like we do elsewhere to avoid creating useless
14590         objects (and we take this out of the tight loop).
14591
14592         (GetConversionOperators): Move the code to extract the actual
14593         operators to a separate routine to clean things up.
14594
14595 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14596
14597         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14598         events are always registered FieldBuilders.
14599
14600         * class.cs (FieldBase): New class shared by Fields 
14601
14602         * delegate.cs: If we are a toplevel delegate, use our full name.
14603         If we are a nested delegate, then only use our tail name.
14604
14605 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14606
14607         * expression.cs (IsApplicable): Ensure that we add the "&" to
14608         ref/out types before comparing it with the type of the argument.
14609
14610         (IsParamsMethodApplicable): Ditto.
14611
14612         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14613         silly me ;-)
14614
14615         * delegate.cs : Handle the case when we have more than one applicable
14616         method. Flag an error only when we finish checking all.
14617
14618 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14619
14620         * expression.cs: Add support for boolean static initializers.
14621
14622 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14623
14624         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14625
14626         * parameter.cs (ComputeParameterTypes,
14627         ComputeAndDefineParameterTypes): Better error handling: now we
14628         clear the `types' cache if we fail during any of the type lookups.
14629         We also return the status code correctly to our caller
14630
14631         * delegate.cs: If we fail to define a delegate, abort the extra
14632         steps. 
14633
14634         * expression.cs (Binary.ResolveOperator): for
14635         operator==(object,object) and operator !=(object, object) we also
14636         have to verify that there is an implicit conversion from one to
14637         the other.
14638
14639         (ArrayAccess.DoResolve): Array Access can operate on
14640         non-variables. 
14641
14642 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14643
14644         * assign.cs (CompoundAssign): A new class used as a "flag" that
14645         the assignment actually is happening as part of a compound
14646         assignment operator.
14647
14648         During compound assignment, a few new rules exist to enable things
14649         like:
14650
14651         byte b |= 1 + 2
14652
14653         From the spec:
14654
14655         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14656         to the type of x) if y is implicitly convertible to the type of x,
14657         and the operator is a builtin operator and the return type of the
14658         operator is explicitly convertible to the type of x. 
14659
14660         * rootcontext.cs: Reset warning level to 2.  4 catches various
14661         "interesting" features in mcs, we must clean this up at some
14662         point, but currently am trying to kill other bugs ;-)
14663
14664         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14665         in container classes as well.  
14666
14667         * expression.cs (Binary.ResolveOperator): Handle string case
14668         before anything else (as operator overloading does emit an error
14669         before doing anything else).
14670
14671         This code could go away when we move to a table driven model, but
14672         i could not come up with a good plan last night.
14673
14674 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14675
14676         * typemanager.cs (CSharpName): reimplementation using regex.
14677         * class.cs: added null check for fields in Emit
14678         * rootcontext.cs: set warninglevel to 4
14679
14680 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14681
14682         * typemanager.cs (CSharpName): reimplemented with Lupus
14683         suggestion.
14684
14685 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14686
14687         * statement.cs (If): correclty implement Resolve, because we were
14688         not catching sem errors in there.  The same process is needed
14689         everywhere else. 
14690         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14691
14692
14693         (Statement.Warning_DeadCodeFound): Factorize code.
14694         (While): Report dead code here too.
14695
14696         (Statement): Added Resolve virtual method to allow
14697         for resolution split from the emit code.
14698
14699 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14700
14701         * statement.cs (EmitBoolExpression): No longer try to resolve the
14702         expression here.    
14703         (MakeBoolean): New utility function that resolve, implicitly
14704         converts to boolean and tags the expression. 
14705
14706
14707         (If, Do): Implement dead code elimination.
14708         (While): Implement loop inversion
14709
14710         (Do, While, For, If): Resolve the expression prior to calling our
14711         code generation.
14712
14713 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14714
14715         * class.cs:
14716           - added method Report28 (warning: program has more than one entry point)
14717           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14718           - modified method Method.Define, the part at the end of the method
14719
14720         * rootcontext.cs: added static public Location EntryPointLocation;
14721           
14722         * ../errors/cs0028.cs : Add test case for the above warning.              
14723
14724         * typemanager.cs:
14725           - modified method CSharpName to allow arrays of primitive type to
14726             be printed nicely (e.g. instead of System.Int32[][] it now prints
14727             int[][])
14728           - added method CSharpSignature: returns the signature of a method
14729             in string format to be used in reporting errors, warnings, etc.
14730
14731         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14732         with String.Empty.
14733
14734 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14735
14736         * delegate.cs (Define): Fix extremely silly bug where I was
14737         setting the type of the 'object' parameter of the BeginInvoke
14738         method to System.IAsyncResult instead of System.Object ;-)
14739
14740 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14741
14742         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14743         here. 
14744
14745         (Constructor.Emit): return if we fail to initialize the
14746         constructor.  Another door closed!  
14747
14748         * expression.cs (New.DoResolve): Improve error message (from -6 to
14749         1501).  Use DeclaredOnly lookup to find the exact constructor.
14750
14751         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14752         loop.  This is useful.
14753
14754         * cs-parser.jay: Adjust the default parameters so that destructors
14755         have the proper signature.
14756
14757 2002-04-26  Martin Baulig  <martin@gnome.org>
14758
14759         * driver.cs (LoadAssembly): If `assembly' contains any characters
14760         which are only valid in path names and not in assembly names
14761         (currently slash, backslash and point), use Assembly.LoadFrom ()
14762         instead of Assembly.Load () on the `assembly' (before iteration
14763         over the link_paths).
14764
14765 2002-04-26  Martin Baulig  <martin@gnome.org>
14766
14767         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14768
14769 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14770
14771         * class.cs (Property): use the new typemanager.MemberLookup
14772
14773         (TypeContainer.MemberLookup): Implement using the
14774         TypeManager.MemberLookup now. 
14775
14776         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14777         and return MemberInfos, so that these can be used without an
14778         EmitContext (what we had before).
14779
14780 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14781
14782         * expression.cs: Fix the case where the argument to params if the
14783         type of the params.  I omitted handling this before.   Fixed
14784
14785 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14786
14787         * driver.cs: Call BootCorlib_PopulateCoreType
14788
14789         * class.cs (Property.CheckBase): Check for properties only, not
14790         for all members. 
14791
14792         * interface.cs: Temporary hack: try/catch around the
14793         CustomAttributeBuilder, because I am getting an exception that I
14794         do not understand.
14795
14796         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14797         types whose definitions are required to be there (attributes are
14798         defined before standard types).
14799
14800         Compute definitions as we boot the various types, as they are used
14801         immediately (value_type class will need object_type, but if we do
14802         not initialize object_type, we will pass a null, which will let
14803         the runtime pick the System.Object from the existing corlib, which
14804         is not what we want).
14805
14806 2002-04-22  Patrik Torstensson <totte@labs2.com>
14807
14808         * cs-tokenizer.cs: fixed a number of trim() issues.
14809
14810 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14811
14812         * expression.cs (Argument.Type): Ensure that we return the correct
14813         type when we have out or ref parameters [in which case we 
14814         append a "&"].
14815
14816 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14817
14818         * class.cs (Property, Indexer): Allow extern modifier in there. 
14819
14820         * typemanager.cs (InitBaseTypes): Initializes object_type and
14821         value_type, since those will be used early on during the bootstrap
14822         process to compile corlib.
14823
14824         (InitCoreTypes): Move code from here to InitBaseTypes.
14825
14826 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14827
14828         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14829         single-dimension arrays as using the ldlen opcode.  
14830
14831         Daniel Lewis discovered this optimization.  
14832
14833         * typemanager.cs: Add signature for System.Array::get_Length
14834
14835 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14836
14837         * statement.cs: report the error when the foreach does not apply to an
14838         array nor a collection.
14839
14840 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14841
14842         * expression.cs: Add implicit conversions to the operator ~.
14843
14844         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14845
14846         * typemanager.cs: Locate the decimal constructor.
14847
14848 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14849
14850         * attribute.cs: use the new property of TypeOf.
14851         * expression.cs: added 'get' property around typearg.
14852
14853         These changes fix a build breaker reported by NickD. Is this the
14854         correct way to fix?  If not, please, revert my changes and make it
14855         work :-).
14856
14857 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14858
14859         * attribute.cs: Add support for typeof in attribute invocations.
14860         I am not sure that this is right though.
14861
14862 2002-04-14  Duncan Mak  <duncan@ximian.com>
14863
14864         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14865         Binary.Operator.Division case.
14866
14867 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14868
14869         * class.cs (DefineType): Ensure that we do a proper check on
14870         attribute types and also register it with the TypeManager.
14871
14872         (TypeContainer.Targets): The default for attribute types is
14873         AttributeTargets.All.
14874
14875         * attribute.cs (ApplyAttributes): Registering the attribute type
14876         is done elsewhere, not when we discover we have a Usage attribute.
14877
14878 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14879
14880         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14881         and get rid of is_delegate parameter.
14882
14883         * everywhere : update.
14884
14885 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14886
14887         * cs-parser.jay (compilation_unit): Revamp completely to use
14888         some new ideas that I got from Rhys' grammar to solve the problems
14889         with assembly level attributes.
14890
14891         (outer_declaration): New grammar production.
14892
14893         (attribute_sections): Add.
14894
14895         (opt_attributes): Base on attribute_sections
14896
14897         (namespace_declaration): Allow opt_attributes to tackle the case
14898         when we have assembly level attributes - we are clever in this
14899         regard now ;-)
14900
14901         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14902         attributes in the non-global context.
14903
14904         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14905         instead of SetGlobalAttributes.
14906
14907         * class.cs, rootcontext.cs : Ensure we define and generate 
14908         attribute types before anything else.
14909
14910         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14911         and flag the new error -20 for the case when the attribute type
14912         does not have valid targets specified. csc does not catch this.
14913
14914         * ../errors/errors.txt : update for error # -20
14915
14916 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14917
14918         * support.cs (InternalParameters.ParameterModifier): Do some null
14919         checking and return sane values.
14920
14921         * class.cs (Method.Define): If we are a PInvoke method, ensure
14922         that we are static and extern. Report error # 601
14923
14924         * ../errors/cs0601.cs : Add test case for the above error.
14925
14926 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14927
14928         * rootcontext.cs (attribute_types): We need to keep type of
14929         all attribute types separately and emit code for them first.
14930
14931         (RegisterAttribute) : Implement.
14932
14933         * class.cs (DefineType): Check if the current Type is a custom
14934         attribute type and register it accordingly.
14935
14936         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14937         adding the first attribute twice and rename to
14938
14939         (SetGlobalAttributes): this.
14940
14941         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14942         lookups.
14943
14944         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14945         if we are processing global arguments. Hmm, I am unsure of this.
14946
14947 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14948
14949         * expression.cs: added static array of strings to avoid calling
14950         Enum.ToString () for Operator in Binary. Significant recover of
14951         performance.
14952
14953 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14954
14955         * class.cs (FindMembers): Allow the Builders of the various
14956         members to be null.  If they are skip them.  This only happens
14957         during the PInvoke declaration.
14958
14959 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14960
14961         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14962         failure, so we do not keep going afterwards.
14963
14964         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14965         wanted to pass `false' as the `is_delegate' argument.  If this is
14966         the case, why not use delegate_type == null to mean `is_delegate =
14967         false' and anything else as is_delegate = true.
14968
14969 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14970
14971         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14972         code for the section, not the beginning of the tests.
14973
14974 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14975
14976         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14977
14978         * expression.cs (Binary): same.  Warn about errors where we have
14979         Enum/Enum in operator + as well.
14980
14981 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14982
14983         * statement.cs:
14984                 - added support for switch(bool)
14985                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14986                 - add TableSwitchEmit() to handle table-based switch statements
14987
14988 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14989
14990         * expression.cs (Invocation.OverloadResolve): Factor out code which
14991         does parameter compatibility checking with arguments so that we can 
14992         re-use the code even from Delegate.VerifyApplicability
14993
14994         (VerifyArgumentsCompat): Move above code here.
14995
14996         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14997         and instead make a call to the above method.
14998
14999 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15000
15001         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15002         We use it to keep track of classes which are attribute types.
15003
15004 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15005
15006         * delegate.cs (Delegate.Define): Correctly define the types in the
15007         presence of fixed and array parameters.
15008
15009         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15010         doing FindMembers.
15011
15012         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15013         include NonPublic after the first iteration.
15014
15015         * class.cs (Indexer.CheckBase): Only check if both parents are
15016         non-null. 
15017
15018         * cs-parser.jay (accessor_body): If empty, set to null.
15019
15020         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15021         same code path here to resolve constants names that we did have in
15022         MemberAccess.DoResolve.  There is too much code duplicated here.
15023
15024 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15025
15026         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15027
15028         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15029         to MakeUnionSet.
15030
15031         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15032         tokens, numbers and strings.
15033
15034         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15035         parenthesis.
15036
15037         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15038         asyncronous parameters and the regular parameters.  
15039
15040         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15041         specify the target directory.
15042
15043         * expression.cs: (This.DoResolve): Simplify
15044         (As.Emit): Optimize, do not generate IsInst if the expression is
15045         always of the given type.
15046
15047         (Is.DoResolve): Bug fix, we were reporting both always/never for
15048         the is expression.
15049
15050         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15051         creating too many unnecessary arrays.
15052
15053 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15056         fields instead of rolling our own initializer.   Takes care of all
15057         implicit conversions, and drops unnecessary static checks/argument.
15058
15059 2002-03-31  Dick Porter  <dick@ximian.com>
15060
15061         * driver.cs: use the GetDirectories() return values properly, and
15062         use "/" as path separator.
15063
15064 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15065
15066         * expression.cs (Unary): Optimize - - expr into expr.
15067         (Binary): Optimize a + (-b) into a -b.
15068
15069         * codegen.cs (CodeGen): Made all methods static.
15070
15071 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15072
15073         * rootcontext.cs: 
15074
15075         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15076         TypeBuilder property.
15077
15078         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15079         instead. 
15080
15081         * tree.cs: Removed the various RecordXXXX, and replaced with a
15082         single RecordDecl.  Removed all the accessor methods, and just
15083         left a single access point Type 
15084
15085         * enum.cs: Rename DefineEnum to DefineType.
15086
15087         * decl.cs: New abstract method `DefineType' used to unify the
15088         Defines for Enumerations, Interfaces, TypeContainers and
15089         Delegates.
15090
15091         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15092         LookupBaseClasses method that used to live in class.cs and
15093         interface.cs here, and renamed to FindType.
15094
15095         * delegate.cs: Implement DefineType.  Take advantage of the
15096         refactored pattern for locating the parent builder without taking
15097         the parent_builder argument (which we know does not work if we are
15098         nested, and triggering a toplevel definition).
15099
15100 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15101
15102         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15103         accessibility of a member has changed during override and report
15104         an error if so.
15105
15106         * class.cs (Method.Define, Property.Define): Only complain on
15107         overrides if the method is private, any other accessibility is
15108         fine (and since we just checked the permission is the same, we are
15109         good to go).
15110
15111         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15112         and elif are processed always.  The other pre-processing
15113         directives are only processed if we are "taking" the path
15114
15115 2002-03-29  Martin Baulig  <martin@gnome.org>
15116
15117         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15118         current location is not Null.
15119
15120         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15121         a separate method so we can profile it.
15122
15123         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15124         `span.Seconds' are just seconds, but no minutes or hours.
15125         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15126
15127 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15128
15129         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15130         Remove the gratuitous set of Final:
15131
15132                                 // If an interface implementation, then we can set Final.
15133                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15134                                     implementing.DeclaringType.IsInterface)
15135                                         flags |= MethodAttributes.Final;
15136
15137         I do not know what I was smoking when I used that.
15138
15139
15140         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15141         step into fixing the name resolution issues for delegates and
15142         unifying the toplevel name resolution.
15143
15144 2002-03-28  Martin Baulig  <martin@gnome.org>
15145
15146         * class.cs (Method.Emit): If we have a symbol writer, call its
15147         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15148         tell it about the current method.
15149
15150         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15151         writer that we're going to emit the first byte of IL code for a new
15152         statement (a new source line).
15153         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15154         EmitContext.Mark() before emitting any code.
15155
15156         * location.cs (SymbolDocument): Return null when we're Null.
15157
15158         * statement.cs (Statement): Moved the `Location loc' variable here.
15159         (Statement.EmitBoolExpression): If we have a symbol writer, call
15160         ec.Mark() before emitting any code to tell it that we're at the
15161         beginning of a new statement.
15162         (StatementExpression): Added `Location' argument to the constructor.
15163         (Block): Added public readonly variable `StartLocation' and public
15164         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15165         (Block): Added constructor which takes a start and end location.
15166         (Block.SetEndLocation): New method. This sets the end location.
15167         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15168         local variables we create.
15169         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15170         each statement and do also mark the begin and end of the block.
15171
15172         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15173         tell it the current lexer.Location, use Location.Null for the end of the
15174         block.
15175         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15176         current block, set its end location using SetEndLocation().
15177         (statement_expression): StatementExpression constructor now takes the
15178         lexer.Location as additional argument.
15179         (for_statement, declare_local_variables): Likewise.
15180         (declare_local_variables): When creating a new implicit block, use the
15181         new Block constructor and pass it the lexer.Location.
15182
15183 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15184
15185         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15186         members also on the parent interfaces recursively.
15187
15188 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15189
15190         * report.cs: Use new formats, since Gonzalo finished the missing
15191         bits. 
15192
15193         * expression.cs (Binary.ResolveOperator): added missing operator|
15194         operator& and operator^ for bool/bool.
15195
15196         * cs-parser.jay: CheckDef now takes a Location argument that is
15197         used to report errors more precisly (instead of reporting the end
15198         of a definition, we try to track something which is a lot closer
15199         to the source of the problem).
15200
15201         * cs-tokenizer.cs: Track global token use, so we can properly flag
15202         the use of #define/#undef after the first token has been seen.
15203
15204         Also, rename the reportXXXX to Error_DescriptiveName
15205
15206         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15207         TypeContainer, so that Enum and Interface can use this too.
15208
15209         * class.cs (TypeContainer.LookupInterfaceOrClass,
15210         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15211         `builder' argument.  Typically this was used to pass the parent
15212         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15213         the definition).  
15214
15215         The problem is that a nested class could trigger the definition of
15216         a toplevel class, and the builder would be obviously wrong in that
15217         case. 
15218
15219         So we drop this argument, and we compute dynamically the
15220         TypeBuilder/ModuleBuilder (the correct information was available
15221         to us anyways from DeclSpace.Parent)
15222
15223         * interface.cs (Interface.DefineInterface): Drop builder
15224         parameter cleanup like class.cs
15225
15226         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15227         like class.cs
15228
15229         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15230         values. 
15231
15232         (Try.Emit): Propagate the returns value from the statement.
15233
15234         (Return.Emit): Even if we are leavning 
15235
15236         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15237
15238         * modifiers.cs: Fix the computation of MethodAttributes flags.
15239
15240 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15241
15242         * driver.cs: allow compilation of files that start with '/'.
15243         Add a default case when checking the argument of --target.
15244
15245 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15246
15247         * interface.cs: Implement the same search algorithm for types in
15248         the interface code.
15249
15250         * delegate.cs: Do not allow multiple definition.
15251
15252         * Recovered ChangeLog that got accidentally amputated
15253
15254         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15255
15256         * rootcontext.cs: Load manually enum to allow core classes to
15257         contain enumerations.
15258
15259         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15260         Update to new static methods in TypeManager.
15261
15262         * typemanager.cs (GetMethod, GetConstructor): Use our
15263         implementation of FindMembers to find the members, since during
15264         corlib compilation, the types are TypeBuilders and GetMethod and
15265         GetConstructor do not work.
15266
15267         Make all methods in TypeManager static.
15268
15269         (InitCodeHelpers): Split the functionality from
15270         the InitCodeTypes function.
15271
15272         * driver.cs: Call InitCodeHelpers after we have populated the
15273         types. 
15274
15275         * cs-parser.jay (delegate_declaration): we did not used to compute
15276         the delegate name correctly for void delegates.
15277
15278 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15279
15280         * rootcontext.cs (RootContext): Init the interface_resolve_order
15281         and type_container_resolve_order always.
15282
15283         (ResolveCore, BootstrapCorlib_ResolveClass,
15284         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15285         compiler when compiling with --nostdlib
15286
15287         * class.cs (TypeContainer.DefineType): Check that our parent is
15288         not null.  This test is most important when we are bootstraping
15289         the core types.
15290
15291         * codegen.cs: Split out the symbol writing code.
15292
15293 2002-03-25  Martin Baulig  <martin@gnome.org>
15294
15295         * driver.cs (-g): Made -g an alias for --debug.
15296
15297 2002-03-24  Martin Baulig  <martin@gnome.org>
15298
15299         * codegen.cs (SymbolWriter): New public variable. Returns the
15300         current symbol writer.
15301         (CodeGen): Added `bool want_debugging_support' argument to the
15302          constructor. If true, tell the ModuleBuild that we want debugging
15303         support and ask it for the ISymbolWriter.
15304         (Save): If we have a symbol writer, call it's Close() method after
15305         saving the assembly.
15306
15307         * driver.c (--debug): New command line argument to create a
15308         debugger information file.
15309
15310         * location.cs (SymbolDocument): New public property. Returns an
15311         ISymbolDocumentWriter object for the current source file or null
15312         if we don't have a symbol writer.
15313
15314 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15315
15316         * driver.cs (LoadAssembly): Correctly return when all the paths
15317         have been tried and not before.
15318
15319         * statement.cs (Switch.Emit): return the actual coverage for this
15320         statement (returns/not-returns)
15321
15322         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15323         switch of the statement if we are the last switch section.  That
15324         kills two problems: try/catch problems (we used to emit an empty
15325         nop at the end) and switch statements where all branches would
15326         return. 
15327
15328 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15329
15330         * driver.cs: Add default assemblies (the equivalent to the
15331         Microsoft CSC.RSP file)
15332
15333         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15334         also update tokens_seen and set it to false.
15335
15336         * driver.cs: Implement --recurse for Mike.
15337
15338         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15339         correctly splitting out the paths.
15340
15341 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15342
15343         * interface.cs (Interface.PopulateProperty): Instead of using
15344         `parent' as the declaration space for the set parameters, use
15345         `this' 
15346
15347         * support.cs (InternalParameters): InternalParameters constructor
15348         takes a DeclSpace instead of a TypeContainer.
15349
15350         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15351         types are being initialized, load the address of it before calling
15352         the function.  
15353
15354         (New): Provide a mechanism to disable the generation of local
15355         value type temporaries when the caller will be providing us with
15356         an address to store it.
15357
15358         (ArrayCreation.EmitDynamicInitializers): Use it.
15359
15360 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15361
15362         * expression.cs (Invocation.EmitArguments): Only probe for array
15363         property if there is more than one argument.  Sorry about that.
15364
15365         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15366         empty param arrays.
15367
15368         * class.cs (Method.LabelParameters): Fix incorrect code path that
15369         prevented the `ParamArrayAttribute' from being applied to the
15370         params attribute.
15371
15372 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15373
15374         * support.cs (ReflectionParameters): Correctly compute whether the
15375         last argument is a params array.  Fixes the problem with
15376         string.Split ('a')
15377
15378         * typemanager.cs: Make the assemblies array always be non-null
15379         (empty, but non-null)
15380
15381         * tree.cs (RecordDecl): New function that abstracts the recording
15382         of names.  This reports error 101, and provides a pointer to the
15383         previous declaration.  Fixes a crash in the compiler.
15384
15385         * cs-parser.jay (constructor_declaration): Update to new grammar,
15386         and provide a constructor_body that can be empty.
15387
15388 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15389
15390         * driver.cs: Add support for --resources.
15391
15392         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15393         Make all types for the various array helper methods be integer.
15394
15395         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15396         CheckState to ConvCast.
15397
15398         (ConvCast): Now it takes a `checked' state argument, to avoid
15399         depending on the emit context for the conversion, and just using
15400         the resolve time setting.
15401
15402         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15403         instead of Invocation.EmitArguments.  We do not emit the original
15404         arguments, instead we emit those which have been converted to
15405         unsigned int expressions.
15406
15407         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15408
15409         * codegen.cs: ditto.
15410
15411         * expression.cs (LocalVariableReference): Drop the use of the
15412         Store function that depended on the variable index.
15413
15414         * statement.cs (VariableInfo): Drop the `Idx' property from this
15415         class, as this is not taking into account the indexes for
15416         temporaries tat we generate during the execution, getting the
15417         indexes wrong.
15418
15419         * class.cs: First emit class initializers, then call the parent
15420         constructor. 
15421
15422         * expression.cs (Binary): Fix opcode emision.
15423         (UnaryMutator.EmitCode): Support checked code generation
15424
15425         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15426         matches for events for both the Static and Instance scans,
15427         pointing to the same element.   Fix that.
15428
15429 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15430
15431         * rootcontext.cs (ResolveTree): Always set the
15432         interface_resolve_order, because nested interfaces will be calling
15433         into us.
15434
15435         * class.cs (GetInterfaceOrClass): Track the same resolution
15436         process used by TypeManager.LookupType.  This fixes the nested
15437         type lookups in class declarations (separate path from
15438         LookupType). 
15439
15440         (TypeContainer.DefineType): Also define nested interfaces.
15441         (TypeContainer.RegisterOrder): New public function used to
15442         register the order in which child interfaces need to be closed.
15443
15444         Nested interfaces need to be closed after their parents have been
15445         created. 
15446
15447         * interface.cs (InterfaceAttr): Put all the logic for computing
15448         the interface attribute here. 
15449
15450         (DefineInterface): Register our interface order with the
15451         RootContext or with the TypeContainer depending on the case.
15452
15453 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15454
15455         * cs-parser.jay: rework foreach statement to work with the new
15456         changes to the policy on SimpleNames.
15457
15458         * report.cs: support Stacktrace on warnings as well.
15459
15460         * makefile: drop --unsafe and /unsafe from the compile.
15461
15462 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15463
15464         * ecore.cs (StandardConversionExists): Modify to take an Expression
15465         as the first parameter. Ensure we do null -> reference type conversion
15466         checking.
15467
15468         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15469         temporary Expression objects.
15470
15471 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15472
15473         * interface.cs: workaround bug in method overloading resolution
15474         (there is already a bugzilla bug for it).
15475
15476 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15477
15478         We could also solve this problem by having a separate path for
15479         performing type lookups, instead of DoResolve, we could have a
15480         ResolveType entry point, and only participating pieces of the
15481         production (simplename, deref, array) would implement this. 
15482
15483         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15484         signal SimpleName to only resolve type names and not attempt to
15485         resolve anything else.
15486
15487         * expression.cs (Cast): Set the flag.
15488
15489         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15490
15491         * class.cs: Only report 108 if there is no `new' modifier.
15492
15493         * cs-parser.jay: rework foreach statement to work with the new
15494         changes to the policy on SimpleNames.
15495
15496         * report.cs: support Stacktrace on warnings as well.
15497
15498         * makefile: drop --unsafe and /unsafe from the compile.
15499
15500 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15501
15502         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15503         lookups here, instead of doing that at parse time.  This means
15504         that our grammar will not introduce `LocalVariableReferences' as
15505         expressions at this point.  That solves the problem of code like
15506         this:
15507
15508         class X {
15509            static void Main ()
15510            { int X = 1;
15511             { X x = null }}}
15512
15513         This is only half the fix.  The full fix requires parameters to
15514         also be handled in this way.
15515
15516         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15517         makes the use more obvious of the DeclSpace.  The
15518         ec.TypeContainer.TypeBuilder is now only used to pull the
15519         TypeBuilder for it.
15520
15521         My theory is that I can get rid of the TypeBuilder completely from
15522         the EmitContext, and have typecasts where it is used (from
15523         DeclSpace to where it matters).  
15524
15525         The only pending problem is that the code that implements Aliases
15526         is on TypeContainer, and probably should go in DeclSpace.
15527
15528         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15529         lookups here, instead of doing that at parse time.  This means
15530         that our grammar will not introduce `LocalVariableReferences' as
15531         expressions at this point.  That solves the problem of code like
15532         this:
15533
15534         class X {
15535            static void Main ()
15536            { int X = 1;
15537             { X x = null }}}
15538
15539         This is only half the fix.  The full fix requires parameters to
15540         also be handled in this way.
15541
15542         * class.cs (Property.DefineMethod): When implementing an interface
15543         method, set newslot, when implementing an abstract method, do not
15544         set the flag (before we tried never setting it, or always setting
15545         it, which is the difference).
15546         (Indexer.DefineMethod): same.
15547         (Method.DefineMethod): same.
15548
15549         * ecore.cs: Only set the status used flag if we get back a Field.
15550
15551         * attribute.cs: Temporary hack, so Paolo can keep working.
15552
15553 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15554
15555         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15556         the unmanaged type in the case we have a MarshalAs attribute.
15557
15558         (Resolve): Handle the case when we are parsing the special MarshalAs
15559         attribute [we need to store the unmanaged type to use later]
15560
15561         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15562         MarshalAs Attribute.
15563
15564         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15565         on parameters and accordingly set the marshalling info.
15566
15567 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15568
15569         * class.cs: Optimizing slightly by removing redundant code after
15570         we switched to the `NoTypes' return value.
15571         (Property.DefineMethod): use NoTypes here too.
15572
15573         This fixes the bug I introduced in my last batch of changes.
15574
15575 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15576
15577         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15578
15579         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15580         Enums since those are types too. 
15581
15582         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15583
15584         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15585         thanks to a call during the lookup process.
15586
15587 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15588
15589         * statement.cs (Foreach): Lots of work to accomodate a particular
15590         kind of foreach statement that I had not kept in mind.  It is
15591         possible to have foreachs on classes that provide a GetEnumerator
15592         method that return objects that implement the "pattern" for using
15593         a foreach, there is no need to support GetEnumerator
15594         specifically. 
15595
15596         This is needed to compile nant.
15597
15598         * decl.cs: Only report 114 if the member is not `Finalize' and if
15599         the warning level is at least 2.
15600
15601         * class.cs: Moved the compare function from Method to
15602         MethodSignature. 
15603
15604         (MethodSignature.InheritableMemberSignatureCompare): Add new
15605         filter function that is used to extract inheritable methods from a
15606         class. 
15607
15608         (Method.Define): Use the new `inheritable_method_signature_filter'
15609         delegate
15610
15611         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15612         command. 
15613
15614 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15617
15618         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15619
15620         * expression.cs: Pass location information to
15621         ConvertImplicitStandard. 
15622
15623         * class.cs: Added debugging code to track return values from
15624         interfaces. 
15625
15626 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15627
15628         * expression.cs (Is.DoResolve): If either side of the `is' is an
15629         interface, do not flag the warning.
15630
15631         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15632         for interfaces
15633
15634         * report.cs: Allow for --fatal to be used with --probe.
15635
15636         * typemanager.cs (NoTypes): Move the definition for the empty Type
15637         array here. 
15638
15639         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15640         properties. 
15641         (TypeContainer.DefineProxy): New function used to proxy to parent
15642         implementations when implementing interfaces.
15643         (TypeContainer.ParentImplements): used to lookup if our parent
15644         implements a public function that is required by an interface.
15645         (TypeContainer.VerifyPendingMethods): Hook this up.
15646
15647         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15648         `modules' and `assemblies' arraylists into arrays.  We only grow
15649         these are the very early start up of the program, so this improves
15650         the speedof LookupType (nicely measured).
15651
15652         * expression.cs (MakeByteBlob): Replaced unsafe code with
15653         BitConverter, as suggested by Paolo.
15654
15655         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15656         folding of string concatenation, but if either side is a string,
15657         and the other is not, then return null, and let the runtime use
15658         the concatenation on the string plus the object (using
15659         `Object.ToString'). 
15660
15661 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15662
15663         Constant Folding has been implemented now.
15664
15665         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15666         the error instead on types that are not supported in one's
15667         complement. 
15668
15669         * constant.cs (Constant and all children): New set of functions to
15670         perform implict and explicit conversions.
15671
15672         * ecore.cs (EnumConstant): Implement the new functions to perform
15673         conversion by proxying to the child expression.
15674
15675         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15676         own separate setting that can not be turned off from the command
15677         line using --unchecked or --checked and is only controlled using
15678         the checked/unchecked statements and expressions.  This setting is
15679         used by the constant folder to flag errors.
15680
15681         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15682         ConstantCheckState as well.   
15683
15684         During Resolve, they also have to flag the state, because the
15685         constant folder runs completely in the Resolve phase.
15686
15687         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15688         well.
15689
15690 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15691
15692         * cfold.cs: New file, this file contains the constant folder.
15693
15694         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15695         argument to track whether we are using the resulting address to
15696         load or store a value and provide better error messages. 
15697
15698         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15699         new AddressOf arguments.
15700
15701         * statement.cs (Foreach.EmitCollectionForeach): Update
15702
15703         * expression.cs (Argument.Emit): Call AddressOf with proper
15704         arguments to track usage.
15705
15706         (New.DoEmit): Call AddressOf with new arguments.
15707
15708         (Unary.Emit): Adjust AddressOf call.
15709
15710 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15711
15712         * cs-parser.jay (member_access): Change the case for pre-defined types
15713         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15714         this suggestion.
15715
15716         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15717         a method body.
15718
15719         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15720         essentially like methods and apply attributes like MethodImplOptions to them too.
15721
15722         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15723         not being null.
15724
15725         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15726         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15727         is the DeclSpace.
15728
15729         * Update code everywhere accordingly.
15730
15731         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15732
15733         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15734
15735 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15736
15737         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15738         try performing lookups against those instead of jumping straight into using
15739         the 'using' clauses.
15740
15741         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15742
15743         (LookupType): Perform lookups in implicit parents too.
15744
15745         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15746         sequence as RootContext.LookupType. 
15747
15748         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15749         the various cases of namespace lookups into this method.
15750
15751 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15752
15753         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15754         in positional arguments)
15755
15756         * class.cs (Operator): Update the AllowedModifiers to contain
15757         extern. 
15758
15759         * cs-parser.jay: Update operator declaration to allow for the
15760         operator body to be empty.
15761
15762         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15763         values. 
15764
15765 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15766
15767         * class.cs (Method.Emit): Label parameters.
15768
15769         * driver.cs: Return 1 or 0 as the program exit code.
15770
15771 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15772
15773         * expression.cs: Special case the `null' object when trying to
15774         auto-compute the type, as anything can be explicitly converted to
15775         that. 
15776
15777         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15778         spotting this Paolo.
15779
15780         (Expression.ImplicitNumericConversion): Perform comparissions of
15781         the type using the underlying type in the case of an enumeration
15782         rather than using the enumeration type for the compare.
15783
15784         Cope with the underlying == type case, which is not possible to
15785         catch before. 
15786
15787         (Expression.ConvertNumericExplicit): Perform comparissions of
15788         the type using the underlying type in the case of an enumeration
15789         rather than using the enumeration type for the compare.
15790
15791         * driver.cs: If the user does not supply an extension, assume .exe
15792
15793         * cs-parser.jay (if_statement): Rewrote so that we can track the
15794         location for the if statement.
15795
15796         * expression.cs (Binary.ConstantFold): Only concat strings when
15797         the operation is "+", not everything ;-)
15798
15799         * statement.cs (Statement.EmitBoolExpression): Take a location
15800         argument. 
15801         (If, While, Do): Track location.
15802
15803         * expression.cs (Binary.ResolveOperator): In the object + string
15804         case, I was missing a call to ConvertImplicit
15805
15806 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15807
15808         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15809         Location arguments. Ensure we use RootContext.LookupType to do our work
15810         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15811
15812         * interface.cs (PopulateMethod): Handle the type of the parameter being
15813         null gracefully.
15814
15815         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15816         have a params method with no fixed arguments and a call is made with no
15817         arguments.
15818
15819 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15820
15821         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15822         the verbatim-string-literal
15823
15824         * support.cs (InternalParameters.ParameterModifier): handle null
15825         fixed parameters.
15826         (InternalParameters.ParameterType): ditto.
15827
15828         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15829         duplicating the name of the variable parameter.
15830         (GetParameterByName): Fix bug where we were not looking up array
15831         paramters if they were the only present (thanks Paolo!).
15832         (GetParameterInfo): We only have an empty set of types if both
15833         fixed and array are set to null.
15834         (GetParameterInfo-idx): Handle FixedParameter == null
15835
15836         * cs-parser.jay: Handle the case where there is no catch
15837         statements (missing null test).
15838
15839 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15840
15841         * driver.cs (MainDriver): Be conservative on our command line
15842         handling.
15843
15844         Catch DirectoryNotFoundException when calling GetFiles.
15845
15846         (SplitPathAndPattern): Used to split the input specification into
15847         a path and a pattern that we can feed to Directory.GetFiles.
15848
15849 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15850
15851         * statement.cs (Fixed): Implement the last case of the Fixed
15852         statement (string handling).
15853
15854         * expression.cs (StringPtr): New class used to return a char * to
15855         a string;  Used by the Fixed statement.
15856
15857         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15858
15859         * expression.cs (Binary.ResolveOperator): Remove redundant
15860         MemberLookup pn parent type.
15861         Optimize union call, we do not need a union if the types are the same.
15862         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15863         type.
15864
15865         Specialize the use of MemberLookup everywhere, instead of using
15866         the default settings. 
15867
15868         (StackAlloc): Implement stackalloc keyword.
15869
15870         * cs-parser.jay: Add rule to parse stackalloc.
15871
15872         * driver.cs: Handle /h, /help, /?
15873
15874         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15875         before we supported unsafe code.
15876
15877         * makefile: add --unsafe to the self compilation of mcs.
15878
15879 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15880
15881         * expression.cs (PointerArithmetic): New class that is used to
15882         perform pointer arithmetic.
15883         (Binary.Resolve): Handle pointer arithmetic
15884         Handle pointer comparission.
15885         (ArrayPtr): Utility expression class that is used to take the
15886         address of an array.
15887
15888         (ElementAccess): Implement array access for pointers
15889
15890         * statement.cs (Fixed): Implement fixed statement for arrays, we
15891         are missing one more case before we are done.
15892
15893         * expression.cs (Indirection): Implement EmitAssign and set the
15894         ExprClass to Variable.  This allows pointer dereferences to be
15895         treated as variables, and to have values assigned to them.
15896
15897         * ecore.cs (Expression.StoreFromPtr): New utility function to
15898         store values dereferencing.
15899
15900 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15901
15902         * expression.cs (Binary.ResolveOperator): Ensure that we are
15903         not trying to operate on a void type - this fixes the reported
15904         bug.
15905
15906         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15907         the parent implementation is sealed.
15908
15909         * ../errors/cs0239.cs : Add.
15910
15911         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15912
15913         * typemanager.cs (unverifiable_code_type): Corresponds to 
15914         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15915         which have unsafe code in them.
15916
15917         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15918         unsafe context.
15919
15920 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15921
15922         * cs-tokenizer.cs: Add support for @"litreal strings"
15923
15924         Make tokenizer accept pre-processor directives
15925         on any column (remove the old C-like limitation). 
15926
15927         * rootcontext.cs (EmitCode): Emit any global attributes.
15928         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15929
15930         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15931
15932         * cs-parser.jay: Add support for global attributes.  
15933
15934 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15935
15936         * expression.cs (Indirection): New helper class.  Unary will
15937         create Indirection classes to be able to implement the
15938         IMemoryLocation interface on it.
15939
15940 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * cs-parser.jay (fixed_statement): reference the right statement.
15943
15944         * statement.cs (Fixed.Emit): Finish implementing the fixed
15945         statement for the &x case.
15946
15947 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15948
15949         * class.cs (Property.Define, Method.Define): Remove newslot when
15950         `implementing'.  
15951
15952         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15953         wrong.  NewSlot should only be used if the `new' keyword is present.
15954
15955         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15956         locating our system dir.  Sorry about this.
15957
15958 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * driver.cs (GetSystemDir): Compute correctly the location of our
15961         system assemblies.  I was using the compiler directory instead of
15962         the library directory.
15963
15964 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15965
15966         * expression.cs (BetterFunction): Put back in what Miguel commented out
15967         since it is the correct fix. The problem is elsewhere ;-)
15968
15969         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15970         parameters of the parms method are themselves compatible or not !
15971
15972         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15973         to check that a class implements an interface before saying that an implicit
15974         conversion was allowed. Use ImplementsInterface to do the checking.
15975
15976 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15977
15978         * class.cs (Method.Define): Track whether we are an explicit
15979         implementation or not.  And only call DefineMethodOverride if we
15980         are an explicit implementation.
15981
15982         (Property.DefineMethod): Ditto.
15983
15984 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15985
15986         * expression.cs (BetterFunction): Catch hideous bug which was
15987          preventing us from detecting ambiguous calls due to implicit casts i.e
15988         cs0121.
15989
15990 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15991
15992         * support.cs (Pair): Remove un-needed method.  I figured why I was
15993         getting the error in cs-parser.jay, the variable in a foreach loop
15994         is readonly, and the compiler does not really treat this as a variable.
15995
15996         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15997         instead of EQUALS in grammar.  
15998
15999         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16000
16001         * expression.cs (Unary.DoResolve): Check whether the argument is
16002         managed or not.
16003
16004 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16005
16006         * support.cs: Api for Pair to set a value.  Despite the fact that
16007         the variables are public the MS C# compiler refuses to compile
16008         code that accesses the field if the variable is part of a foreach
16009         statement. 
16010
16011         * statement.cs (Fixed): Begin implementation of the fixed
16012         statement.
16013
16014         (Block.AddVariable): Return the VariableInfo on success and null
16015         on failure instead of true/false. 
16016
16017         * cs-parser.jay (foreach): Catch errors on variables already
16018         defined (we were ignoring this value before) and properly unwind
16019         the block hierarchy
16020
16021         (fixed_statement): grammar for the fixed statement.
16022
16023 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16024
16025         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16026         pointer types to be incretemented.
16027
16028         (SizeOf): Implement.
16029
16030         * cs-parser.jay (pointer_member_access): Implement
16031         expr->IDENTIFIER production.
16032
16033         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16034         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16035         on safe contexts.
16036
16037         (Unary): Implement indirection.
16038
16039         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16040         use in non-unsafe context).
16041
16042         (SimpleName.DoResolve): Check for pointers in field access on safe
16043         contexts. 
16044
16045         (Expression.LoadFromPtr): Factor the load-indirect code in this
16046         function.  This was duplicated in UnboxCast and ParameterReference
16047
16048 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16049
16050         * expression.cs (ComposedCast): report an error if a pointer cast
16051         is used in a safe region.
16052
16053         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16054         pointer type casts in unsafe context.
16055
16056         * codegen.cs (EmitContext): Set up IsUnsafe.
16057
16058         * cs-parser.jay (non_expression_type): Add productions for pointer
16059         casts. 
16060
16061         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16062         code.  We should not use force into static mode if the method is
16063         not virtual.  Fixes bug in MIS
16064
16065         * statement.cs (Do.Emit, While.Emit, For.Emit,
16066         Statement.EmitBoolExpression): Add support to Do and While to
16067         propagate infinite loop as `I do return' semantics.
16068
16069         Improve the For case to also test for boolean constants.
16070
16071         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16072         to the list of attributes we can add.
16073
16074         Remove `EmitContext' argument.
16075
16076         * class.cs (Method.Define): Apply parameter attributes.
16077         (Constructor.Define): Apply parameter attributes.
16078         (MethodCore.LabelParameters): Move here the core of labeling
16079         parameters. 
16080
16081         * support.cs (ReflectionParameters.ParameterModifier,
16082         InternalParameters.ParameterModifier): Use IsByRef on the type and
16083         only return the OUT bit for these parameters instead of in/out/ref
16084         flags.
16085
16086         This is because I miss-understood things.  The ParameterInfo.IsIn
16087         and IsOut represent whether the parameter has the [In] and [Out]
16088         attributes set.  
16089
16090 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16091
16092         * ecore.cs (FieldExpr.Emit): Release temporaries.
16093
16094         * assign.cs (LocalTemporary.Release): new function.
16095
16096         * codegen.cs (EmitContext.GetTemporaryStorage,
16097         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16098         temporary storage.  Now we can "put back" localbuilders when we
16099         are done with them
16100
16101 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16102
16103         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16104         need to make a copy of the variable to generate verifiable code.
16105
16106 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16107
16108         * driver.cs: Compute dynamically the system directory.
16109
16110         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16111         Slower, but more generally useful.  Used by the abstract
16112         registering implementation. 
16113
16114         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16115         the rules for the special rule on Type/instances.  First check if
16116         we have the same name, and if so, try that special static path
16117         rather than the instance path.
16118
16119 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16120
16121         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16122         for, while and if.
16123
16124         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16125         Enum, ValueType, Delegate or Array for non-corlib compiles.
16126
16127         * cs-tokenizer.cs: Catch long identifiers (645)
16128
16129         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16130         piece of code.
16131
16132         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16133         fix, we were returning too early, so we were not registering
16134         pending methods from abstract classes.
16135
16136         Do not register pending methods if the class is abstract.
16137
16138         * expression.cs (Conditional.DoResolve): Report circular implicit
16139         conversions when we neecd to compute it for conditional
16140         expressions. 
16141
16142         (Is.DoResolve): If the expression is always of the provided type,
16143         flag warning 183.  If the expression can not ever be of the
16144         provided type flag warning 184.
16145
16146         * class.cs: Catch 169 as well.
16147
16148         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16149         read. 
16150
16151 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16152
16153         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16154
16155 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16156
16157         * interface.cs: (PopulateMethod): Check for pointers being defined
16158         only if the unsafe context is active.
16159         (PopulateProperty): ditto.
16160         (PopulateIndexer): ditto.
16161
16162         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16163         specified.  If pointers are present, make sure that they are
16164         present in an unsafe context.
16165         (Constructor, Constructor.Define): ditto.
16166         (Field, Field.Define): ditto.
16167         (Property, Property.Define): ditto.
16168         (Event, Event.Define): ditto.
16169
16170         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16171         hashtable if there are classes or structs defined.
16172
16173         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16174         code, as the constant resolution moved.
16175
16176         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16177         the metadata, so we can flag error 133. 
16178
16179         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16180         pointer is being declared in an unsafe context.
16181
16182 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16183
16184         * modifiers.cs (Modifiers.Check): Require a Location argument.
16185         Report error 227 for Unsafe use.
16186
16187         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16188
16189         * statement.cs (For.Emit): If the test is null, then report that
16190         we do `return', as we wont reach anything afterwards.
16191
16192         (Switch.SwitchGoverningType): Track the expression that matched
16193         the conversion.
16194
16195         * driver.cs: Allow negative numbers as an error code to flag.
16196
16197         * cs-parser.jay: Handle 1551.
16198
16199         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16200
16201 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16202
16203         * cs-parser.jay: Report 1518 (type declaration can only contain
16204         class, struct, interface, enum or delegate)
16205
16206         (switch_label): Report 1523 (keywords `case' or `default' must
16207         preced code)
16208
16209         (opt_switch_sections): Report 1522 (empty switch)
16210
16211         * driver.cs: Report 1515 (response file specified multiple times)
16212         Report 1516 (Source file specified multiple times).
16213
16214         * expression.cs (Argument.Resolve): Signal 1510
16215
16216         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16217         access not allowed in static code)
16218
16219 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16220
16221         * typemanager.cs (IsPointerType): Utility method which we are going
16222         to need a lot.
16223
16224         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16225         the object type, so we take care of that.
16226
16227         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16228
16229         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16230         added to non-params parameters :-)
16231
16232         * typemanager.cs (CSharpName): Include 'void' type too. 
16233
16234         (void_ptr_type): Include in the set of core types.
16235
16236         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16237         duplicating code.
16238
16239         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16240         an unsafe context.
16241
16242         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16243         completely forgotten about it.
16244
16245 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16246
16247         * cs-parser.jay (pointer_type): Add. This begins our implementation
16248         of parsing rules for unsafe code.
16249
16250         (unsafe_statement): Implement.
16251
16252         (embedded_statement): Modify to include the above.
16253
16254         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16255
16256         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16257         if the current context is an unsafe one.
16258
16259         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16260         are handled differently, we need separate rules for them.
16261
16262         (local_variable_declaration): Update to use local_variable_pointer_type
16263         to allow variable declarations of unmanaged pointer types.
16264
16265         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16266         in unsafe contexts.
16267
16268         * ../errors/cs0214.cs : Add.
16269
16270 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16271
16272         * makefile: remove 'response' file when cleaning.
16273
16274 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16275
16276         * cs-parser.jay: Report 1524.
16277
16278 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16279
16280         * typemanager.cs (RegisterMethod): drop checking if we have
16281         registered this from here
16282
16283 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16284
16285         * class.cs (Method.EmitDestructor): Implement calling our base
16286         destructor. 
16287
16288         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16289         value of InFinally.
16290
16291         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16292         this routine and will wrap the call in a try/catch block.  Deal
16293         with the case.
16294
16295 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * ecore.cs (Expression.MemberLookup): instead of taking a
16298         parameter `same_type' that was used to tell whether we could
16299         access private members we compute our containing type from the
16300         EmitContext.
16301
16302         (FieldExpr): Added partial support for volatile fields.  This does
16303         not work for volatile fields exposed from assemblies, as I can not
16304         figure out how to extract the modreq from it.
16305
16306         Updated all the source files to use this.
16307
16308         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16309         because it is referenced by MemberLookup very often. 
16310
16311 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16312
16313         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16314         TypeBuilder.GetCustomAttributes to retrieve what we need.
16315
16316         Get rid of redundant default_member_attr_type as this is the same as
16317         default_member_type which already exists.
16318
16319         * interface.cs, attribute.cs : Update accordingly.
16320
16321 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16322
16323         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16324         work for TYpeBuilders though.  Ravi, can you please fix this?
16325
16326         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16327
16328         * expression.cs (Argument.Emit): Handle the case of ref objects
16329         being passed to ref functions;  
16330
16331         (ParameterReference.EmitLoad): Loads the content of the pointer
16332         without dereferencing.
16333
16334 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16335
16336         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16337
16338 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16339
16340         * class.cs (Indexer.DefineMethod): Incorporate the interface
16341         type in the name of the method if we are doing explicit interface
16342         implementation.
16343
16344         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16345
16346         (BetterConversion): Fix extremely trivial bug where we were referring to
16347         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16348         again !
16349
16350         * ../errors/bug16.cs : Add although we have fixed it.
16351
16352 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16353
16354         * expression.cs (BaseIndexer): Begin implementation.
16355
16356         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16357
16358         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16359         production directly to remove a shift/reduce, and implement
16360         explicit interface implementation.
16361
16362         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16363         after a floating point suffix.
16364
16365         * expression.cs (DoNumericPromotions): Improved the conversion for
16366         uint/uint.  If we have a constant, we avoid doing a typecast to a
16367         larger type.
16368
16369         * class.cs (Indexer): Implement explicit interface implementation
16370         for indexers.
16371
16372 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16373
16374         * class.cs: make the default instance constructor public and hidebysig.
16375
16376 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16377
16378         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16379         so we can call it from elsewhere.
16380
16381         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16382         we emit it internally if the class has a defined indexer; otherwise the user
16383         emits it by decorating the class definition with the DefaultMemberAttribute.
16384
16385         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16386         attribute is not used on a type which defines an indexer.
16387
16388         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16389         character when we skip whitespace.
16390
16391         * ../errors/cs0646.cs : Add.
16392
16393 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16394
16395         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16396         again. 
16397
16398         * makefile: Add practical target `mcs3.exe' which builds the third
16399         generation compiler. 
16400
16401         * expression.cs (New): Fix structures constructor calling.
16402
16403         * class.cs (Property, Method, Indexer): Emit Final flag on the
16404         method if we are an interface implementation and we are not
16405         abstract. 
16406
16407         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16408         whether this property is referencing a `base' method.
16409
16410         * expression.cs (Invocation.EmitCall): take an extra argument:
16411         is_base, this is used to determine whether the `call' or
16412         `callvirt' opcode should be used.
16413
16414
16415         * delegate.cs: update EmitCall.
16416
16417         * class.cs (Method.Define): Set NewSlot for the cases where we are
16418         not implementing an interface method.
16419
16420         (Property.Define): ditto.
16421
16422 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16423
16424         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16425         'r'.  Allows mcs to parse itself fully.
16426
16427 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16428
16429         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16430         of the number of initializers that require the InitializeArray method.
16431
16432         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16433         update the above field where necessary.
16434
16435         (MakeByteBlob): Update accordingly.
16436
16437         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16438         greater than 2.
16439
16440         (EmitDynamicInitializers): Update in accordance with the new optimization.
16441
16442         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16443         same OpCode applies.
16444
16445         * cs-parser.jay : Fix some glaring errors I introduced.
16446
16447 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16448
16449         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16450         so that we can check for name clashes there too.
16451
16452         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16453         for interface indexers.
16454
16455         * interfaces.cs (Define): Emit the default member attribute.
16456
16457         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16458         variable was being referred to while setting the value ;-)
16459
16460 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16461
16462         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16463         byte-by-byte information when we know the data is zero.
16464
16465         Make the block always a multiple of 4, because
16466         DefineInitializedData has a bug.
16467
16468         * assign.cs: Fix, we should assign from the temporary, not from
16469         the source. 
16470
16471         * expression.cs (MakeByteBlob): Fix my incorrect code.
16472
16473 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16474
16475         * typemanager.cs (EnumToUnderlying): This function is used to get
16476         the underlying type from an enumeration, because it does not
16477         always work. 
16478
16479         * constant.cs: Use the I4_S form for values between -128 and 127.
16480
16481         * statement.cs (Block.LookupLabel): Looks up a label.
16482         (Block): Drop support for labeled blocks.
16483
16484         (LabeledStatement): New kind of statement that represents a label
16485         only.
16486
16487         (Goto): Finally implement this bad boy.
16488
16489         * cs-parser.jay: Update to reflect new mechanism to implement
16490         labels.
16491
16492 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16493
16494         * codegen.cs (EmitContext.This): a codegen property that keeps the
16495         a single instance of this instead of creating many different this
16496         instances. 
16497
16498         * delegate.cs (Delegate.DoResolve): Update to use the property;
16499
16500         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16501
16502         * expression.cs (BaseAccess.DoResolve): Ditto.
16503
16504 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16505
16506         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16507         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16508
16509         (InitCoreTypes): Update accordingly.
16510
16511         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16512         so we can quickly store the state.
16513
16514         (ApplyAttributes): Set the correct implementation flags
16515         for InternalCall methods.
16516
16517 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16518
16519         * expression.cs (EmitCall): if a method is not virtual, then do
16520         not use callvirt on it.
16521
16522         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16523         user defined stuff) requires the use of stobj, which takes an
16524         address on the stack instead of an array and an index.  So emit
16525         the Ldelema operation for it.
16526
16527         (EmitStoreOpcode): Use stobj for valuetypes.
16528
16529         (UnaryMutator.EmitCode): Use the right 1 value depending on
16530         whether we are dealing with int64/uint64, float or doubles.
16531
16532         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16533         constructors that I implemented last night.
16534
16535         (Constructor.IsDefault): Fix to work properly for static
16536         constructors.
16537
16538         * cs-parser.jay (CheckDef): report method signature errors.
16539         Update error number 103 to be 132.
16540
16541         * decl.cs: New AdditionResult enumeration value: MethodExists.
16542         Although we do this check for methods later on in the semantic
16543         analysis, catching repeated default constructors is so easy that
16544         we catch these here. 
16545
16546         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16547         promotions code.
16548
16549         (ParameterReference.EmitAssign, Emit): handle
16550         bools as bytes.
16551
16552         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16553         (ArrayAccess.EmitStoreOpcode): ditto.
16554
16555         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16556
16557         * expression.cs (MakeByteBlob): Complete all the missing types
16558         (uint, short, ushort, byte, sbyte)
16559
16560         * class.cs: Only init instance field initializers on instance
16561         constructors. 
16562
16563         Rename `constructors' to instance_constructors. 
16564
16565         (TypeContainer.AddConstructor): Only add constructors to the list
16566         if it is not static.
16567
16568         Make sure that we handle default_static_constructor independently
16569         everywhere where we handle instance_constructors
16570
16571 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16572
16573         * class.cs: Do not lookup or create a base initializer for a
16574         static constructor.
16575
16576         (ConstructorInitializer.Resolve): use the proper type to lookup
16577         for constructors.
16578
16579         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16580
16581         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16582         in DeclSpace. 
16583
16584         * decl.cs: CloseType is now an virtual method, the default
16585         implementation just closes this type.
16586
16587 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16588
16589         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16590         to PreserveSig by default. Also emit HideBySig on such methods.
16591
16592         Basically, set the defaults to standard values.
16593
16594         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16595         argument, if candidate is better, it can't be worse than the best !
16596
16597         (Invocation): Re-write bits to differentiate between methods being
16598         applicable in their expanded form and their normal form - for params
16599         methods of course.
16600
16601         Get rid of use_standard everywhere as only standard conversions are allowed
16602         in overload resolution. 
16603
16604         More spec conformance.
16605
16606 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * driver.cs: Add --timestamp, to see where the compiler spends
16609         most of its time.
16610
16611         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16612         `this' in static code.
16613
16614         (SimpleName.DoResolve): Implement in terms of a helper function
16615         that allows static-references to be passed upstream to
16616         MemberAccess.
16617
16618         (Expression.ResolveWithSimpleName): Resolve specially simple
16619         names when called by MemberAccess to implement the special
16620         semantics. 
16621
16622         (Expression.ImplicitReferenceConversion): Handle conversions from
16623         Null to reference types before others, as Null's type is
16624         System.Object. 
16625
16626         * expression.cs (Invocation.EmitCall): Handle the special case of
16627         calling methods declared on a reference type from a ValueType
16628         (Base classes System.Object and System.Enum)
16629
16630         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16631         the left hand side is a TypeExpr, not on every enumeration. 
16632
16633         (Binary.Resolve): If types are reference types, then do a cast to
16634         object on operators != and == of both arguments.
16635
16636         * typemanager.cs (FindMembers): Extract instance and static
16637         members if requested.
16638
16639         * interface.cs (PopulateProperty): Use void_type instead of null
16640         as the return type for the setter method.
16641
16642         (PopulateIndexer): ditto.
16643
16644 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16645
16646         * support.cs (ReflectionParameters): Fix minor bug where we
16647         were examining the wrong parameter for the ParamArray attribute.
16648
16649         Cope with requests for the type of the parameter at position
16650         greater than the params parameter's. We now return the element
16651         type of the params array as that makes more sense.
16652
16653         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16654         accordingly as we no longer have to extract the element type
16655         ourselves.
16656
16657         (Invocation.OverloadResolve): Update.
16658
16659 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16660
16661         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16662         against IEnumerator, test whether the return value is a descendant
16663         of the IEnumerator interface.
16664
16665         * class.cs (Indexer.Define): Use an auxiliary method to implement
16666         the other bits of the method definition.  Begin support for
16667         explicit interface implementation.
16668
16669         (Property.DefineMethod): Use TypeManager.void_type instead of null
16670         for an empty return value.
16671
16672 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16673
16674         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16675         dealing with a FieldExpr which is composed of a FieldBuilder, in
16676         the code path we did extract the constant, but we should have
16677         obtained the underlying value to be able to cast it (otherwise we
16678         end up in an infinite loop, this is what Ravi was running into).
16679
16680         (ArrayCreation.UpdateIndices): Arrays might be empty.
16681
16682         (MemberAccess.ResolveMemberAccess): Add support for section
16683         14.5.4.1 that deals with the special case of E.I when E is a type
16684         and something else, that I can be a reference to a static member.
16685
16686         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16687         handle a particular array type to create byte blobs, it is just
16688         something we dont generate byteblobs for.
16689
16690         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16691         arguments. 
16692
16693         * location.cs (Push): remove the key from the hashtable that we
16694         are about to add.   This happens for empty files.
16695
16696         * driver.cs: Dispose files after we have parsed them.
16697
16698         (tokenize): new function that only runs the tokenizer on its
16699         input, for speed testing.
16700
16701 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16702
16703         * class.cs (Event.Define): Define the private field only if there
16704         are no accessors defined.
16705
16706         * expression.cs (ResolveMemberAccess): If there is no associated
16707         field with the event, that means we have an event defined with its
16708         own accessors and we should flag error cs0070 since transforming
16709         ourselves into a field is not valid in that case.
16710
16711         * ecore.cs (SimpleName.DoResolve): Same as above.
16712
16713         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16714         and charset to sane values.
16715
16716 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16717
16718         * assign.cs (DoResolve): Perform check on events only if they 
16719         are being accessed outside the declaring type.
16720
16721         * cs-parser.jay (event_declarations): Update rules to correctly
16722         set the type of the implicit parameter etc.
16723
16724         (add_accessor, remove_accessor): Set current local parameters.
16725
16726         * expression.cs (Binary): For delegate addition and subtraction,
16727         cast the return value from the method into the appropriate delegate
16728         type.
16729
16730 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16731
16732         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16733         of these as the workaround is unnecessary.
16734
16735         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16736         delegate data - none of that is needed at all.
16737
16738         Re-write bits to extract the instance expression and the delegate method
16739         correctly.
16740
16741         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16742         on delegates too.
16743
16744         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16745         of attaching attributes instead of duplicating code everywhere.
16746
16747         * everywhere : Update code to do attribute emission using the above method.
16748
16749 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16750
16751         * expression.cs (IsParamsMethodApplicable): if there are not
16752         parameters, return immediately.
16753
16754         * ecore.cs: The 0 literal can be implicity converted to an enum
16755         type. 
16756
16757         (SimpleName.DoResolve): First lookup the type, then lookup the
16758         members. 
16759
16760         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16761         want to get its address.  If the InstanceExpression is not
16762         addressable, store the result in a temporary variable, then get
16763         the address of it.
16764
16765         * codegen.cs: Only display 219 errors on warning level or above. 
16766
16767         * expression.cs (ArrayAccess): Make it implement the
16768         IMemoryLocation interface.
16769
16770         (Binary.DoResolve): handle the operator == (object a, object b)
16771         and operator != (object a, object b) without incurring into a
16772         BoxedCast (because 5 != o should never be performed).
16773
16774         Handle binary enumerator operators.
16775
16776         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16777         value type, otherwise use Ldelem_ref.
16778
16779         Use precomputed names;
16780
16781         (AddressOf): Implement address of
16782
16783         * cs-parser.jay (labeled_statement): Fix recursive block
16784         addition by reworking the production.
16785
16786         * expression.cs (New.DoEmit): New has a special case:
16787                 
16788                  If we are dealing with a ValueType, we have a few
16789                  situations to deal with:
16790                 
16791                     * The target of New is a ValueType variable, that is
16792                       easy, we just pass this as the variable reference
16793                 
16794                     * The target of New is being passed as an argument,
16795                       to a boxing operation or a function that takes a
16796                       ValueType.
16797                 
16798                       In this case, we need to create a temporary variable
16799                       that is the argument of New.
16800
16801
16802 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16803
16804         * rootcontext.cs (LookupType): Check that current_type is not null before
16805         going about looking at nested types.
16806
16807         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16808         not implement the IAssignMethod interface any more.
16809
16810         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16811         where we tranform them into FieldExprs if they are being resolved from within
16812         the declaring type.
16813
16814         * ecore.cs (SimpleName.DoResolve): Do the same here.
16815
16816         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16817
16818         * ../errors/bug10.cs : Add.
16819
16820         * ../errors/cs0070.cs : Add.
16821
16822         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16823
16824         * assign.cs : Get rid of EventIsLocal everywhere.
16825
16826 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * ecore.cs (ConvertIntLiteral): finished the implementation.
16829
16830         * statement.cs (SwitchLabel): Convert the value we are using as a
16831         key before looking up the table.
16832
16833 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16834
16835         * codegen.cs (EmitTopBlock): Require a Location argument now.
16836
16837         * cs-parser.jay (constructor_declarator): We need to setup
16838         current_local_parameters before we parse the
16839         opt_constructor_initializer, to allow the variables to be bound
16840         to the constructor arguments.
16841
16842         * rootcontext.cs (LookupType): First lookup nested classes in our
16843         class and our parents before we go looking outside our class.
16844
16845         * expression.cs (ConstantFold): Extract/debox the values at the
16846         beginnning. 
16847
16848         * rootcontext.cs (EmitCode): Resolve the constants first before we
16849         resolve the types.  This is not really needed, but it helps debugging.
16850
16851         * statement.cs: report location.
16852
16853         * cs-parser.jay: pass location to throw statement.
16854
16855         * driver.cs: Small bug fix.
16856
16857         * report.cs: Updated format to be 4-zero filled digits.
16858
16859 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16860
16861         * expression.cs (CheckIndices): Fix minor bug where the wrong
16862         variable was being referred to ;-)
16863
16864         (DoEmit): Do not call EmitStaticInitializers when the 
16865         underlying type is System.Object.
16866
16867 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16868
16869         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16870         and do the usual workaround for SRE.
16871
16872         * class.cs (MyEventBuilder.EventType): New member to get at the type
16873         of the event, quickly.
16874
16875         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16876
16877         * assign.cs (Assign.DoResolve): Handle the case when the target
16878         is an EventExpr and perform the necessary checks.
16879
16880         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16881         interface.
16882
16883         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16884
16885         (EventExpr): Set the type in the constructor itself since we 
16886         are meant to be born fully resolved.
16887
16888         (EventExpr.Define): Revert code I wrote earlier.
16889                 
16890         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16891         instance expression is null. The instance expression is a This in that case
16892         or a null, depending on whether it is a static method or not.
16893
16894         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16895         refers to more than one method.
16896
16897         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16898         and accordingly flag errors.
16899
16900 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16903
16904 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16905
16906         * location.cs (ToString): Provide useful rutine.
16907
16908 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16909
16910         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16911         objects, return the actual integral boxed.
16912
16913         * statement.cs (SwitchLabel): define an ILLabel for each
16914         SwitchLabel. 
16915
16916         (Switch.CheckSwitch): If the value is a Literal, extract
16917         the underlying literal.
16918
16919         Also in the unused hashtable we had, add the SwitchLabel so we can
16920         quickly look this value up.
16921
16922         * constant.cs: Implement a bunch of new constants.  Rewrite
16923         Literal based on this.  Made changes everywhere to adapt to this.
16924
16925         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16926         dereferencing array only once, and also copes with enumrations.
16927
16928         bytes are two bytes wide, not one.
16929
16930         (Cast): Perform constant conversions.
16931
16932         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16933         wrappers to the literals here.
16934
16935         * expression.cs (DoNumericPromotions): long literals can converted
16936         to ulong implicity (this is taken care of elsewhere, but I was
16937         missing this spot).
16938
16939         * ecore.cs (Expression.Literalize): Make the return type Literal,
16940         to improve type checking.
16941
16942         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16943
16944 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16945
16946         * literal.cs: Revert code from ravi that checked the bounds.  The
16947         bounds are sane by the definition of the type itself. 
16948
16949         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16950         need to actually look up in our parent hierarchy for interfaces
16951         implemented. 
16952
16953         * const.cs: Use the underlying type for enumerations
16954
16955         * delegate.cs: Compute the basename for the delegate creation,
16956         that should fix the delegate test case, and restore the correct
16957         Type Lookup semantics in rootcontext
16958
16959         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16960         referencing a nested type with the Reflection API is using the "+"
16961         sign. 
16962
16963         * cs-parser.jay: Do not require EOF token at the end.
16964
16965 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16966
16967         * rootcontext.cs (LookupType): Concatenate type names with
16968         a '.' instead of a '+' The test suite passes again.
16969
16970         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16971         field of the enumeration.
16972
16973         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16974         the case when the member is an EventExpr.
16975
16976         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16977         static has an associated instance expression.
16978
16979         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16980
16981         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16982
16983         * class.cs (Event.Define): Register event and perform appropriate checks
16984         for error #111.
16985
16986         We define the Add and Remove methods even if the use provides none because
16987         in that case, we provide default implementations ourselves.
16988
16989         Define a private field of the type of the event. This is done by the CSC compiler
16990         and we should be doing it too ;-)
16991
16992         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16993         More methods we use in code we generate.
16994
16995         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16996         is important.
16997
16998         (InitCoreTypes): Update accordingly for the above.
16999
17000         * class.cs (Event.Emit): Generate code for default accessors that we provide
17001
17002         (EmitDefaultMethod): Do the job in the above.
17003
17004         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17005         appropriate place.
17006
17007 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17008
17009         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17010         builders even if we were missing one.
17011
17012         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17013         pass the Basename as our class name instead of the Name.  The
17014         basename will be correctly composed for us.
17015
17016         * parameter.cs (Paramters): Now takes a Location argument.
17017
17018         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17019         make all the code call directly LookupType in RootContext and take
17020         this chance to pass the Location information everywhere.
17021
17022         * Everywhere: pass Location information.
17023
17024 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17025
17026         * class.cs (Constructor.Define): Updated way of detecting the
17027         length of the parameters.
17028
17029         (TypeContainer.DefineType): Use basename as the type name for
17030         nested types.
17031
17032         (TypeContainer.Define): Do not recursively define types here, as
17033         definition is taken care in order by the RootContext.
17034
17035         * tree.cs: Keep track of namespaces in a per-file basis.
17036
17037         * parameter.cs (Parameter.ComputeSignature): Update to use
17038         DeclSpace. 
17039
17040         (Parameters.GetSignature): ditto.
17041
17042         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17043         instead of a TypeContainer.
17044
17045         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17046         resolve names.  Because we need to be resolve in our context, not
17047         our parents.
17048
17049         * driver.cs: Implement response files.
17050
17051         * class.cs (TypeContainer.DefineType): If we are defined, do not
17052         redefine ourselves.
17053
17054         (Event.Emit): Emit the code for add/remove handlers.
17055         (Event.Define): Save the MethodBuilders for add/remove.
17056
17057         * typemanager.cs: Use pair here too.
17058
17059         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17060         DictionaryEntry requires the first argument to be non-null.  
17061
17062         (enum_declaration): Compute full name for registering the
17063         enumeration.
17064
17065         (delegate_declaration): Instead of using
17066         formal_parameter_list, use opt_formal_parameter_list as the list
17067         can be empty.
17068
17069         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17070         (EventParsing): New property that controls whether `add' and
17071         `remove' are returned as tokens or identifiers (for events);
17072
17073 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17074
17075         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17076         use MyEventBuilder only and let it wrap the real builder for us.
17077
17078         (MyEventBuilder): Revamp constructor etc.
17079
17080         Implement all operations that we perform on EventBuilder in precisely the same
17081         way here too.
17082
17083         (FindMembers): Update to use the EventBuilder member.
17084
17085         (Event.Emit): Update accordingly.
17086
17087 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17088
17089         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17090         by calling the appropriate methods.
17091
17092         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17093         useful.
17094
17095         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17096
17097 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17098
17099         * delegate.cs (Delegate.Populate): Check that the return type
17100         and various parameters types are indeed accessible.
17101
17102         * class.cs (Constructor.Define): Same here.
17103
17104         (Field.Define): Ditto.
17105
17106         (Event.Define): Ditto.
17107
17108         (Operator.Define): Check that the underlying Method defined itself
17109         correctly - so it's MethodBuilder should not be null.
17110
17111         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17112         expression happens to be null.
17113
17114         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17115         members but as of now we don't seem to be able to do anything really useful with it.
17116
17117         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17118         not the EventBuilder.
17119
17120 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17121
17122         * cs-tokenizer.cs: Add support for defines.
17123         Add support for #if, #elif, #else, #endif
17124
17125         (eval_var): evaluates a variable.
17126         (eval): stubbed for evaluating functions.
17127
17128         * cs-parser.jay: Pass the defines information
17129
17130         * driver.cs: Add --define command line option.
17131
17132         * decl.cs: Move MemberCore here.
17133
17134         Make it the base class for DeclSpace.  This allows us to catch and
17135         report 108 and 109 for everything now.
17136
17137         * class.cs (TypeContainer.Define): Extract all the members
17138         before populating and emit the warning 108 (new keyword required
17139         to override) instead of having each member implement this.
17140
17141         (MemberCore.Define): New abstract method, we will be using this in
17142         the warning reporting engine in Populate.
17143
17144         (Operator.Define): Adjust to new MemberCore protocol. 
17145
17146         * const.cs (Const): This does not derive from Expression, it is a
17147         temporary object we use to create fields, it is a MemberCore. 
17148
17149         * class.cs (Method.Define): Allow the entry point to be in a
17150         specific class.
17151
17152         * driver.cs: Rewrite the argument handler to clean it up a bit.
17153
17154         * rootcontext.cs: Made it just an auxiliary namespace feature by
17155         making everything static.
17156
17157         * driver.cs: Adapt code to use RootContext type name instead of
17158         instance variable.
17159
17160         * delegate.cs: Remove RootContext argument.
17161
17162         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17163         argument. 
17164
17165         * class.cs (Event.Define): The lookup can fail.
17166
17167         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17168
17169         * expression.cs: Resolve the this instance before invoking the code.
17170
17171 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17172
17173         * cs-parser.jay: Add a production in element_access that allows
17174         the thing to become a "type" reference.  This way we can parse
17175         things like "(string [])" as a type.
17176
17177         Note that this still does not handle the more complex rules of
17178         casts. 
17179
17180
17181         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17182
17183         * ecore.cs: (CopyNewMethods): new utility function used to
17184         assemble the list of methods from running FindMembers.
17185
17186         (MemberLookup): Rework FindMembers so that 
17187
17188 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17189
17190         * class.cs (TypeContainer): Remove Delegates who fail to be
17191         defined.
17192
17193         * delegate.cs (Populate): Verify that we dont get null return
17194         values.   TODO: Check for AsAccessible.
17195
17196         * cs-parser.jay: Use basename to emit error 574 (destructor should
17197         have the same name as container class), not the full name.
17198
17199         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17200         possible representation.  
17201
17202         Also implements integer type suffixes U and L.
17203
17204 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17205
17206         * expression.cs (ArrayCreation.DoResolve): We need to do the
17207         argument resolution *always*.
17208
17209         * decl.cs: Make this hold the namespace.  Hold the root context as
17210         well.
17211         (LookupType): Move here.
17212
17213         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17214
17215         * location.cs (Row, Name): Fixed the code, it was always returning
17216         references to the first file.
17217
17218         * interface.cs: Register properties defined through interfaces.
17219
17220         * driver.cs: Add support for globbing on the command line
17221
17222         * class.cs (Field): Make it derive from MemberCore as well.
17223         (Event): ditto.
17224
17225 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17226
17227         * class.cs (Event::Define): Check that the type of the event is a delegate
17228         type else flag error #66.
17229
17230         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17231         same.
17232
17233         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17234         values of EntryPoint, CharSet etc etc.
17235
17236         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17237
17238         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17239         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17240         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17241         which needs this to do its work.
17242
17243         * ../errors/cs0066.cs : Add.
17244
17245 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17246
17247         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17248         helper functions.
17249
17250         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17251         clears out the parameters field.
17252         (MemberSignatureCompare): Cleanup
17253
17254         (MemberCore): New base class used to share code between MethodCore
17255         and Property.
17256
17257         (RegisterRequiredImplementations) BindingFlags.Public requires
17258         either BindingFlags.Instace or Static.  Use instance here.
17259
17260         (Property): Refactored code to cope better with the full spec.
17261
17262         * parameter.cs (GetParameterInfo): Return an empty array instead
17263         of null on error.
17264
17265         * class.cs (Property): Abstract or extern properties have no bodies.
17266
17267         * parameter.cs (GetParameterInfo): return a zero-sized array.
17268
17269         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17270         method modifier validation to the typecontainer so we can reuse
17271         this on properties.
17272
17273         (MethodCore.ParameterTypes): return an empty sized array of types.
17274
17275         (Property.Define): Test property modifier validity.
17276
17277         Add tests for sealed/override too.
17278
17279         (Method.Emit): abstract or extern methods have no bodies.
17280
17281 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17282
17283         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17284         thing.
17285
17286         (Method::Define, ::Emit): Modify accordingly.
17287
17288         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17289
17290         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17291
17292         * makefile: Pass in /unsafe.
17293
17294 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17295
17296         * class.cs (MakeKey): Kill routine.
17297
17298         * class.cs (TypeContainer.Define): Correctly define explicit
17299         method implementations (they require the full interface name plus
17300         the method name).
17301
17302         * typemanager.cs: Deply the PtrHashtable here and stop using the
17303         lame keys.  Things work so much better.
17304
17305         This of course broke everyone who depended on `RegisterMethod' to
17306         do the `test for existance' test.  This has to be done elsewhere.
17307
17308         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17309         the object stupid Equals method (because, that like fails all over
17310         the place).  We still do not use it.
17311
17312         * class.cs (TypeContainer.SetRequiredInterface,
17313         TypeContainer.RequireMethods): Killed these two routines and moved
17314         all the functionality to RegisterRequiredImplementations.
17315
17316         (TypeContainer.RegisterRequiredImplementations): This routine now
17317         registers all the implementations required in an array for the
17318         interfaces and abstract methods.  We use an array of structures
17319         which can be computed ahead of time to reduce memory usage and we
17320         also assume that lookups are cheap as most classes will not
17321         implement too many interfaces.
17322
17323         We also avoid creating too many MethodSignatures.
17324
17325         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17326         clear the "pending" bit if we find that there are problems with
17327         the declaration.
17328
17329         (TypeContainer.VerifyPendingMethods): Update to report errors of
17330         methods that look like implementations but are not.
17331
17332         (TypeContainer.Define): Add support for explicit interface method
17333         implementation. 
17334
17335 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17336
17337         * typemanager.cs: Keep track of the parameters here instead of
17338         being a feature of the TypeContainer.
17339
17340         * class.cs: Drop the registration of parameters here, as
17341         InterfaceMethods are also interface declarations.
17342
17343         * delegate.cs: Register methods with the TypeManager not only with
17344         the TypeContainer.  This code was buggy.
17345
17346         * interface.cs: Full registation here.
17347
17348 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * expression.cs: Remove reducer for binary expressions, it can not
17351         be done this way.
17352
17353         * const.cs: Put here the code that used to go into constant.cs
17354
17355         * constant.cs: Put here the code for constants, this is a new base
17356         class for Literals.
17357
17358         * literal.cs: Make Literal derive from Constant.
17359
17360 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17361
17362         * statement.cs (Return.Emit): Report error 157 if the user
17363         attempts to return from a finally block.
17364
17365         (Return.Emit): Instead of emitting a return, jump to the end of
17366         the function.
17367
17368         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17369         LocalBuilder to store the result of the function.  ReturnLabel is
17370         the target where we jump.
17371
17372
17373 2001-12-09  Radek Doulik  <rodo@ximian.com>
17374
17375         * cs-parser.jay: remember alias in current namespace
17376
17377         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17378         namespaces
17379
17380         * class.cs (LookupAlias): lookup alias in my_namespace
17381
17382         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17383         aliases hashtable
17384         (LookupAlias): lookup alias in this and if needed in parent
17385         namespaces
17386
17387 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17388
17389         * support.cs: 
17390
17391         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17392         making things static.  I need this to avoid passing the
17393         TypeContainer when calling ParameterType.
17394
17395         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17396         that did string manipulation to compute the type and then call
17397         GetType.  Use Parameter.ParameterType instead.
17398
17399         * cs-tokenizer.cs: Consume the suffix for floating values.
17400
17401         * expression.cs (ParameterReference): figure out whether this is a
17402         reference parameter or not.  Kill an extra variable by computing
17403         the arg_idx during emission.
17404
17405         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17406         function that returns whether a parameter is an out/ref value or not.
17407
17408         (Parameter.ParameterType): The type of the parameter (base,
17409         without ref/out applied).
17410
17411         (Parameter.Resolve): Perform resolution here.
17412         (Parameter.ExternalType): The full type (with ref/out applied).
17413
17414         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17415         support for expressions on the using statement.
17416
17417 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17418
17419         * statement.cs (Using.EmitLocalVariableDecls): Split the
17420         localvariable handling of the using statement.
17421
17422         (Block.EmitMeta): Keep track of variable count across blocks.  We
17423         were reusing slots on separate branches of blocks.
17424
17425         (Try.Emit): Emit the general code block, we were not emitting it. 
17426
17427         Check the type of the declaration to be an IDisposable or
17428         something that can be implicity converted to it. 
17429
17430         Emit conversions if required.
17431
17432         * ecore.cs (EmptyExpression): New utility class.
17433         (Expression.ImplicitConversionExists): New utility function.
17434
17435 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17436
17437         * statement.cs (Using): Implement.
17438
17439         * expression.cs (LocalVariableReference): Support read only variables.
17440
17441         * statement.cs: Remove the explicit emit for the Leave opcode.
17442         (VariableInfo): Add a readonly field.
17443
17444 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * ecore.cs (ConvCast): new class used to encapsulate the various
17447         explicit integer conversions that works in both checked and
17448         unchecked contexts.
17449
17450         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17451         properly generate the overflow opcodes.
17452
17453 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17454
17455         * statement.cs: The correct type for the EmptyExpression is the
17456         element_type, not the variable type.  Ravi pointed this out.
17457
17458 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17459
17460         * class.cs (Method::Define): Handle PInvoke methods specially
17461         by using DefinePInvokeMethod instead of the usual one.
17462
17463         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17464         above to do the task of extracting information and defining the method.
17465
17466 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17467
17468         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17469         of the condition for string type.
17470
17471         (Emit): Move that here. 
17472
17473         (ArrayCreation::CheckIndices): Keep string literals in their expression
17474         form.
17475
17476         (EmitDynamicInitializers): Handle strings appropriately.
17477
17478 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17479
17480         * codegen.cs (EmitContext): Replace multiple variables with a
17481         single pointer to the current Switch statement.
17482
17483         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17484         EmitContext.
17485
17486 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17487
17488         * statement.cs 
17489
17490         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17491         default'.
17492
17493         (Foreach.Emit): Foreach on arrays was not setting
17494         up the loop variables (for break/continue).
17495
17496         (GotoCase): Semi-implented.
17497
17498 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17499
17500         * attribute.cs (CheckAttribute): Handle system attributes by using
17501         Attribute.GetAttributes to examine information we need.
17502
17503         (GetValidPlaces): Same here.
17504
17505         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17506
17507         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17508
17509         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17510
17511         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17512
17513         (Method::Emit): Handle the case when we are a PInvoke method.
17514
17515 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17516
17517         * expression.cs: Use ResolveWithSimpleName on compound names.
17518
17519 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17520
17521         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17522         before trying to reduce it.
17523
17524         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17525
17526         * constant.cs (LookupConstantValue): Implement.
17527
17528         (EmitConstant): Use the above in emitting the constant.
17529
17530         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17531         that are user-defined by doing a LookupConstantValue on them.
17532
17533         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17534         too, like above.
17535
17536 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17537
17538         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17539
17540         (BaseAccess.DoResolve): Implement.
17541
17542         (MemberAccess.DoResolve): Split this routine into a
17543         ResolveMemberAccess routine that can be used independently
17544
17545 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17546
17547         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17548         As that share bits of the implementation.  Is returns a boolean,
17549         while As returns the Type that is being probed.
17550
17551 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17552
17553         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17554         instead of a Literal - much easier.
17555
17556         (EnumInTransit): Remove - utterly useless :-)
17557
17558         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17559
17560         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17561
17562         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17563         chain when we have no associated expression.
17564
17565 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17566
17567         * constant.cs (Define): Use Location while reporting the errror.
17568
17569         Also emit a warning when 'new' is used and there is no inherited
17570         member to hide.
17571
17572         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17573         populated.
17574
17575         (LookupEnumValue): Implement to lookup an enum member's value and define it
17576         if necessary.
17577
17578         (Populate): Re-write accordingly to use the above routine.
17579
17580 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17581
17582         * expression.cs (This): Fix prototype for DoResolveLValue to
17583         override the base class DoResolveLValue.
17584
17585         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17586         declarations) 
17587
17588         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17589         (we need to load the address of the field here).  This fixes
17590         test-22. 
17591
17592         (FieldExpr.DoResolveLValue): Call the DoResolve
17593         function to initialize the Instance expression.
17594
17595         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17596         correctly the GetEnumerator operation on a value type.
17597
17598         * cs-parser.jay: Add more simple parsing error catches.
17599
17600         * statement.cs (Switch): Add support for string switches.
17601         Handle null specially.
17602
17603         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17604
17605 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17606
17607         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17608
17609         (declare_local_constant): New helper function.
17610
17611         * statement.cs (AddConstant): Keep a separate record of constants
17612
17613         (IsConstant): Implement to determine if a variable is a constant.
17614
17615         (GetConstantExpression): Implement.
17616
17617         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17618
17619         * statement.cs (IsVariableDefined): Re-write.
17620
17621 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17622
17623         * class.cs (TypeContainer::FindMembers): Look for constants
17624         in the case when we are looking for MemberTypes.Field
17625
17626         * expression.cs (MemberAccess::DoResolve): Check that in the
17627         case we are a FieldExpr and a Literal, we are not being accessed
17628         by an instance reference.
17629
17630         * cs-parser.jay (local_constant_declaration): Implement.
17631
17632         (declaration_statement): Implement for constant declarations.
17633
17634 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17635
17636         * statement.cs (Switch): Catch double defaults.
17637
17638         (Switch): More work on the switch() statement
17639         implementation.  It works for integral values now, need to finish
17640         string support.
17641
17642
17643 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17644
17645         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17646         integer literals into other integer literals.  To be used by
17647         switch. 
17648
17649 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17650
17651         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17652         some memory.
17653
17654         (EmitDynamicInitializers): Cope with the above since we extract data
17655         directly from ArrayData now.
17656
17657         (ExpectInitializers): Keep track of whether initializers are mandatory
17658         or not.
17659
17660         (Bounds): Make it a hashtable to prevent the same dimension being 
17661         recorded for every element in that dimension.
17662
17663         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17664         from being found.
17665
17666         Also fix bug which was causing the indices to be emitted in the reverse
17667         order.
17668
17669 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17670
17671         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17672         unfinished.  They do not work, because the underlying code is
17673         sloppy.
17674
17675 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17676
17677         * cs-parser.jay: Remove bogus fixme.
17678
17679         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17680         on Switch statement.
17681
17682 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17683
17684         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17685         the same. 
17686
17687         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17688         parameter. Apparently, any expression is allowed. 
17689
17690         (ValidateInitializers): Update accordingly.
17691
17692         (CheckIndices): Fix some tricky bugs thanks to recursion.
17693
17694         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17695         I was being completely brain-dead.
17696
17697         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17698         and re-write acordingly.
17699
17700         (DelegateInvocation): Re-write accordingly.
17701
17702         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17703
17704         (MakeByteBlob): Handle types more correctly.
17705
17706         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17707         initialization from expressions but it is incomplete because I am a complete
17708         Dodo :-|
17709
17710 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17711
17712         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17713         on If.  Basically, we have to return `true' (ie, we do return to
17714         our caller) only if both branches of the if return.
17715
17716         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17717         short-circuit operators, handle them as short circuit operators. 
17718
17719         (Cast.DoResolve): Resolve type.
17720         (Cast.Cast): Take an expression as the target type.
17721
17722         * cs-parser.jay (cast_expression): Remove old hack that only
17723         allowed a limited set of types to be handled.  Now we take a
17724         unary_expression and we resolve to a type during semantic
17725         analysis.
17726
17727         Use the grammar productions from Rhys to handle casts (this is
17728         not complete like Rhys syntax yet, we fail to handle that corner
17729         case that C# has regarding (-x), but we will get there.
17730
17731 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17732
17733         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17734         field which is an array type.
17735
17736         * cs-parser.jay (declare_local_variables): Support array initialization too.
17737
17738         * typemanager.cs (MakeKey): Implement.
17739
17740         (everywhere): Use the above appropriately.
17741
17742         * cs-parser.jay (for_statement): Update for array initialization while
17743         declaring variables.
17744
17745         * ecore.cs : The error message was correct, it's the variable's names that
17746         were misleading ;-) Make the code more readable.
17747
17748         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17749         the correct type etc.
17750
17751         (ConvertExplicit): Handle Enum types by examining the underlying type.
17752
17753 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17754
17755         * parameter.cs (GetCallingConvention): Always return
17756         CallingConventions.Standard for now.
17757
17758 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17759
17760         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17761         and `r' after calling DoNumericPromotions.
17762
17763         * ecore.cs: Fix error message (the types were in the wrong order).
17764
17765         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17766         BindingFlags.Instance as well 
17767
17768         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17769         implicit int literal conversion in an empty cast so that we
17770         propagate the right type upstream.
17771
17772         (UnboxCast): new class used to unbox value types.
17773         (Expression.ConvertExplicit): Add explicit type conversions done
17774         by unboxing.
17775
17776         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17777         the target type before applying the implicit LongLiterals to ULong
17778         literal cast.
17779
17780 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17781
17782         * cs-parser.jay (for_statement): Reworked the way For works: now
17783         we declare manually any variables that are introduced in
17784         for_initializer to solve the problem of having out-of-band code
17785         emition (that is what got for broken).
17786
17787         (declaration_statement): Perform the actual variable declaration
17788         that used to be done in local_variable_declaration here.
17789
17790         (local_variable_declaration): Do not declare anything, just pass
17791         the information on a DictionaryEntry
17792
17793 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17794
17795         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17796         re-write of the logic to now make it recursive.
17797
17798         (UpdateIndices): Re-write accordingly.
17799
17800         Store element data in a separate ArrayData list in the above methods.
17801
17802         (MakeByteBlob): Implement to dump the array data into a byte array.
17803
17804 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17805
17806         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17807         into CheckIndices.
17808
17809         * constant.cs (Define): Implement.
17810
17811         (EmitConstant): Re-write fully.
17812
17813         Pass in location info.
17814
17815         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17816         respectively.
17817
17818         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17819         DictionaryEntry since we need location info too.
17820
17821         (constant_declaration): Update accordingly.
17822
17823         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17824         code into another method : UpdateIndices.
17825
17826 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17827
17828         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17829         some type checking etc.
17830
17831 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17832
17833         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17834         bits to provide dimension info if the user skips doing that.
17835
17836         Update second constructor to store the rank correctly.
17837
17838 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17839
17840         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17841         and try to implement.
17842
17843         * ../errors/cs0150.cs : Add.
17844
17845         * ../errors/cs0178.cs : Add.
17846
17847 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17848
17849         * statement.cs: Implement foreach on multi-dimensional arrays. 
17850
17851         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17852         name of the params argument.
17853
17854         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17855         initializing the array.
17856
17857         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17858         we can use this elsewhere.
17859
17860         * statement.cs: Finish implementation of foreach for single
17861         dimension arrays.
17862
17863         * cs-parser.jay: Use an out-of-band stack to pass information
17864         around, I wonder why I need this.
17865
17866         foreach_block: Make the new foreach_block the current_block.
17867
17868         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17869         function used to return a static Parameters structure.  Used for
17870         empty parameters, as those are created very frequently.
17871
17872         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17873
17874 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17875
17876         * interface.cs : Default modifier is private, not public. The
17877         make verify test passes again.
17878
17879 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17880
17881         * support.cs (ReflectionParameters): Fix logic to determine
17882         whether the last parameter is a params one. Test 9 passes again.
17883
17884         * delegate.cs (Populate): Register the builders we define with
17885         RegisterParameterForBuilder. Test 19 passes again.
17886
17887         * cs-parser.jay (property_declaration): Reference $6 instead
17888         of $$ to get at the location.
17889
17890         (indexer_declaration): Similar stuff.
17891
17892         (attribute): Ditto.
17893
17894         * class.cs (Property): Register parameters for the Get and Set methods
17895         if they exist. Test 23 passes again.
17896
17897         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17898         call to EmitArguments as we are sure there aren't any params arguments. 
17899         Test 32 passes again.
17900
17901         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17902         IndexOutOfRangeException. 
17903
17904         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17905         Test 33 now passes again.
17906
17907 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17908
17909         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17910         broke a bunch of things.  Will have to come up with a better way
17911         of tracking locations.
17912
17913         * statement.cs: Implemented foreach for single dimension arrays.
17914
17915 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17916
17917         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17918         an error.  This removes the lookup from the critical path.
17919
17920         * cs-parser.jay: Removed use of temporary_loc, which is completely
17921         broken. 
17922
17923 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17924
17925         * support.cs (ReflectionParameters.ParameterModifier): Report
17926         whether the argument is a PARAMS argument or not.
17927
17928         * class.cs: Set the attribute `ParamArrayAttribute' on the
17929         parameter argument.
17930
17931         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17932         and cons_param_array_attribute (ConstructorInfo for
17933         ParamArrayAttribute)., 
17934
17935         * codegen.cs: Emit the return using the `Return' statement, that
17936         way we can report the error correctly for missing return values. 
17937
17938         * class.cs (Method.Emit): Clean up.
17939
17940         * expression.cs (Argument.Resolve): Take another argument: the
17941         location where this argument is used.  Notice that this is not
17942         part of the "Argument" class as to reduce the size of the
17943         structure (we know the approximate location anyways).
17944
17945         Test if the argument is a variable-reference, if not, then
17946         complain with a 206.
17947
17948         (Argument.Emit): Emit addresses of variables.
17949
17950         (Argument.FullDesc): Simplify.
17951
17952         (Invocation.DoResolve): Update for Argument.Resolve.
17953
17954         (ElementAccess.DoResolve): ditto.
17955
17956         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17957         method should be virtual, as this method is always virtual.
17958
17959         (NewDelegate.DoResolve): Update for Argument.Resolve.
17960
17961         * class.cs (ConstructorInitializer.DoResolve): ditto.
17962
17963         * attribute.cs (Attribute.Resolve): ditto.
17964
17965 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17966
17967         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17968
17969         * expression.cs (ParameterReference): Drop IStackStorage and implement
17970         IAssignMethod instead. 
17971
17972         (LocalVariableReference): ditto.
17973
17974         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17975         IAssignMethod instead. 
17976
17977 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17978
17979         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17980         enumerations that are used in heavily used structures derive from
17981         byte in a laughable and pathetic attempt to reduce memory usage.
17982         This is the kind of pre-optimzations that you should not do at
17983         home without adult supervision.
17984
17985         * expression.cs (UnaryMutator): New class, used to handle ++ and
17986         -- separatedly from the other unary operators.  Cleans up the
17987         code, and kills the ExpressionStatement dependency in Unary.
17988
17989         (Unary): Removed `method' and `Arguments' from this class, making
17990         it smaller, and moving it all to SimpleCall, so I can reuse this
17991         code in other locations and avoid creating a lot of transient data
17992         strucutres when not required.
17993
17994         * cs-parser.jay: Adjust for new changes.
17995
17996 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17997
17998         * enum.cs (Enum.Populate): If there is a failure during
17999         definition, return
18000
18001         * cs-parser.jay (opt_enum_base): we used to catch type errors
18002         here, but this is really incorrect.  The type error should be
18003         catched during semantic analysis.
18004
18005 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18006
18007         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18008         current_local_parameters as expected since I, in my stupidity, had forgotten
18009         to do this :-)
18010
18011         * attribute.cs (GetValidPlaces): Fix stupid bug.
18012
18013         * class.cs (Method::Emit): Perform check on applicability of attributes.
18014
18015         (Constructor::Emit): Ditto.
18016
18017         (Field::Emit): Ditto.
18018
18019         (Field.Location): Store location information.
18020
18021         (Property, Event, Indexer, Operator): Ditto.
18022
18023         * cs-parser.jay (field_declaration): Pass in location for each field.
18024
18025         * ../errors/cs0592.cs : Add.
18026
18027 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18028
18029         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18030
18031         (InitCoreTypes): Update accordingly.
18032
18033         (RegisterAttrType, LookupAttr): Implement.
18034
18035         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18036         info about the same.
18037
18038         (Resolve): Update to populate the above as necessary.
18039
18040         (Error592): Helper.
18041
18042         (GetValidPlaces): Helper to the above.
18043
18044         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18045
18046         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18047
18048 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18049
18050         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18051
18052         * ../errors/cs0617.cs : Add.
18053
18054 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18055
18056         * enum.cs (Emit): Rename to Populate to be more consistent with what
18057         we expect it to do and when exactly it is called.
18058
18059         * class.cs, rootcontext.cs : Update accordingly.
18060
18061         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18062         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18063
18064         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18065
18066         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18067         of a fieldinfo using the above, when dealing with a FieldBuilder.
18068
18069 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18070
18071         * ../errors/cs0031.cs : Add.
18072
18073         * ../errors/cs1008.cs : Add.
18074
18075         * ../errrors/cs0543.cs : Add.
18076
18077         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18078         enum type.
18079
18080         (FindMembers): Implement.
18081
18082         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18083         enums and delegates too.
18084
18085         (enum_types): Rename to builder_to_enum.
18086
18087         (delegate_types): Rename to builder_to_delegate.
18088
18089         * delegate.cs (FindMembers): Implement.
18090
18091 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18092
18093         * typemanager.cs (IsEnumType): Implement.
18094
18095         * enum.cs (Emit): Re-write parts to account for the underlying type
18096         better and perform checking etc.
18097
18098         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18099         of the underlying type.
18100
18101         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18102         value
18103
18104         * enum.cs (error31): Helper to report error #31.
18105
18106         * cs-parser.jay (enum_declaration): Store location of each member too.
18107
18108         * enum.cs (member_to_location): New hashtable. 
18109
18110         (AddEnumMember): Update location hashtable.
18111
18112         (Emit): Use the location of each member while reporting errors.
18113
18114 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18115
18116         * cs-parser.jay: A for_initializer if is a
18117         local_variable_declaration really ammount to have an implicit
18118         block with the variable declaration and no initializer for for.
18119
18120         * statement.cs (For.Emit): Cope with null initializers.
18121
18122         This fixes the infinite loop on for initializers.
18123
18124 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18125
18126         * enum.cs: More cleanup.
18127
18128         * ecore.cs: Remove dead code.
18129
18130         * class.cs (Property.Emit): More simplification.
18131         (Event.Emit): ditto.
18132
18133         Reworked to have less levels of indentation.
18134
18135 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18136
18137         * class.cs (Property): Emit attributes.
18138
18139         (Field): Ditto.
18140
18141         (Event): Ditto.
18142
18143         (Indexer): Ditto.
18144
18145         (Operator): Ditto.
18146
18147         * enum.cs (Emit): Ditto.
18148
18149         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18150         Enums too.
18151
18152         * class.cs (Field, Event, etc.): Move attribute generation into the
18153         Emit method everywhere.
18154
18155         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18156         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18157         as we had no way of defining nested enums !
18158
18159         * rootcontext.cs : Adjust code accordingly.
18160
18161         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18162
18163 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18164
18165         * expression.cs (EvalConstantExpression): Move into ecore.cs
18166
18167         * enum.cs (Enum): Rename some members and make them public and readonly
18168         according to our convention.
18169
18170         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18171         nothing else.
18172
18173         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18174
18175         (Enum::Emit): Write a simple version for now which doesn't try to compute
18176         expressions. I shall modify this to be more robust in just a while.
18177
18178         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18179
18180         (TypeContainer::CloseType): Create the Enum types too.
18181
18182         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18183
18184         * expression.cs (EvalConstantExpression): Get rid of completely.
18185
18186         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18187         user-defined values and other cases.
18188
18189         (IsValidEnumLiteral): Helper function.
18190
18191         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18192         out there in the case we had a literal FieldExpr.
18193
18194         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18195
18196         (Literalize): Revamp a bit to take two arguments.
18197
18198         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18199
18200 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18201
18202         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18203
18204         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18205
18206         (Resolve): Use the above to ensure we have proper initializers.
18207
18208 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18209
18210         * expression.cs (Expression::EvalConstantExpression): New method to 
18211         evaluate constant expressions.
18212
18213         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18214
18215 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18216
18217         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18218         in an array.
18219
18220         (Binary.ResolveOperator): Handle operator != (object a, object b)
18221         and operator == (object a, object b);
18222
18223         (Binary.DoNumericPromotions): Indicate whether the numeric
18224         promotion was possible.
18225
18226         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18227         Implement.  
18228
18229         Made the ArrayAccess implement interface IAssignMethod instead of
18230         IStackStore as the order in which arguments are passed reflects
18231         this.
18232
18233         * assign.cs: Instead of using expr.ExprClass to select the way of
18234         assinging, probe for the IStackStore/IAssignMethod interfaces.
18235
18236         * typemanager.cs: Load InitializeArray definition.
18237
18238         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18239         static data that can be used to initialize arrays. 
18240
18241 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18242
18243         * expression.cs: Handle operator== and operator!= for booleans.
18244
18245         (Conditioal.Reduce): Implement reducer for the ?: operator.
18246
18247         (Conditional.Resolve): Implement dead code elimination.
18248
18249         (Binary.Resolve): Catch string literals and return a new
18250         concatenated string.
18251
18252         (Unary.Reduce): Implement reduction of unary expressions.
18253
18254         * ecore.cs: Split out the expression core handling here.
18255
18256         (Expression.Reduce): New method used to perform constant folding
18257         and CSE.  This is needed to support constant-expressions. 
18258
18259         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18260         targets, and optimize for !x.
18261
18262 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18263
18264         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18265         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18266         set custom atttributes.
18267
18268         * literal.cs (Literal::GetValue): New abstract method to return the actual
18269         value of the literal, cast as an object.
18270
18271         (*Literal): Implement GetValue method.
18272
18273         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18274         expressions to the arraylist but objects of type Argument.
18275
18276         * class.cs (TypeContainer::Emit): Emit our attributes too.
18277
18278         (Method::Emit, Constructor::Emit): Ditto.
18279
18280         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18281         to be ignoring earlier.
18282
18283 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18284
18285         * attribute.cs (AttributeSection::Define): Implement to do the business
18286         of constructing a CustomAttributeBuilder.
18287
18288         (Attribute): New trivial class. Increases readability of code.  
18289
18290         * cs-parser.jay : Update accordingly.
18291
18292         (positional_argument_list, named_argument_list, named_argument): New rules
18293
18294         (attribute_arguments): Use the above so that we are more correct.
18295
18296 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18297
18298         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18299         to perform all checks for a method with a params parameter.
18300
18301         (Invocation::OverloadResolve): Update to use the above method and therefore
18302         cope correctly with params method invocations.
18303
18304         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18305         params too.
18306
18307         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18308         constructors in our parent too because we can't afford to miss out on 
18309         protected ones ;-)
18310
18311         * attribute.cs (AttributeSection): New name for the class Attribute
18312
18313         Other trivial changes to improve readability.
18314
18315         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18316         use the new class names.
18317
18318 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18319
18320         * class.cs (Method::Define): Complete definition for params types too
18321
18322         (Indexer::Define): Ditto.
18323
18324         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18325         Cope everywhere with a request for info about the array parameter.
18326
18327 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18328
18329         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18330
18331         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18332         local_variable_type to extract the string corresponding to the type.
18333
18334         (local_variable_type): Fixup the action to use the new helper method.
18335
18336         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18337         go.
18338
18339         * expression.cs : Clean out code which uses the above.
18340
18341 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18342
18343         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18344         and bale out if necessary by returning a false.
18345
18346         (RegisterProperty): Ditto.
18347
18348         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18349         and print out appropriate error messages.
18350
18351         * interface.cs (everywhere): Ditto.
18352
18353         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18354         location to constructor.
18355
18356         * class.cs (Property, Event, Indexer): Update accordingly.
18357
18358         * ../errors/cs111.cs : Added.
18359
18360         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18361         of a method, as laid down by the spec.
18362
18363         (Invocation::OverloadResolve): Use the above method.
18364
18365 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18366
18367         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18368         now take a TypeContainer and a Parameters object.
18369
18370         (ParameterData): Modify return type of ParameterModifier method to be 
18371         Parameter.Modifier and not a string.
18372
18373         (ReflectionParameters, InternalParameters): Update accordingly.
18374
18375         * expression.cs (Argument::GetParameterModifier): Same here.
18376
18377         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18378         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18379         symbol in it at all so maybe this is only for now.
18380
18381 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18382
18383         * support.cs (InternalParameters): Constructor now takes an extra argument 
18384         which is the actual Parameters class.
18385
18386         (ParameterDesc): Update to provide info on ref/out modifiers.
18387
18388         * class.cs (everywhere): Update call to InternalParameters to pass in
18389         the second argument too.
18390
18391         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18392         to return the modifier info [ref/out etc]
18393
18394         (InternalParameters, ReflectionParameters): Implement the above.
18395
18396         * expression.cs (Argument::ParameterModifier): Similar function to return
18397         info about the argument's modifiers.
18398
18399         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18400         too.
18401
18402         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18403         a new SetFormalParameters object which we pass to InternalParameters.
18404
18405 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18406
18407         * expression.cs (NewArray): Merge into the ArrayCreation class.
18408
18409 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18410
18411         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18412         NewUserdefinedArray into one as there wasn't much of a use in having
18413         two separate ones.
18414
18415         * expression.cs (Argument): Change field's name to ArgType from Type.
18416
18417         (Type): New readonly property which returns the proper type, taking into 
18418         account ref/out modifiers.
18419
18420         (everywhere): Adjust code accordingly for the above.
18421
18422         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18423         whether we are emitting for a ref or out parameter.
18424
18425         * expression.cs (Argument::Emit): Use the above field to set the state.
18426
18427         (LocalVariableReference::Emit): Update to honour the flag and emit the
18428         right stuff.
18429
18430         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18431
18432         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18433
18434         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18435
18436         (ReflectionParameters, InternalParameters): Implement the above method.
18437
18438         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18439         reporting errors.
18440
18441         (Invocation::FullMethodDesc): Ditto. 
18442
18443 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18444
18445         * cs-parser.jay: Add extra production for the second form of array
18446         creation. 
18447
18448         * expression.cs (ArrayCreation): Update to reflect the above
18449         change. 
18450
18451         * Small changes to prepare for Array initialization.
18452
18453 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18454
18455         * typemanager.cs (ImplementsInterface): interface might be null;
18456         Deal with this problem;
18457
18458         Also, we do store negative hits on the cache (null values), so use
18459         this instead of calling t.GetInterfaces on the type everytime.
18460
18461 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18462
18463         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18464
18465         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18466         split functionality out into different classes.
18467
18468         (New::FormArrayType): Move into NewBuiltinArray.
18469
18470         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18471         quite useless.
18472
18473         (NewBuiltinArray): New class to handle creation of built-in arrays.
18474
18475         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18476         account creation of one-dimensional arrays.
18477
18478         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18479
18480         (NewUserdefinedArray::DoResolve): Implement.
18481
18482         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18483
18484         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18485         we maintain inside the TypeManager. This is necessary to perform lookups on the
18486         module builder.
18487
18488         (LookupType): Update to perform GetType on the module builders too.     
18489
18490         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18491
18492         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18493
18494 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18495
18496         * expression.cs (New::DoResolve): Implement guts of array creation.
18497
18498         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18499
18500 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18501
18502         * expression.cs: Fix bug I introduced lsat night that broke
18503         Delegates. 
18504
18505         (Expression.Resolve): Report a 246 error (can not resolve name)
18506         if we find a SimpleName in the stream.
18507
18508         (Expression.ResolveLValue): Ditto.
18509
18510         (Expression.ResolveWithSimpleName): This function is a variant of
18511         ResolveName, this one allows SimpleNames to be returned without a
18512         warning.  The only consumer of SimpleNames is MemberAccess
18513
18514 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18515
18516         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18517         might arrive here.  I have my doubts that this is correct.
18518
18519         * statement.cs (Lock): Implement lock statement.
18520
18521         * cs-parser.jay: Small fixes to support `lock' and `using'
18522
18523         * cs-tokenizer.cs: Remove extra space
18524
18525         * driver.cs: New flag --checked, allows to turn on integer math
18526         checking. 
18527
18528         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18529         Threading.Monitor.Exit 
18530
18531 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18532
18533         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18534         Expression Class to be IndexerAccess.
18535
18536         Notice that Indexer::DoResolve sets the eclass to Value.
18537
18538 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18539
18540         * class.cs (TypeContainer::Emit): Emit code for indexers.
18541
18542         * assign.cs (IAssignMethod): New interface implemented by Indexers
18543         and Properties for handling assignment.
18544
18545         (Assign::Emit): Simplify and reuse code. 
18546
18547         * expression.cs (IndexerAccess, PropertyExpr): Implement
18548         IAssignMethod, clean up old code. 
18549
18550 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18551
18552         * typemanager.cs (ImplementsInterface): New method to determine if a type
18553         implements a given interface. Provides a nice cache too.
18554
18555         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18556         method.
18557
18558         (ConvertReferenceExplicit): Ditto.
18559
18560         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18561         various methods, with correct names etc.
18562
18563         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18564         Operator.UnaryNegation.
18565
18566         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18567         we have a unary plus or minus operator.
18568
18569         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18570         UnaryMinus.
18571
18572         * everywhere : update accordingly.
18573
18574         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18575         respectively.
18576
18577         * class.cs (Method::Define): For the case where we are implementing a method
18578         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18579         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18580
18581 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18582
18583         * interface.cs (FindMembers): Implement to work around S.R.E
18584         lameness.
18585
18586         * typemanager.cs (IsInterfaceType): Implement.
18587
18588         (FindMembers): Update to handle interface types too.
18589
18590         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18591         use IsAssignableFrom as that is not correct - it doesn't work.
18592
18593         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18594         and accordingly override EmitStatement.
18595
18596         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18597         using the correct logic :-)
18598
18599 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18600
18601         * ../errors/cs-11.cs : Add to demonstrate error -11 
18602
18603 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18604
18605         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18606         then pass this as a hint to ResolveLValue.
18607
18608         * expression.cs (FieldExpr): Add Location information
18609
18610         (FieldExpr::LValueResolve): Report assignment to readonly
18611         variable. 
18612
18613         (Expression::ExprClassFromMemberInfo): Pass location information.
18614
18615         (Expression::ResolveLValue): Add new method that resolves an
18616         LValue. 
18617
18618         (Expression::DoResolveLValue): Default invocation calls
18619         DoResolve. 
18620
18621         (Indexers): New class used to keep track of indexers in a given
18622         Type. 
18623
18624         (IStackStore): Renamed from LValue, as it did not really describe
18625         what this did.  Also ResolveLValue is gone from this interface and
18626         now is part of Expression.
18627
18628         (ElementAccess): Depending on the element access type
18629
18630         * typemanager.cs: Add `indexer_name_type' as a Core type
18631         (System.Runtime.CompilerServices.IndexerNameAttribute)
18632
18633         * statement.cs (Goto): Take a location.
18634
18635 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18636
18637         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18638         if two delegates are compatible.
18639
18640         (NewDelegate::DoResolve): Update to take care of the case when
18641         we instantiate a delegate from another delegate.
18642
18643         * typemanager.cs (FindMembers): Don't even try to look up members
18644         of Delegate types for now.
18645
18646 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18647
18648         * delegate.cs (NewDelegate): New class to take care of delegate
18649         instantiation.
18650
18651         * expression.cs (New): Split the delegate related code out into 
18652         the NewDelegate class.
18653
18654         * delegate.cs (DelegateInvocation): New class to handle delegate 
18655         invocation.
18656
18657         * expression.cs (Invocation): Split out delegate related code into
18658         the DelegateInvocation class.
18659
18660 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18661
18662         * expression.cs (New::DoResolve): Implement delegate creation fully
18663         and according to the spec.
18664
18665         (New::DoEmit): Update to handle delegates differently.
18666
18667         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18668         because of which we were printing out arguments in reverse order !
18669
18670         * delegate.cs (VerifyMethod): Implement to check if the given method
18671         matches the delegate.
18672
18673         (FullDelegateDesc): Implement.
18674
18675         (VerifyApplicability): Implement.
18676
18677         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18678         delegate invocations too.
18679
18680         (Invocation::Emit): Ditto.
18681
18682         * ../errors/cs1593.cs : Added.
18683
18684         * ../errors/cs1594.cs : Added.
18685
18686         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18687
18688 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18689
18690         * typemanager.cs (intptr_type): Core type for System.IntPtr
18691
18692         (InitCoreTypes): Update for the same.
18693
18694         (iasyncresult_type, asynccallback_type): Ditto.
18695
18696         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18697         correct.
18698
18699         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18700         too.
18701
18702         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18703         the builders for the 4 members of a delegate type :-)
18704
18705         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18706         type.
18707
18708         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18709
18710         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18711
18712 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18713
18714         * statement.cs (Break::Emit): Implement.   
18715         (Continue::Emit): Implement.
18716
18717         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18718         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18719         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18720         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18721         end loop
18722
18723         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18724         properties that track the label for the current loop (begin of the
18725         loop and end of the loop).
18726
18727 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18728
18729         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18730         use of emitting anything at all.
18731
18732         * class.cs, rootcontext.cs : Get rid of calls to the same.
18733
18734         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18735
18736         (Populate): Define the constructor correctly and set the implementation
18737         attributes.
18738
18739         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18740         have been defined.
18741
18742         (AddDelegateType): Implement.
18743
18744         (IsDelegateType): Implement helper method.
18745
18746         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18747
18748         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18749         and accordingly handle it.
18750
18751         * delegate.cs (Populate): Take TypeContainer argument.
18752         Implement bits to define the Invoke method. However, I still haven't figured out
18753         how to take care of the native int bit :-(
18754
18755         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18756         Qualify the name of the delegate, not its return type !
18757
18758         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18759         conversion.
18760
18761         (StandardConversionExists): Checking for array types turns out to be recursive.
18762
18763         (ConvertReferenceExplicit): Implement array conversion.
18764
18765         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18766
18767 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18768
18769         * cs-parser.jay (delegate_declaration): Store the fully qualified
18770         name as it is a type declaration.
18771
18772         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18773         readonly.
18774
18775         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18776         as TypeContainer::DefineType.
18777
18778         (Populate): Method in which all the definition of the various methods (Invoke)
18779         etc is done.
18780
18781         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18782         see.
18783
18784         (CloseDelegate): Finally creates the delegate.
18785
18786         * class.cs (TypeContainer::DefineType): Update to define delegates.
18787         (Populate, Emit and CloseType): Do the same thing here too.
18788
18789         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18790         delegates in all these operations.
18791
18792 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * expression.cs: LocalTemporary: a new expression used to
18795         reference a temporary that has been created.
18796
18797         * assign.cs: Handle PropertyAccess back here, so that we can
18798         provide the proper semantic access to properties.
18799
18800         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18801         a few more explicit conversions. 
18802
18803         * modifiers.cs: `NEW' modifier maps to HideBySig.
18804
18805         * expression.cs (PropertyExpr): Make this into an
18806         ExpressionStatement, and support the EmitStatement code path. 
18807
18808         Perform get/set error checking, clean up the interface.
18809
18810         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18811         them into toplevel access objects.
18812
18813 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18814
18815         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18816         SRE.
18817
18818         * typemanager.cs: Keep track here of our PropertyBuilders again to
18819         work around lameness in SRE.
18820
18821 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18822
18823         * expression.cs (LValue::LValueResolve): New method in the
18824         interface, used to perform a second resolution pass for LValues. 
18825
18826         (This::DoResolve): Catch the use of this in static methods.
18827
18828         (This::LValueResolve): Implement.
18829
18830         (This::Store): Remove warning, assigning to `this' in structures
18831         is 
18832
18833         (Invocation::Emit): Deal with invocation of
18834         methods on value types.  We need to pass the address to structure
18835         methods rather than the object itself.  (The equivalent code to
18836         emit "this" for structures leaves the entire structure on the
18837         stack instead of a pointer to it). 
18838
18839         (ParameterReference::DoResolve): Compute the real index for the
18840         argument based on whether the method takes or not a `this' pointer
18841         (ie, the method is static).
18842
18843         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18844         value types returned from functions when we need to invoke a
18845         method on the sturcture.
18846
18847
18848 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18849
18850         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18851         defining the type in the Modulebuilder or Typebuilder. This is to take
18852         care of nested types which need to be defined on the TypeBuilder using
18853         DefineNestedMethod.
18854
18855         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18856         methods in RootContext, only ported to be part of TypeContainer.
18857
18858         (TypeContainer::GetInterfaceOrClass): Ditto.
18859
18860         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18861
18862         * interface.cs (Interface::DefineInterface): New method. Does exactly
18863         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18864         too.
18865
18866         (Interface::GetInterfaces): Move from RootContext here and port.
18867
18868         (Interface::GetInterfaceByName): Same here.
18869
18870         * rootcontext.cs (ResolveTree): Re-write.
18871
18872         (PopulateTypes): Re-write.
18873
18874         * class.cs (TypeContainer::Populate): Populate nested types too.
18875         (TypeContainer::Emit): Emit nested members too.
18876
18877         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18878         instead just use the name argument passed in as it is already fully
18879         qualified.
18880
18881         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18882         to TypeContainer mapping to see if a type is user-defined.
18883
18884         * class.cs (TypeContainer::CloseType): Implement. 
18885
18886         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18887         the default constructor.
18888
18889         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18890         twice.
18891
18892         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18893
18894         * interface.cs (CloseType): Create the type here.
18895
18896         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18897         the hierarchy.
18898
18899         Remove all the methods which are now in TypeContainer.
18900
18901 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18902
18903         * delegate.cs (Define): Re-write bits to define the delegate
18904         correctly.
18905
18906 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18909
18910         * expression.cs (ImplicitReferenceConversion): handle null as well
18911         as a source to convert to any reference type.
18912
18913         * statement.cs (Return): Perform any implicit conversions to
18914         expected return type.  
18915
18916         Validate use of return statement.  
18917
18918         * codegen.cs (EmitContext): Pass the expected return type here.
18919
18920         * class.cs (Method, Constructor, Property): Pass expected return
18921         type to EmitContext.
18922
18923 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18924
18925         * expression.cs: Make DoResolve take an EmitContext instead of a
18926         TypeContainer.
18927
18928         Replaced `l' and `location' for `loc', for consistency.
18929
18930         (Error, Warning): Remove unneeded Tc argument.
18931
18932         * assign.cs, literal.cs, constant.cs: Update to new calling
18933         convention. 
18934
18935         * codegen.cs: EmitContext now contains a flag indicating whether
18936         code is being generated in a static method or not.
18937
18938         * cs-parser.jay: DecomposeQI, new function that replaces the old
18939         QualifiedIdentifier.  Now we always decompose the assembled
18940         strings from qualified_identifier productions into a group of
18941         memberaccesses.
18942
18943 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18944
18945         * rootcontext.cs: Deal with field-less struct types correctly now
18946         by passing the size option to Define Type.
18947
18948         * class.cs: Removed hack that created one static field. 
18949
18950 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18951
18952         * statement.cs: Moved most of the code generation here. 
18953
18954 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18955
18956         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18957         seem very right.
18958
18959         (ElementAccess): Remove useless bits for now - keep checks as the spec
18960         says.
18961
18962 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18963
18964         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18965         and start performing checks according to the spec.
18966
18967 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18968
18969         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18970         rank_specifiers instead.
18971
18972         (rank_specifiers): Change the order in which the rank specifiers are stored
18973
18974         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18975
18976         * expression.cs (ElementAccess): Implement the LValue interface too.
18977
18978 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18979
18980         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18981         except that user defined conversions are not included.
18982
18983         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18984         perform the conversion of the return type, if necessary.
18985
18986         (New::DoResolve): Check whether we are creating an array or an object
18987         and accordingly do the needful.
18988
18989         (New::Emit): Same here.
18990
18991         (New::DoResolve): Implement guts of array creation.
18992
18993         (New::FormLookupType): Helper function.
18994
18995 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18996
18997         * codegen.cs: Removed most of the code generation here, and move the
18998         corresponding code generation bits to the statement classes. 
18999
19000         Added support for try/catch/finalize and throw.
19001
19002         * cs-parser.jay: Added support for try/catch/finalize.
19003
19004         * class.cs: Catch static methods having the flags override,
19005         virtual or abstract.
19006
19007         * expression.cs (UserCast): This user cast was not really doing
19008         what it was supposed to do.  Which is to be born in fully resolved
19009         state.  Parts of the resolution were being performed at Emit time! 
19010
19011         Fixed this code.
19012
19013 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19014
19015         * expression.cs: Implicity convert the result from UserCast.
19016
19017 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19018
19019         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19020         prevented it from working correctly. 
19021
19022         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19023         merely ConvertImplicit.
19024
19025 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19026
19027         * typemanager.cs: Make the LookupTypeContainer function static,
19028         and not per-instance.  
19029
19030         * class.cs: Make static FindMembers (the one that takes a Type
19031         argument). 
19032
19033         * codegen.cs: Add EmitForeach here.
19034
19035         * cs-parser.jay: Make foreach a toplevel object instead of the
19036         inline expansion, as we need to perform semantic analysis on it. 
19037
19038 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19039
19040         * expression.cs (Expression::ImplicitUserConversion): Rename to
19041         UserDefinedConversion.
19042
19043         (Expression::UserDefinedConversion): Take an extra argument specifying 
19044         whether we look for explicit user conversions too.
19045
19046         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19047
19048         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19049
19050         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19051         with the appropriate arguments.
19052
19053         * cs-parser.jay (cast_expression): Record location too.
19054
19055         * expression.cs (Cast): Record location info.
19056
19057         (Expression::ConvertExplicit): Take location argument.
19058
19059         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19060         to determine if we are doing explicit conversions.
19061
19062         (UserCast::Emit): Update accordingly.
19063
19064         (Expression::ConvertExplicit): Report an error if everything fails.
19065
19066         * ../errors/cs0030.cs : Add.
19067
19068 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19069
19070         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19071         virtual and newslot bits. 
19072
19073         * class.cs (TypeContainer::RegisterRequiredImplementations):
19074         Record methods we need.
19075
19076         (TypeContainer::MakeKey): Helper function to make keys for
19077         MethodBases, since the Methodbase key is useless.
19078
19079         (TypeContainer::Populate): Call RegisterRequiredImplementations
19080         before defining the methods.   
19081
19082         Create a mapping for method_builders_to_methods ahead of time
19083         instead of inside a tight loop.
19084
19085         (::RequireMethods):  Accept an object as the data to set into the
19086         hashtable so we can report interface vs abstract method mismatch.
19087
19088 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19089
19090         * report.cs: Make all of it static.
19091
19092         * rootcontext.cs: Drop object_type and value_type computations, as
19093         we have those in the TypeManager anyways.
19094
19095         Drop report instance variable too, now it is a global.
19096
19097         * driver.cs: Use try/catch on command line handling.
19098
19099         Add --probe option to debug the error reporting system with a test
19100         suite. 
19101
19102         * report.cs: Add support for exiting program when a probe
19103         condition is reached.
19104
19105 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19106
19107         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19108         we do a forcible conversion regardless of type, to check if 
19109         ForceConversion returns a null.
19110
19111         (Binary::error19): Use location to report error.
19112
19113         (Unary::error23): Use location here too.
19114
19115         * ../errors/cs0019.cs : Check in.
19116
19117         * ../errors/cs0023.cs : Check in.
19118
19119         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19120         case of a non-null MethodInfo object with a length of 0 !
19121
19122         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19123         an applicable member - according to the spec :-)
19124         Also fix logic to find members in base types.
19125
19126         (Unary::ResolveOperator): Same here.
19127
19128         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19129         as I was getting thoroughly confused between this and error19 :-)
19130
19131         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19132         (::FindMostEncompassedType): Implement.
19133         (::FindMostEncompassingType): Implement.
19134         (::StandardConversionExists): Implement.
19135
19136         (UserImplicitCast): Re-vamp. We now need info about most specific
19137         source and target types so that we can do the necessary conversions.
19138
19139         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19140         mathematical union with no duplicates.
19141
19142 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19143
19144         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19145         in order from base classes to child classes, so that we can in
19146         child classes look up in our parent for method names and
19147         attributes (required for handling abstract, virtual, new, override
19148         constructs: we need to instrospect our base class, and if we dont
19149         populate the classes in order, the introspection might be
19150         incorrect.  For example, a method could query its parent before
19151         the parent has any methods and would determine that the parent has
19152         no abstract methods (while it could have had them)).
19153
19154         (RootContext::CreateType): Record the order in which we define the
19155         classes.
19156
19157 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19158
19159         * class.cs (TypeContainer::Populate): Also method definitions can
19160         fail now, keep track of this.
19161
19162         (TypeContainer::FindMembers): Implement support for
19163         DeclaredOnly/noDeclaredOnly flag.
19164
19165         (Constructor::Emit) Return the ConstructorBuilder.
19166
19167         (Method::Emit) Return the MethodBuilder. 
19168         Check for abstract or virtual methods to be public.
19169
19170         * rootcontext.cs (RootContext::CreateType): Register all the
19171         abstract methods required for the class to be complete and the
19172         interface methods that must be implemented. 
19173
19174         * cs-parser.jay: Report error 501 (method requires body if it is
19175         not marked abstract or extern).
19176
19177         * expression.cs (TypeOf::Emit): Implement.
19178
19179         * typemanager.cs: runtime_handle_type, new global type.
19180
19181         * class.cs (Property::Emit): Generate code for properties.
19182
19183 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19184
19185         * expression.cs (Unary::ResolveOperator): Find operators on base type
19186         too - we now conform exactly to the spec.
19187
19188         (Binary::ResolveOperator): Same here.
19189
19190         * class.cs (Operator::Define): Fix minor quirk in the tests.
19191
19192         * ../errors/cs0215.cs : Added.
19193
19194         * ../errors/cs0556.cs : Added.
19195
19196         * ../errors/cs0555.cs : Added.
19197
19198 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19199
19200         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19201         single integer which is really efficient
19202
19203 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19204
19205         *  expression.cs (Expression::ImplicitUserConversion): Use location
19206         even in the case when we are examining True operators.
19207  
19208         * class.cs (Operator::Define): Perform extensive checks to conform
19209         with the rules for operator overloading in the spec.
19210
19211         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19212         some of the other conversions mentioned in the spec.
19213
19214         * typemanager.cs (array_type): New static member for the System.Array built-in
19215         type.
19216
19217         (cloneable_interface): For System.ICloneable interface.
19218
19219         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19220         we start resolving the tree and populating types.
19221
19222         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19223  
19224 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19225
19226         * expression.cs (Expression::ExprClassFromMemberInfo,
19227         Expression::Literalize): Create literal expressions from
19228         FieldInfos which are literals.
19229
19230         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19231         type casts, because they were wrong.  The test suite in tests
19232         caught these ones.
19233
19234         (ImplicitNumericConversion): ushort to ulong requires a widening
19235         cast. 
19236
19237         Int32 constant to long requires widening cast as well.
19238
19239         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19240         for integers because the type on the stack is not i4.
19241
19242 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19243
19244         * expression.cs (report118): require location argument. 
19245
19246         * parameter.cs: Do not dereference potential null value.
19247
19248         * class.cs: Catch methods that lack the `new' keyword when
19249         overriding a name.  Report warnings when `new' is used without
19250         anything being there to override.
19251
19252         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19253
19254         * class.cs: Only add constructor to hashtable if it is non-null
19255         (as now constructors can fail on define).
19256
19257         (TypeManager, Class, Struct): Take location arguments.
19258
19259         Catch field instance initialization in structs as errors.
19260
19261         accepting_filter: a new filter for FindMembers that is static so
19262         that we dont create an instance per invocation.
19263
19264         (Constructor::Define): Catch errors where a struct constructor is
19265         parameterless 
19266
19267         * cs-parser.jay: Pass location information for various new
19268         constructs. 
19269
19270         * delegate.cs (Delegate): take a location argument.
19271
19272         * driver.cs: Do not call EmitCode if there were problesm in the
19273         Definition of the types, as many Builders wont be there. 
19274
19275         * decl.cs (Decl::Decl): Require a location argument.
19276
19277         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19278         into integers, and find the most appropiate integer for it.
19279
19280         * literal.cs: Implement ULongLiteral.
19281
19282         * rootcontext.cs: Provide better information about the location of
19283         failure when CreateType fails.
19284
19285 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19286
19287         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19288         as well.
19289
19290         * expression.cs (Binary::CheckShiftArguments): Add missing type
19291         computation.
19292         (Binary::ResolveOperator): Add type to the logical and and logical
19293         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19294         before.
19295
19296         (Binary::DoNumericPromotions): In the case where either argument
19297         is ulong (and most signed types combined with ulong cause an
19298         error) perform implicit integer constant conversions as well.
19299
19300 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19301
19302         * expression.cs (UserImplicitCast): Method should always be
19303         non-null. 
19304         (Invocation::BetterConversion): Simplified test for IntLiteral.
19305
19306         (Expression::ImplicitNumericConversion): Split this routine out.
19307         Put the code that performs implicit constant integer conversions
19308         here. 
19309
19310         (Expression::Resolve): Become a wrapper around DoResolve so we can
19311         check eclass and type being set after resolve.
19312
19313         (Invocation::Badness): Remove this dead function
19314
19315         (Binary::ResolveOperator): Do not compute the expensive argumnets
19316         unless we have a union for it.
19317
19318         (Probe::Emit): Is needs to do an isinst and then
19319         compare against null.
19320
19321         (::CanConvert): Added Location argument.  If the Location argument
19322         is null (Location.Null), then we do not report errors.  This is
19323         used by the `probe' mechanism of the Explicit conversion.  We do
19324         not want to generate an error for something that the user
19325         explicitly requested to be casted.  But the pipeline for an
19326         explicit cast first tests for potential implicit casts.
19327
19328         So for now, if the Location is null, it means `Probe only' to
19329         avoid adding another argument.   Might have to revise this
19330         strategy later.
19331
19332         (ClassCast): New class used to type cast objects into arbitrary
19333         classes (used in Explicit Reference Conversions).
19334
19335         Implement `as' as well.
19336
19337         Reverted all the patches from Ravi below: they were broken:
19338
19339                 * The use of `level' as a mechanism to stop recursive
19340                   invocations is wrong.  That was there just to catch the
19341                   bug with a strack trace but not as a way of addressing
19342                   the problem.
19343
19344                   To fix the problem we have to *understand* what is going
19345                   on and the interactions and come up with a plan, not
19346                   just get things going.
19347
19348                 * The use of the type conversion cache that I proposed
19349                   last night had an open topic: How does this work across
19350                   protection domains.  A user defined conversion might not
19351                   be public in the location where we are applying the
19352                   conversion, a different conversion might be selected
19353                   (ie, private A->B (better) but public B->A (worse),
19354                   inside A, A->B applies, but outside it, B->A will
19355                   apply).
19356
19357                 * On top of that (ie, even if the above is solved),
19358                   conversions in a cache need to be abstract.  Ie, `To
19359                   convert from an Int to a Short use an OpcodeCast', not
19360                   `To convert from an Int to a Short use the OpcodeCast on
19361                   the variable 5' (which is what this patch was doing).
19362
19363 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19364
19365         * expression.cs (Invocation::ConversionExists): Re-write to use
19366         the conversion cache
19367
19368         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19369         cache all conversions done, not just user-defined ones.
19370
19371         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19372         to determine if a conversion exists instead of acutually trying to 
19373         perform the conversion. It's faster too.
19374
19375         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19376         and only then attempt the implicit conversion.
19377
19378 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19379
19380         * expression.cs (ConvertImplicit): Use a cache for conversions
19381         already found. Check level of recursion and bail out if necessary.
19382
19383 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19384
19385         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19386         Export standard methods that we expect for string operations.
19387
19388         * statement.cs (Block::UsageWarning): Track usage of variables and
19389         report the errors for not used variables.
19390
19391         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19392         operator. 
19393
19394 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19395
19396         * codegen.cs: remove unnneded code 
19397
19398         * expression.cs: Removed BuiltinTypeAccess class
19399
19400         Fix the order in which implicit conversions are
19401         done.  
19402
19403         The previous fixed dropped support for boxed conversions (adding a
19404         test to the test suite now)
19405
19406         (UserImplicitCast::CanConvert): Remove test for source being null,
19407         that code is broken.  We should not feed a null to begin with, if
19408         we do, then we should track the bug where the problem originates
19409         and not try to cover it up here.
19410
19411         Return a resolved expression of type UserImplicitCast on success
19412         rather than true/false.  Ravi: this is what I was talking about,
19413         the pattern is to use a static method as a "constructor" for
19414         objects. 
19415
19416         Also, do not create arguments until the very last minute,
19417         otherwise we always create the arguments even for lookups that
19418         will never be performed. 
19419
19420         (UserImplicitCast::Resolve): Eliminate, objects of type
19421         UserImplicitCast are born in a fully resolved state. 
19422
19423         * typemanager.cs (InitCoreTypes): Init also value_type
19424         (System.ValueType). 
19425
19426         * expression.cs (Cast::Resolve): First resolve the child expression.
19427
19428         (LValue): Add new method AddressOf to be used by
19429         the `&' operator.  
19430
19431         Change the argument of Store to take an EmitContext instead of an
19432         ILGenerator, because things like FieldExpr need to be able to call
19433         their children expression to generate the instance code. 
19434
19435         (Expression::Error, Expression::Warning): Sugar functions for
19436         reporting errors.
19437
19438         (Expression::MemberLookup): Accept a TypeContainer instead of a
19439         Report as the first argument.
19440
19441         (Expression::ResolvePrimary): Killed.  I still want to improve
19442         this as currently the code is just not right.
19443
19444         (Expression::ResolveMemberAccess): Simplify, but it is still
19445         wrong. 
19446
19447         (Unary::Resolve): Catch errors in AddressOf operators.
19448
19449         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19450         index to a byte for the short-version, or the compiler will choose
19451         the wrong Emit call, which generates the wrong data.
19452
19453         (ParameterReference::Emit, ::Store): same.
19454
19455         (FieldExpr::AddressOf): Implement.
19456
19457         * typemanager.cs: TypeManager: made public variable instead of
19458         property.
19459
19460         * driver.cs: document --fatal.
19461
19462         * report.cs (ErrorMessage, WarningMessage): new names for the old
19463         Error and Warning classes.
19464
19465         * cs-parser.jay (member_access): Turn built-in access to types
19466         into a normal simplename
19467
19468 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19469
19470         * expression.cs (Invocation::BetterConversion): Fix to cope
19471         with q being null, since this was introducing a bug.
19472
19473         * expression.cs (ConvertImplicit): Do built-in conversions first.
19474
19475 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19476
19477         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19478
19479 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19480
19481         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19482         I had introduced long ago (what's new ?).
19483
19484         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19485         the work of all the checking. 
19486         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19487         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19488
19489         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19490         that is the right way. 
19491
19492         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19493         overloading resolution. Use everywhere instead of cutting and pasting code.
19494
19495         (Binary::ResolveOperator): Use MakeUnionSet.
19496
19497         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19498         we have to convert to bool types. Not complete yet.
19499
19500 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19501
19502         * typemanager.cs (TypeManager::CSharpName): support ushort.
19503
19504         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19505         to provide an expression that performsn an implicit constant int
19506         conversion (section 6.1.6).
19507         (Expression::ConvertImplicitRequired): Reworked to include
19508         implicit constant expression conversions.
19509
19510         (Expression::ConvertNumericExplicit): Finished.
19511
19512         (Invocation::Emit): If InstanceExpression is null, then it means
19513         that we perform a call on this.
19514
19515 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * expression.cs (Unary::Emit): Remove some dead code.
19518         (Probe): Implement Resolve and Emit for `is'.
19519         (Expression::ConvertImplicitRequired): Attempt to do constant
19520         expression conversions here.  Maybe should be moved to
19521         ConvertImplicit, but I am not sure.
19522         (Expression::ImplicitLongConstantConversionPossible,
19523         Expression::ImplicitIntConstantConversionPossible): New functions
19524         that tell whether is it possible to apply an implicit constant
19525         expression conversion.
19526
19527         (ConvertNumericExplicit): Started work on explicit numeric
19528         conversions.
19529
19530         * cs-parser.jay: Update operator constants.
19531
19532         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19533         (Parameters::GetSignature): Hook up VerifyArgs here.
19534         (Parameters::VerifyArgs): Verifies that no two arguments have the
19535         same name. 
19536
19537         * class.cs (Operator): Update the operator names to reflect the
19538         ones that the spec expects (as we are just stringizing the
19539         operator names).
19540
19541         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19542         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19543         previous usage did only work for our methods.
19544         (Expression::ConvertImplicit): Handle decimal implicit numeric
19545         conversions as well.
19546         (Expression::InternalTypeConstructor): Used to invoke constructors
19547         on internal types for default promotions.
19548
19549         (Unary::Emit): Implement special handling for the pre/post
19550         increment/decrement for overloaded operators, as they need to have
19551         the same semantics as the other operators.
19552
19553         (Binary::ResolveOperator): ditto.
19554         (Invocation::ConversionExists): ditto.
19555         (UserImplicitCast::Resolve): ditto.
19556
19557 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19558
19559         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19560         operator, return after emitting body. Regression tests pass again !
19561
19562         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19563         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19564         (Invocation::OverloadResolve): Ditto.
19565         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19566
19567         * everywhere : update calls to the above methods accordingly.
19568
19569 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19570
19571         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19572
19573         * expression.cs (ExpressionStatement): New base class used for
19574         expressions that can appear in statements, so that we can provide
19575         an alternate path to generate expression that do not leave a value
19576         on the stack.
19577
19578         (Expression::Emit, and all the derivatives): We no longer return
19579         whether a value is left on the stack or not.  Every expression
19580         after being emitted leaves a single value on the stack.
19581
19582         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19583         facilties of ExpressionStatement if possible.
19584
19585         * cs-parser.jay: Update statement_expression.
19586
19587 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19588
19589         * driver.cs: Change the wording of message
19590
19591 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19592
19593         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19594         the type of the expression to the return type of the method if
19595         we have an overloaded operator match ! The regression tests pass again !
19596         (Unary::ResolveOperator): Ditto.
19597
19598         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19599         to find "op_Implicit", not "implicit" ;-)
19600         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19601         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19602
19603         * everywhere : Correct calls to the above accordingly.
19604
19605         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19606         (ConvertImplicit): Do user-defined conversion if it exists.
19607
19608 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19609
19610         * assign.cs: track location.
19611         (Resolve): Use implicit conversions on assignment.
19612
19613         * literal.cs: Oops.  Not good, Emit of short access values should
19614         pass (Bytes) or the wrong argument will be selected.
19615
19616         * expression.cs (Unary::Emit): Emit code for -expr.
19617
19618         (Unary::ResolveOperator): Handle `Substract' for non-constants
19619         (substract from zero from the non-constants).
19620         Deal with Doubles as well. 
19621
19622         (Expression::ConvertImplicitRequired): New routine that reports an
19623         error if no implicit conversion exists. 
19624
19625         (Invocation::OverloadResolve): Store the converted implicit
19626         expressions if we make them
19627
19628 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19629
19630         * class.cs (ConstructorInitializer): Take a Location argument.
19631         (ConstructorBaseInitializer): Same here.
19632         (ConstructorThisInitializer): Same here.
19633
19634         * cs-parser.jay : Update all calls accordingly.
19635
19636         * expression.cs (Unary, Binary, New): Take location argument.
19637         Update accordingly everywhere.
19638
19639         * cs-parser.jay : Update all calls to the above to take a location
19640         argument.
19641
19642         * class.cs : Ditto.
19643
19644 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19645
19646         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19647         (Invocation::BetterConversion): Same here
19648         (Invocation::ConversionExists): Ditto.
19649
19650         (Invocation::ConversionExists): Implement.
19651
19652 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19653
19654         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19655         Also take an additional TypeContainer argument.
19656
19657         * All over : Pass in TypeContainer as argument to OverloadResolve.
19658
19659         * typemanager.cs (CSharpName): Update to check for the string type and return
19660         that too.
19661
19662         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19663         a given method.
19664
19665 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19666
19667         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19668         (Invocation::BetterFunction): Implement.
19669         (Invocation::BetterConversion): Implement.
19670         (Invocation::ConversionExists): Skeleton, no implementation yet.
19671
19672         Okay, things work fine !
19673
19674 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19675
19676         * typemanager.cs: declare and load enum_type, delegate_type and
19677         void_type. 
19678
19679         * expression.cs (Expression::Emit): Now emit returns a value that
19680         tells whether a value is left on the stack or not.  This strategy
19681         might be reveted tomorrow with a mechanism that would address
19682         multiple assignments.
19683         (Expression::report118): Utility routine to report mismatches on
19684         the ExprClass.
19685
19686         (Unary::Report23): Report impossible type/operator combination
19687         utility function.
19688
19689         (Unary::IsIncrementableNumber): Whether the type can be
19690         incremented or decremented with add.
19691         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19692         complemented. 
19693         (Unary::ResolveOperator): Implement ++, !, ~,
19694
19695         (Invocation::Emit): Deal with new Emit convetion.
19696
19697         * All Expression derivatives: Updated their Emit method to return
19698         whether they leave values on the stack or not.
19699
19700         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19701         stack for expressions that are statements. 
19702
19703 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19704
19705         * expression.cs (LValue): New interface.  Must be implemented by
19706         LValue objects.
19707         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19708         LValue interface.
19709
19710         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19711         interface for generating code, simplifies the code.
19712
19713 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19714
19715         * expression.cs (everywhere): Comment out return statements in ::Resolve
19716         methods to avoid the warnings.
19717
19718 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19719
19720         * driver.cs (parse): Report error 2001 if we can not open the
19721         source file.
19722
19723         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19724         not resolve it.
19725
19726         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19727         object. 
19728
19729         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19730         otherwise nested blocks end up with the same index.
19731
19732         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19733
19734         * expression.cs:  Instead of having FIXMEs in the Resolve
19735         functions, throw exceptions so it is obvious that we are facing a
19736         bug. 
19737
19738         * cs-parser.jay (invocation_expression): Pass Location information.
19739
19740         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19741         Use a basename for those routines because .NET does not like paths
19742         on them. 
19743
19744         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19745         already defined.
19746
19747 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19748
19749         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19750         are loading the correct data types (throws an exception if not).
19751         (TypeManager::InitCoreTypes): Use CoreLookupType
19752
19753         * expression.cs (Unary::ResolveOperator): return the child
19754         expression for expressions which are just +expr.
19755         (Unary::ResolveOperator): Return negative literals for -LITERAL
19756         expressions (otherwise they are Unary {Literal}).
19757         (Invocation::Badness): Take into account `Implicit constant
19758         expression conversions'.
19759
19760         * literal.cs (LongLiteral): Implement long literal class.
19761         (IntLiteral): export the `Value' of the intliteral. 
19762
19763 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19764
19765         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19766
19767         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19768         instead of 'Operator'
19769
19770         * expression.cs (Binary::ResolveOperator): Update accordingly.
19771         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19772         and 'Minus'
19773
19774         * cs-parser.jay (unary_expression): Update to use the new names.
19775
19776         * gen-treedump.cs (GetUnary): Same here.
19777
19778         * expression.cs (Unary::Resolve): Implement.
19779         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19780         operators are found instead of making noise ;-)
19781         (Unary::ResolveOperator): New method to do precisely the same thing which
19782         Binary::ResolveOperator does for Binary expressions.
19783         (Unary.method, .Arguments): Add.
19784         (Unary::OperName): Implement.   
19785         (Unary::ForceConversion): Copy and Paste !
19786
19787         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19788         a unary operator.
19789
19790         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19791         for the inbuilt operators. Only overloading works for now ;-)
19792
19793 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19796         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19797
19798         * expression.cs (This::Emit): Implement. 
19799         (This::Resolve): Implement.
19800         (TypeOf:Resolve): Implement.
19801         (Expression::ResolveSimpleName): Add an implicit this to instance
19802         field references. 
19803         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19804         Bind instance variable to Field expressions.
19805         (FieldExpr::Instance): New field used to track the expression that
19806         represents the object instance.
19807         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19808         binding 
19809         (FieldExpr::Emit): Implement.
19810
19811         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19812         the last instruction contains a return opcode to avoid generating
19813         the last `ret' instruction (this generates correct code, and it is
19814         nice to pass the peverify output).
19815
19816         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19817         initializer for static and instance variables.
19818         (Constructor::Emit): Allow initializer to be null in the case of
19819         static constructors.  Only emit initializer for instance
19820         constructors. 
19821
19822         (TypeContainer::FindMembers): Return a null array if there are no
19823         matches.
19824
19825         Also fix the code for the MemberTypes.Method branch, as it was not
19826         scanning that for operators (or tried to access null variables before).
19827
19828         * assign.cs (Assign::Emit): Handle instance and static fields. 
19829
19830         * TODO: Updated.
19831
19832         * driver.cs: Stop compilation if there are parse errors.
19833
19834         * cs-parser.jay (constructor_declaration): Provide default base
19835         initializer for non-static constructors.
19836         (constructor_declarator): Do not provide a default base
19837         initializers if none was specified.
19838         Catch the fact that constructors should not have parameters.
19839
19840         * class.cs: Do not emit parent class initializers for static
19841         constructors, that should be flagged as an error.
19842
19843 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19844
19845         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19846         Move back code into TypeContainer::Populate.
19847
19848 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19849
19850         * class.cs (TypeContainer::AddConstructor): Fix the check to
19851         compare against Name, not Basename. 
19852         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19853
19854         * cs-parser.jay : Update accordingly.
19855
19856         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19857         for methods, don't forget to look into the operators too.
19858         (RegisterMethodBuilder): Helper method to take care of this for
19859         methods, constructors and operators.
19860         (Operator::Define): Completely revamp.
19861         (Operator.OperatorMethod, MethodName): New fields.
19862         (TypeContainer::Populate): Move the registering of builders into
19863         RegisterMethodBuilder.
19864         (Operator::Emit): Re-write.
19865
19866         * expression.cs (Binary::Emit): Comment out code path to emit method
19867         invocation stuff for the case when we have a user defined operator. I am
19868         just not able to get it right !
19869
19870 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19871
19872         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19873         argument. 
19874
19875         (Expression::MemberLookup): Provide a version that allows to
19876         specify the MemberTypes and BindingFlags. 
19877
19878         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19879         so it was not fetching variable information from outer blocks.
19880
19881         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19882         Beforefieldinit as it was buggy.
19883
19884         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19885         that Ravi put here.  
19886
19887         * class.cs (Constructor::Emit): Only emit if block is not null.
19888         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19889         deal with this by semantically definining it as if the user had
19890         done it.
19891
19892         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19893         constructors as we now "emit" them at a higher level.
19894
19895         (TypeContainer::DefineDefaultConstructor): Used to define the
19896         default constructors if none was provided.
19897
19898         (ConstructorInitializer): Add methods Resolve and Emit. 
19899
19900         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19901
19902 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19903
19904         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19905         the default constructor builder with our hashtable for methodbuilders
19906         to methodcores.
19907
19908         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19909         and argument_count is 0 in which case we have a match.
19910         (Binary::ResolveOperator): More null checking and miscellaneous coding
19911         style cleanup.
19912
19913 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19914
19915         * rootcontext.cs (IsNameSpace): Compare against null.
19916
19917         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19918
19919         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19920         and Unary::Operator.
19921
19922         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19923         accordingly.
19924
19925         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19926         we have overloaded operators.
19927         (Binary::ResolveOperator): Implement the part which does the operator overload
19928         resolution.
19929
19930         * class.cs (Operator::Emit): Implement.
19931         (TypeContainer::Emit): Emit the operators we have too.
19932
19933         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19934         the case when we have a user-defined operator.
19935
19936 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19937
19938         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19939
19940 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19941
19942         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19943         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19944         (Constructor::Emit): Implement.
19945         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19946         if we have no work to do. 
19947         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19948         Emit method.
19949
19950         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19951         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19952
19953         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19954         of parent.parent.
19955
19956 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19957
19958         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19959         in the source.
19960         (Tree::RecordNamespace): Method to do what the name says ;-)
19961         (Tree::Namespaces): Property to get at the namespaces hashtable.
19962
19963         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19964         keep track.
19965
19966         * rootcontext.cs (IsNamespace): Fixed it :-)
19967
19968 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19969
19970         * class.cs (TypeContainer::FindMembers): Add support for
19971         constructors. 
19972         (MethodCore): New class that encapsulates both the shared aspects
19973         of a Constructor and a Method.  
19974         (Method, Constructor): Factored pieces into MethodCore.
19975
19976         * driver.cs: Added --fatal which makes errors throw exceptions.
19977         Load System assembly as well as part of the standard library.
19978
19979         * report.cs: Allow throwing exceptions on errors for debugging.
19980
19981         * modifiers.cs: Do not use `parent', instead use the real type
19982         container to evaluate permission settings.
19983
19984         * class.cs: Put Ravi's patch back in.  He is right, and we will
19985         have to cope with the
19986
19987 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19988
19989         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19990         FamORAssem, not FamANDAssem.
19991
19992 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19993
19994         * driver.cs: Added --parse option that only parses its input files
19995         and terminates.
19996
19997         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19998         incorrect.  IsTopLevel is not used to tell whether an object is
19999         root_types or not (that can be achieved by testing this ==
20000         root_types).  But to see if this is a top-level *class* (not
20001         necessarly our "toplevel" container). 
20002
20003 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20004
20005         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20006         parent instead of a direct call to GetType.
20007
20008 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20009
20010         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20011         Modifiers.TypeAttr. This should just be a call to that method.
20012
20013         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20014         object so that we can determine if we are top-level or not.
20015
20016         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20017         TypeContainer too.
20018
20019         * enum.cs (Enum::Define): Ditto.
20020
20021         * modifiers.cs (FieldAttr): Re-write.
20022
20023         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20024         (TypeContainer::HaveStaticConstructor): New property to provide access
20025         to precisely that info.
20026
20027         * modifiers.cs (MethodAttr): Re-write.
20028         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20029
20030         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20031         of top-level types as claimed.
20032
20033 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20034
20035         * expression.cs (MemberLookup): Fruitless attempt to lookup
20036         constructors.  Maybe I need to emit default constructors?  That
20037         might be it (currently .NET emits this for me automatically).
20038         (Invocation::OverloadResolve): Cope with Arguments == null.
20039         (Invocation::EmitArguments): new function, shared by the new
20040         constructor and us.
20041         (Invocation::Emit): Handle static and instance methods.  Emit
20042         proper call instruction for virtual or non-virtual invocations.
20043         (New::Emit): Implement.
20044         (New::Resolve): Implement.
20045         (MemberAccess:Resolve): Implement.
20046         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20047         to track instances.
20048         (FieldExpr::Resolve): Set type.
20049
20050         * support.cs: Handle empty arguments.
20051                 
20052         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20053         SimpleLookup): Auxiliary routines to help parse a qualifier
20054         identifier.  
20055
20056         Update qualifier_identifier rule.
20057
20058         * codegen.cs: Removed debugging messages.
20059
20060         * class.cs: Make this a global thing, this acts just as a "key" to
20061         objects that we might have around.
20062
20063         (Populate): Only initialize method_builders_to_methods once.
20064
20065         * expression.cs (PropertyExpr): Initialize type from the
20066         PropertyType. 
20067
20068         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20069         Resolve pattern.  Attempt to implicitly convert value to boolean.
20070         Emit code.
20071
20072         * expression.cs: Set the type for the int32/int32 argument case.
20073         (Binary::ResolveOperator): Set the return type to boolean for
20074         comparission operators
20075
20076         * typemanager.cs: Remove debugging print code.
20077
20078         (Invocation::Resolve): resolve type.
20079
20080         * class.cs: Allocate a MemberInfo of the correct size, as the code
20081         elsewhere depends on the test to reflect the correct contents.
20082
20083         (Method::) Keep track of parameters, due to System.Reflection holes
20084
20085         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20086         mapping here.
20087
20088         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20089         of the exact size and return that.
20090
20091         (Class::LookupMethodByBuilder): New function that maps
20092         MethodBuilders to its methods.  Required to locate the information
20093         on methods because System.Reflection bit us again.
20094
20095         * support.cs: New file, contains an interface ParameterData and
20096         two implementations: ReflectionParameters and InternalParameters
20097         used to access Parameter information.  We will need to grow this
20098         as required.
20099
20100         * expression.cs (Invocation::GetParameterData): implement a cache
20101         and a wrapper around the ParameterData creation for methods. 
20102         (Invocation::OverloadResolve): Use new code.
20103
20104 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20105
20106         * class.cs (TypeContainer::EmitField): Remove and move into 
20107         (Field::Define): here and modify accordingly.
20108         (Field.FieldBuilder): New member.
20109         (TypeContainer::Populate): Update accordingly.
20110         (TypeContainer::FindMembers): Implement.
20111
20112 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20113
20114         * statement.cs: (VariableInfo::VariableType): New field to be
20115         initialized with the full type once it is resolved. 
20116
20117 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20118
20119         * parameter.cs (GetParameterInfo): Use a type cache to compute
20120         things only once, and to reuse this information
20121
20122         * expression.cs (LocalVariableReference::Emit): Implement.
20123         (OpcodeCast::Emit): fix.
20124
20125         (ParameterReference::Resolve): Implement.
20126         (ParameterReference::Emit): Implement.
20127
20128         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20129         that are expressions need to stay as Expressions.
20130
20131         * typemanager.cs (CSharpName): Returns the C# name of a type if
20132         possible. 
20133
20134         * expression.cs (Expression::ConvertImplicit): New function that
20135         implements implicit type conversions.
20136
20137         (Expression::ImplicitReferenceConversion): Implements implicit
20138         reference conversions.
20139
20140         (EmptyCast): New type for transparent casts.
20141
20142         (OpcodeCast): New type for casts of types that are performed with
20143         a sequence of bytecodes.
20144
20145         (BoxedCast): New type used for casting value types into reference
20146         types.  Emits a box opcode.
20147
20148         (Binary::DoNumericPromotions): Implements numeric promotions of
20149         and computation of the Binary::Type.
20150
20151         (Binary::EmitBranchable): Optimization.
20152
20153         (Binary::Emit): Implement code emission for expressions.
20154
20155         * typemanager.cs (TypeManager): Added two new core types: sbyte
20156         and byte.
20157
20158 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20159
20160         * class.cs (TypeContainer::FindMembers): Method which does exactly
20161         what Type.FindMembers does, only we don't have to use reflection. No
20162         implementation yet.
20163
20164         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20165         typecontainer objects as we need to get at them.
20166         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20167
20168         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20169         typecontainer object.
20170
20171         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20172         of just a Report object.
20173
20174 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20175
20176         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20177         "remove_"
20178         (TypeContainer::Populate): Now define the delegates of the type too.
20179         (TypeContainer.Delegates): Property to access the list of delegates defined
20180         in the type.
20181
20182         * delegates.cs (Delegate::Define): Implement partially.
20183
20184         * modifiers.cs (TypeAttr): Handle more flags.
20185
20186 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20187
20188         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20189         and not <=
20190         (Operator::Define): Re-write logic to get types by using the LookupType method
20191         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20192         (Indexer::Define): Ditto.
20193         (Event::Define): Ditto.
20194         (Property::Define): Ditto.
20195
20196 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20197
20198         * class.cs (TypeContainer::Populate): Now define operators too. 
20199         (TypeContainer.Operators): New property to access the list of operators
20200         in a type.
20201         (Operator.OperatorMethodBuilder): New member to hold the method builder
20202         for the operator we are defining.
20203         (Operator::Define): Implement.
20204
20205 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20206
20207         * class.cs (Event::Define): Make the prefixes of the accessor methods
20208         addOn_ and removeOn_ 
20209
20210         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20211         of the location being passed in too. Ideally, this should go later since all
20212         error reporting should be done through the Report object.
20213
20214         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20215         (Populate): Iterate thru the indexers we have and define them too.
20216         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20217         for the get and set accessors.
20218         (Indexer::Define): Implement.
20219
20220 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20221
20222         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20223         my previous implementation, did not work.
20224
20225         * typemanager.cs: Add a couple of missing types (the longs).
20226
20227         * literal.cs: Use TypeManager.bool_type instead of getting it.
20228
20229         * expression.cs (EventExpr): New kind of expressions.
20230         (Expressio::ExprClassFromMemberInfo): finish
20231
20232 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20233
20234         * assign.cs: Emit stores to static fields differently.
20235
20236 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20237
20238         * Merge in changes and adjust code to tackle conflicts. Backed out my
20239         code in Assign::Resolve ;-) 
20240
20241 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20242
20243         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20244         instead Report.Error and also pass in the location.
20245         (CSharpParser::Lexer): New readonly property to return the reference
20246         to the Tokenizer object.
20247         (declare_local_variables): Use Report.Error with location instead of plain 
20248         old error.
20249         (CheckDef): Ditto.
20250
20251         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20252         (Operator.CheckBinaryOperator): Ditto.
20253
20254         * cs-parser.jay (operator_declarator): Update accordingly.
20255
20256         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20257         (CheckBinaryOperator): Same here.
20258
20259         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20260         on the name without any prefixes of namespace names etc. This is because we
20261         already might have something already fully qualified like 
20262         'System.Console.WriteLine'
20263
20264         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20265
20266 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20267
20268         * cs-tokenizer.cs (location): Return a string which also contains
20269         the file name.
20270
20271         * expression.cs (ElementAccess): New class for expressions of the
20272         type 'element access.'
20273         (BaseAccess): New class for expressions of the type 'base access.'
20274         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20275         respectively.
20276
20277         * cs-parser.jay (element_access): Implement action.
20278         (base_access): Implement actions.
20279         (checked_expression, unchecked_expression): Implement.
20280
20281         * cs-parser.jay (local_variable_type): Correct and implement.
20282         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20283
20284         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20285
20286         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20287         name and the specifiers.
20288
20289         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20290
20291         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20292         making them all public ;-)
20293
20294         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20295         class anyways.
20296
20297 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20298
20299         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20300         PropertyExprs.
20301         (FieldExpr, PropertyExprs): New resolved expressions.
20302         (SimpleName::MemberStaticCheck): Perform static checks for access
20303         to non-static fields on static methods. Maybe this should be
20304         generalized for MemberAccesses. 
20305         (SimpleName::ResolveSimpleName): More work on simple name
20306         resolution. 
20307
20308         * cs-parser.jay (primary_expression/qualified_identifier): track
20309         the parameter index.
20310
20311         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20312         (EmitContext::EmitBoolExpression): Chain to expression generation
20313         instead of temporary hack.
20314         (::EmitStatementExpression): Put generic expression code generation.
20315
20316         * assign.cs (Assign::Emit): Implement variable assignments to
20317         local variables, parameters and fields.
20318
20319 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20320
20321         * statement.cs (Block::GetVariableInfo): New method, returns the
20322         VariableInfo for a variable name in a block.
20323         (Block::GetVariableType): Implement in terms of GetVariableInfo
20324
20325         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20326         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20327
20328 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20329
20330         * cs-parser.jay (operator_declaration): Continue on my quest : update
20331         to take attributes argument.
20332         (event_declaration): Ditto.
20333         (enum_declaration): Ditto.
20334         (indexer_declaration): Ditto.
20335
20336         * class.cs (Operator::Operator): Update constructor accordingly.
20337         (Event::Event): Ditto.
20338
20339         * delegate.cs (Delegate::Delegate): Same here.
20340
20341         * enum.cs (Enum::Enum): Same here.
20342
20343 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20344
20345         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20346
20347         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20348
20349         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20350         being passed around as an arraylist.
20351         (Attributes::AddAttribute): Method to add attribute sections.
20352
20353         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20354         (struct_declaration): Update accordingly.
20355         (constant_declaration): Update.
20356         (field_declaration): Update.
20357         (method_header): Update.
20358         (fixed_parameter): Update.
20359         (parameter_array): Ditto.
20360         (property_declaration): Ditto.
20361         (destructor_declaration): Ditto.
20362
20363         * class.cs (Struct::Struct): Update constructors accordingly.
20364         (Class::Class): Ditto.
20365         (Field::Field): Ditto.
20366         (Method::Method): Ditto.
20367         (Property::Property): Ditto.
20368         (TypeContainer::OptAttribute): update property's return type.
20369
20370         * interface.cs (Interface.opt_attributes): New member.
20371         (Interface::Interface): Update to take the extra Attributes argument.
20372
20373         * parameter.cs (Parameter::Parameter): Ditto.
20374
20375         * constant.cs (Constant::Constant): Ditto.
20376
20377         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20378         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20379         the attributes as a parameter.
20380         (InterfaceProperty): Update constructor call.
20381         (InterfaceEvent): Ditto.
20382         (InterfaceMethod): Ditto.
20383         (InterfaceIndexer): Ditto.
20384
20385         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20386         pass the attributes too.
20387         (interface_event_declaration): Ditto.
20388         (interface_property_declaration): Ditto.
20389         (interface_method_declaration): Ditto.
20390         (interface_declaration): Ditto.
20391
20392 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20393
20394         * class.cs (Method::Define): Track the "static Main" definition to
20395         create an entry point. 
20396
20397         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20398         EntryPoint if we find it. 
20399
20400         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20401         (EmitContext::ig): Make this variable public.
20402
20403         * driver.cs: Make the default output file be the first file name
20404         with the .exe extension.  
20405
20406         Detect empty compilations
20407
20408         Handle various kinds of output targets.  Handle --target and
20409         rename -t to --dumper.
20410
20411         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20412         methods inherited from Expression return now an Expression.  This
20413         will is used during the tree rewriting as we resolve them during
20414         semantic analysis.
20415
20416         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20417         the spec.  Missing entirely is the information about
20418         accessability of elements of it.
20419
20420         (Expression::ExprClassFromMemberInfo): New constructor for
20421         Expressions that creates a fully initialized Expression based on
20422         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20423         a Type.
20424
20425         (Invocation::Resolve): Begin implementing resolution of invocations.
20426
20427         * literal.cs (StringLiteral):  Implement Emit.
20428
20429 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20430
20431         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20432         member.
20433
20434 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20435
20436         * cs-parser.jay (attribute_arguments): Implement actions.
20437         (attribute): Fix bug in production. Implement action.
20438         (attribute_list): Implement.
20439         (attribute_target): Implement.
20440         (attribute_target_specifier, opt_target_specifier): Implement
20441         (CheckAttributeTarget): New method to check if the attribute target
20442         is valid.
20443         (attribute_section): Implement.
20444         (opt_attributes): Implement.
20445
20446         * attribute.cs : New file to handle attributes.
20447         (Attribute): Class to hold attribute info.
20448
20449         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20450         (attribute_section): Modify production to use 2 different rules to 
20451         achieve the same thing. 1 s/r conflict down !
20452         Clean out commented, useless, non-reducing dimension_separator rules.
20453
20454         * class.cs (TypeContainer.attributes): New member to hold list
20455         of attributes for a type.
20456         (Struct::Struct): Modify to take one more argument, the attribute list.
20457         (Class::Class): Ditto.
20458         (Field::Field): Ditto.
20459         (Method::Method): Ditto.
20460         (Property::Property): Ditto.
20461
20462         * cs-parser.jay (struct_declaration): Update constructor call to
20463         pass in the attributes too.
20464         (class_declaration): Ditto.
20465         (constant_declaration): Ditto.
20466         (field_declaration): Ditto.
20467         (method_header): Ditto.
20468         (fixed_parameter): Ditto.
20469         (parameter_array): Ditto.
20470         (property_declaration): Ditto.
20471
20472         * constant.cs (Constant::Constant): Update constructor similarly.
20473         Use System.Collections.
20474
20475         * parameter.cs (Parameter::Parameter): Update as above.
20476
20477 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20478
20479         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20480         (TypeContainer.delegates): New member to hold list of delegates.
20481
20482         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20483         this time as I seem to be on crack ;-)
20484
20485 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20486
20487         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20488         tell whether an identifier represents a namespace.
20489
20490         * expression.cs (NamespaceExpr): A namespace expression, used only
20491         temporarly during expression resolution.
20492         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20493         utility functions to resolve names on expressions.
20494
20495 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20496
20497         * codegen.cs: Add hook for StatementExpressions. 
20498
20499         * class.cs: Fix inverted test for static flag in methods.
20500
20501 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20502
20503         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20504         to make it coincide with MS' number.
20505         (Operator::CheckBinaryOperator): Ditto.
20506
20507         * ../errors/errors.txt : Remove error numbers added earlier.
20508
20509         * ../errors/cs1019.cs : Test case for error # 1019
20510
20511         * ../errros/cs1020.cs : Test case for error # 1020
20512
20513         * cs-parser.jay : Clean out commented cruft.
20514         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20515         used anywhere - non-reducing rule.
20516         (namespace_declarations): Non-reducing rule - comment out.
20517
20518         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20519         with TypeContainer::AddEnum.
20520
20521         * delegate.cs : New file for delegate handling classes.
20522         (Delegate): Class for declaring delegates.
20523
20524         * makefile : Update.
20525
20526         * cs-parser.jay (delegate_declaration): Implement.
20527
20528 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20529
20530         * class.cs (Event::Define): Implement.
20531         (Event.EventBuilder): New member.
20532
20533         * class.cs (TypeContainer::Populate): Update to define all enums and events
20534         we have.
20535         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20536         readonly fields for all these cases ?
20537
20538 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20539
20540         * class.cs (Property): Revamp to use the convention of making fields readonly.
20541         Accordingly modify code elsewhere.
20542
20543         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20544         the Define method of the Property class.
20545
20546         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20547         trivial bug.
20548         (TypeContainer::Populate): Update to define all the properties we have. Also
20549         define all enumerations.
20550
20551         * enum.cs (Define): Implement.
20552
20553 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20554
20555         * cs-parser.jay (overloadable_operator): The semantic value is an
20556         enum of the Operator class.
20557         (operator_declarator): Implement actions.
20558         (operator_declaration): Implement.
20559
20560         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20561         validity of definitions.
20562         (Operator::CheckBinaryOperator): Static method to check for binary operators
20563         (TypeContainer::AddOperator): New method to add an operator to a type.
20564
20565         * cs-parser.jay (indexer_declaration): Added line to actually call the
20566         AddIndexer method so it gets added ;-)
20567
20568         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20569         already taken care of by the MS compiler ?  
20570
20571 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20572
20573         * class.cs (Operator): New class for operator declarations.
20574         (Operator::OpType): Enum for the various operators.
20575
20576 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20577
20578         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20579         ostensibly handle this in semantic analysis.
20580
20581         * cs-parser.jay (general_catch_clause): Comment out
20582         (specific_catch_clauses, specific_catch_clause): Ditto.
20583         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20584         (catch_args, opt_catch_args): New productions.
20585         (catch_clause): Rewrite to use the new productions above
20586         (catch_clauses): Modify accordingly.
20587         (opt_catch_clauses): New production to use in try_statement
20588         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20589         and re-write the code in the actions to extract the specific and
20590         general catch clauses by being a little smart ;-)
20591
20592         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20593         Hooray, try and catch statements parse fine !
20594
20595 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20596
20597         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20598         string from the hashtable of variables.
20599
20600         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20601         I end up making that mistake ;-)
20602         (catch_clauses): Fixed gross error which made Key and Value of the 
20603         DictionaryEntry the same : $1 !!
20604
20605 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20606
20607         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20608
20609         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20610         when the add and remove accessors are specified. 
20611
20612 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20613
20614         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20615         information about indexer_declarator.
20616         (indexer_declarator): Implement actions.
20617         (parsing_indexer): New local boolean used to keep track of whether
20618         we are parsing indexers or properties. This is necessary because 
20619         implicit_parameters come into picture even for the get accessor in the 
20620         case of an indexer.
20621         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20622
20623         * class.cs (Indexer): New class for indexer declarations.
20624         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20625         (TypeContainer::indexers): New member to hold list of indexers for the
20626         type.
20627
20628 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20629
20630         * cs-parser.jay (add_accessor_declaration): Implement action.
20631         (remove_accessor_declaration): Implement action.
20632         (event_accessors_declaration): Implement
20633         (variable_declarators): swap statements for first rule - trivial.
20634
20635         * class.cs (Event): New class to hold information about event
20636         declarations.
20637         (TypeContainer::AddEvent): New method to add an event to a type
20638         (TypeContainer::events): New member to hold list of events.
20639
20640         * cs-parser.jay (event_declaration): Implement actions.
20641
20642 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20643
20644         * cs-parser.jay (dim_separators): Implement. Make it a string
20645         concatenating all the commas together, just as they appear.
20646         (opt_dim_separators): Modify accordingly
20647         (rank_specifiers): Update accordingly. Basically do the same
20648         thing - instead, collect the brackets here.
20649         (opt_rank_sepcifiers): Modify accordingly.
20650         (array_type): Modify to actually return the complete type string
20651         instead of ignoring the rank_specifiers.
20652         (expression_list): Implement to collect the expressions
20653         (variable_initializer): Implement. We make it a list of expressions
20654         essentially so that we can handle the array_initializer case neatly too.
20655         (variable_initializer_list): Implement.
20656         (array_initializer): Make it a list of variable_initializers
20657         (opt_array_initializer): Modify accordingly.
20658
20659         * expression.cs (New::NType): Add enumeration to help us
20660         keep track of whether we have an object/delegate creation
20661         or an array creation.
20662         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20663         members to hold data about array creation.
20664         (New:New): Modify to update NewType
20665         (New:New): New Overloaded contructor for the array creation
20666         case.
20667
20668         * cs-parser.jay (array_creation_expression): Implement to call
20669         the overloaded New constructor.
20670
20671 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20672
20673         * class.cs (TypeContainer::Constructors): Return member
20674         constructors instead of returning null.
20675
20676 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20677
20678         * typemanager.cs (InitCoreTypes): Initialize the various core
20679         types after we have populated the type manager with the user
20680         defined types (this distinction will be important later while
20681         compiling corlib.dll)
20682
20683         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20684         on Expression Classification.  Now all expressions have a method
20685         `Resolve' and a method `Emit'.
20686
20687         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20688         generation from working.     Also add some temporary debugging
20689         code. 
20690
20691 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20692
20693         * codegen.cs: Lots of code generation pieces.  This is only the
20694         beginning, will continue tomorrow with more touches of polish.  We
20695         handle the fundamentals of if, while, do, for, return.  Others are
20696         trickier and I need to start working on invocations soon.
20697
20698         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20699         s.InitStatement. 
20700
20701         * codegen.cs (EmitContext): New struct, used during code
20702         emission to keep a context.   Most of the code generation will be
20703         here. 
20704
20705         * cs-parser.jay: Add embedded blocks to the list of statements of
20706         this block.  So code generation proceeds in a top down fashion.
20707
20708 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20709
20710         * statement.cs: Add support for multiple child blocks.
20711
20712 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20713
20714         * codegen.cs (EmitCode): New function, will emit the code for a
20715         Block of code given a TypeContainer and its ILGenerator. 
20716
20717         * statement.cs (Block): Standard public readonly optimization.
20718         (Block::Block constructors): Link children. 
20719         (Block::Child): Child Linker.
20720         (Block::EmitVariables): Emits IL variable declarations.
20721
20722         * class.cs: Drop support for MethodGroups here, delay until
20723         Semantic Analysis.
20724         (Method::): Applied the same simplification that I did before, and
20725         move from Properties to public readonly fields.
20726         (Method::ParameterTypes): Returns the parameter types for the
20727         function, and implements a cache that will be useful later when I
20728         do error checking and the semantic analysis on the methods is
20729         performed.
20730         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20731         and made a method, optional argument tells whether this is a class
20732         or a structure to apply the `has-this' bit.
20733         (Method::GetCallingConvention): Implement, returns the calling
20734         convention. 
20735         (Method::Define): Defines the type, a second pass is performed
20736         later to populate the methods.
20737
20738         (Constructor::ParameterTypes): implement a cache similar to the
20739         one on Method::ParameterTypes, useful later when we do semantic
20740         analysis. 
20741
20742         (TypeContainer::EmitMethod):  New method.  Emits methods.
20743
20744         * expression.cs: Removed MethodGroup class from here.
20745
20746         * parameter.cs (Parameters::GetCallingConvention): new method.
20747
20748 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20749
20750         * class.cs (TypeContainer::Populate): Drop RootContext from the
20751         argument. 
20752
20753         (Constructor::CallingConvention): Returns the calling convention.
20754         (Constructor::ParameterTypes): Returns the constructor parameter
20755         types. 
20756
20757         (TypeContainer::AddConstructor): Keep track of default constructor
20758         and the default static constructor.
20759
20760         (Constructor::) Another class that starts using `public readonly'
20761         instead of properties. 
20762
20763         (Constructor::IsDefault): Whether this is a default constructor. 
20764
20765         (Field::) use readonly public fields instead of properties also.
20766
20767         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20768         track of static constructors;  If none is used, turn on
20769         BeforeFieldInit in the TypeAttributes. 
20770
20771         * cs-parser.jay (opt_argument_list): now the return can be null
20772         for the cases where there are no arguments. 
20773
20774         (constructor_declarator): If there is no implicit `base' or
20775         `this', then invoke the default parent constructor. 
20776
20777         * modifiers.cs (MethodAttr): New static function maps a set of
20778         modifiers flags into a MethodAttributes enum
20779         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20780         MethodAttr, TypeAttr to represent the various mappings where the
20781         modifiers are used.
20782         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20783
20784 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20785
20786         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20787         method arguments.
20788
20789         * interface.cs (PopulateIndexer): Implemented the code generator
20790         for interface indexers.
20791
20792 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20793
20794         * interface.cs (InterfaceMemberBase): Now we track the new status
20795         here.  
20796
20797         (PopulateProperty): Implement property population.  Woohoo!  Got
20798         Methods and Properties going today. 
20799
20800         Removed all the properties for interfaces, and replaced them with
20801         `public readonly' fields. 
20802
20803 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20804
20805         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20806         initialize their hashtables/arraylists only when they are needed
20807         instead of doing this always.
20808
20809         * parameter.cs: Handle refs and out parameters.
20810
20811         * cs-parser.jay: Use an ArrayList to construct the arguments
20812         instead of the ParameterCollection, and then cast that to a
20813         Parameter[] array.
20814
20815         * parameter.cs: Drop the use of ParameterCollection and use
20816         instead arrays of Parameters.
20817
20818         (GetParameterInfo): Use the Type, not the Name when resolving
20819         types. 
20820
20821 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20822
20823         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20824         and instead use public readonly fields.
20825
20826         * class.cs: Put back walking code for type containers.
20827
20828 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20829
20830         * class.cs (MakeConstant): Code to define constants.
20831
20832         * rootcontext.cs (LookupType): New function.  Used to locate types 
20833
20834
20835 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20836
20837         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20838         this System.Reflection code is.  Kudos to Microsoft
20839
20840         * typemanager.cs: Implement a type cache and avoid loading all
20841         types at boot time.  Wrap in LookupType the internals.  This made
20842         the compiler so much faster.  Wow.  I rule!
20843
20844         * driver.cs: Make sure we always load mscorlib first (for
20845         debugging purposes, nothing really important).
20846
20847         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20848         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20849
20850         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20851         on namespaces that have been imported using the `using' keyword.
20852
20853         * class.cs (TypeContainer::TypeAttr): Virtualize.
20854         (Class::TypeAttr): Return attributes suitable for this bad boy.
20855         (Struct::TypeAttr): ditto.
20856         Handle nested classes.
20857         (TypeContainer::) Remove all the type visiting code, it is now
20858         replaced with the rootcontext.cs code
20859
20860         * rootcontext.cs (GetClassBases): Added support for structs. 
20861
20862 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20863
20864         * interface.cs, statement.cs, class.cs, parameter.cs,
20865         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20866         Drop use of TypeRefs, and use strings instead.
20867
20868 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20869
20870         * rootcontext.cs: 
20871
20872         * class.cs (Struct::Struct): set the SEALED flags after
20873         checking the modifiers.
20874         (TypeContainer::TypeAttr): new property, returns the
20875         TypeAttributes for a class.  
20876
20877         * cs-parser.jay (type_list): Oops, list production was creating a
20878         new list of base types.
20879
20880         * rootcontext.cs (StdLib): New property.
20881         (GetInterfaceTypeByName): returns an interface by type name, and
20882         encapsulates error handling here.
20883         (GetInterfaces): simplified.
20884         (ResolveTree): Encapsulated all the tree resolution here.
20885         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20886         types. 
20887
20888         * driver.cs: Add support for --nostdlib, to avoid loading the
20889         default assemblies.
20890         (Main): Do not put tree resolution here. 
20891
20892         * rootcontext.cs: Beginning of the class resolution.
20893
20894 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20895
20896         * rootcontext.cs: Provide better error reporting. 
20897
20898         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20899
20900         * rootcontext.cs (CreateInterface): Handle the case where there
20901         are no parent interfaces.
20902
20903         (CloseTypes): Routine to flush types at the end.
20904         (CreateInterface): Track types.
20905         (GetInterfaces): Returns an array of Types from the list of
20906         defined interfaces.
20907
20908         * typemanager.c (AddUserType): Mechanism to track user types (puts
20909         the type on the global type hash, and allows us to close it at the
20910         end). 
20911
20912 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20913
20914         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20915         RecordInterface instead.
20916
20917         * cs-parser.jay: Updated to reflect changes above.
20918
20919         * decl.cs (Definition): Keep track of the TypeBuilder type that
20920         represents this type here.  Not sure we will use it in the long
20921         run, but wont hurt for now.
20922
20923         * driver.cs: Smaller changes to accomodate the new code.
20924
20925         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20926         when done. 
20927
20928         * rootcontext.cs (CreateInterface):  New method, used to create
20929         the System.TypeBuilder type for interfaces.
20930         (ResolveInterfaces): new entry point to resolve the interface
20931         hierarchy. 
20932         (CodeGen): Property, used to keep track of the code generator.
20933
20934 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20935
20936         * cs-parser.jay: Add a second production for delegate_declaration
20937         with `VOID'.
20938
20939         (enum_body): Put an opt_comma here instead of putting it on
20940         enum_body or enum_member_declarations so we can handle trailing
20941         commas on enumeration members.  Gets rid of a shift/reduce.
20942
20943         (type_list): Need a COMMA in the middle.
20944
20945         (indexer_declaration): Tell tokenizer to recognize get/set
20946
20947         * Remove old targets.
20948
20949         * Re-add the parser target.
20950
20951 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20952
20953         * cs-parser.jay: Add precendence rules for a number of operators
20954         ot reduce the number of shift/reduce conflicts in the grammar.
20955
20956 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20957
20958         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20959         and put it here.
20960
20961         Get rid of old crufty code.
20962
20963         * rootcontext.cs: Use this to keep track of the parsed
20964         representation and the defined types available to the program. 
20965
20966         * gen-treedump.cs: adjust for new convention.
20967
20968         * type.cs: Split out the type manager, and the assembly builder
20969         from here. 
20970
20971         * typemanager.cs: the type manager will live here now.
20972
20973         * cil-codegen.cs: And the code generator here. 
20974
20975 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20976
20977         * makefile: Fixed up for easy making.
20978
20979 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20980
20981         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20982         the 
20983
20984         (unary_expression): Expand pre_increment_expression and
20985         post_decrement_expression to reduce a shift/reduce.
20986
20987 2001-07-11  Simon Cozens
20988
20989         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20990
20991         Improve allow_keyword_as_indent name.
20992
20993 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20994
20995         * Adjustments for Beta2. 
20996
20997 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20998
20999         * decl.cs: Added `Define' abstract method.
21000         (InTransit): new property, used to catch recursive definitions. 
21001
21002         * interface.cs: Implement `Define'. 
21003
21004         * modifiers.cs: Map Modifiers.constants to
21005         System.Reflection.TypeAttribute flags.
21006
21007         * class.cs: Keep track of types and user-defined types.
21008         (BuilderInit): New method for creating an assembly
21009         (ResolveType): New function to launch the resolution process, only
21010         used by interfaces for now.
21011
21012         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21013         that are inserted into the name space. 
21014
21015 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21016
21017         * ARGH.  I have screwed up my tree so many times due to the use of
21018         rsync rather than using CVS.  Going to fix this at once. 
21019
21020         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21021         load types.
21022
21023 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21024
21025         * Experiment successful: Use System.Type rather that our own
21026         version of Type.  
21027
21028 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21029
21030         * cs-parser.jay: Removed nsAliases from here.
21031
21032         Use new namespaces, handle `using XXX;' 
21033
21034         * namespace.cs: Reimplemented namespace handling, use a recursive
21035         definition of the class.  Now we can keep track of using clauses
21036         and catch invalid using clauses.
21037
21038 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21039
21040         * gen-treedump.cs: Adapted for all the renaming.
21041
21042         * expression.cs (Expression): this class now has a Type property
21043         which returns an expression Type.
21044
21045         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21046         `Type', as this has a different meaning now in the base
21047
21048 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21049
21050         * interface.cs, class.cs: Removed from all the sources the
21051         references to signature computation, as we can not do method
21052         signature computation during the parsing time, as we are not
21053         trying to solve at that point distinguishing:
21054
21055         class X {
21056                 void a (Blah x) {}
21057                 void a (NS.Blah x) {}
21058         }
21059
21060         Which depending on the context might be valid or not, as we do not
21061         know if Blah is the same thing as NS.Blah at that point.
21062
21063         * Redid everything so the code uses TypeRefs now instead of
21064         Types.  TypeRefs are just temporary type placeholders, that need
21065         to be resolved.  They initially have a pointer to a string and the
21066         current scope in which they are used.  This is used later by the
21067         compiler to resolve the reference to an actual Type. 
21068
21069         * DeclSpace is no longer a CIR.Type, and neither are
21070         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21071         are all DeclSpaces, but no Types. 
21072
21073         * type.cs (TypeRefManager): This implements the TypeRef manager,
21074         which keeps track of all the types that need to be resolved after
21075         the parsing has finished. 
21076
21077 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21078
21079         * ARGH.  We are going to have to store `foreach' as a class rather
21080         than resolving it, as we need to verify error 1579 after name
21081         resolution.   *OR* we could keep a flag that says `This request to
21082         IEnumerator comes from a foreach statement' which we can then use
21083         to generate the error.
21084
21085 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21086
21087         * class.cs (TypeContainer.AddMethod): we now add methods to the
21088         MethodGroup instead of the method hashtable.  
21089
21090         * expression.cs: Add MethodGroup abstraction, which gets us one
21091         step closer to the specification in the way we handle method
21092         declarations.  
21093
21094         * cs-parser.jay (primary_expression): qualified_identifier now
21095         tried to match up an identifier to a local variable reference or
21096         to a parameter reference.
21097
21098         current_local_parameters is now a parser global variable that
21099         points to the current parameters for the block, used during name
21100         lookup.
21101
21102         (property_declaration): Now creates an implicit `value' argument to
21103         the set accessor.
21104
21105 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21106
21107         * parameter.cs: Do not use `param' arguments as part of the
21108         signature, per the spec.
21109
21110 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21111
21112         * decl.cs: Base class for classes, structs and interfaces.  This
21113         is the "Declaration Space" 
21114
21115         * cs-parser.jay: Use CheckDef for checking declaration errors
21116         instead of having one on each function.
21117
21118         * class.cs: Factor out some code for handling error handling in
21119         accordance to the "Declarations" section in the "Basic Concepts"
21120         chapter in the ECMA C# spec.
21121
21122         * interface.cs: Make all interface member classes derive from
21123         InterfaceMemberBase.
21124
21125 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21126
21127         * Many things: all interfaces are parsed and generated in
21128         gen-treedump.  Support for member variables, constructors,
21129         destructors, properties, constants is there.
21130
21131         Beginning of the IL backend, but very little done, just there for
21132         testing purposes. 
21133
21134 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21135
21136         * cs-parser.jay: Fix labeled statement.
21137
21138         * cs-tokenizer.cs (escape): Escape " and ' always.
21139         ref_line, ref_name: keep track of the line/filename as instructed
21140         by #line by the compiler.
21141         Parse #line.
21142
21143 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21144
21145         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21146         to match the values in System.CodeDOM.
21147
21148         Divid renamed to Divide.
21149
21150         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21151         statements. 
21152         (Statements.set): remove.
21153
21154         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21155         statements. 
21156
21157         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21158         falseStatements always have valid values. 
21159
21160         * cs-parser.jay: Use System.CodeDOM now.
21161