2005-09-18 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2
3         * driver.cs: Set InEmacs based on the environment variable EMACS. 
4
5         * location.cs (InEmacs): in this mode, do not report column
6         location as it confuses Emacs.
7
8 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
9
10         * cfold.cs, constant.cs, convert.cs, ecore.cs,
11         expression.cs, iterators.cs, literal.cs: Store constants and
12         literals location.
13         
14         * class.cs (MemberBase.ShortName): Pass location.
15         
16         * cs-parser.jay: Some location fixes.
17         
18         * ecore.cs (Expression.Location): Made virtual.
19
20 2005-09-05  Miguel de Icaza  <miguel@novell.com>
21
22         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
23         if the underlying types are the same, otherwise we need to produce
24         code that will do the proper cast.
25
26         This was exposed by Marek's constant rewrite which produced
27         invalid code for the call site:
28
29         enum X : long { a }
30         void Method (X v) {}
31
32         Method ((X) 5)
33
34         This fixes test-49.cs
35
36 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
37
38         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
39           Type/Object should be allowed as well. Fixed bug #75968.
40
41 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
42
43         * expression.cs : (Binary.DoResolve): when one is enum constant and
44           another is constant 0, then return enum one *as enum type*.
45           Fixed bug 74846.
46
47 2005-09-02  Raja R Harinath  <rharinath@novell.com>
48
49         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
50         internal.
51
52         Fix #75941.
53         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
54         flow-branching for LocalVariableReferences in case we were invoked
55         from a MemberAccess.
56         * expression.cs (LocalVariableReference.VerifyAssigned): New.
57         Carved out of ...
58         (LocalVariableReference.DoResolveBase): ... this.
59         (MemberAccess.Resolve): Do the check that was disabled during
60         SimpleNameResolve.
61
62 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
63
64         * class.cs :
65           (PartialContainer.Create): check abstract/sealed/static strictly
66           but abstract/sealed can exist only at one side. Fixed bug #75883.
67
68 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
69
70         Fix #75945.
71         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
72         specified, don't default to UnmanagedType.I4.
73
74 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
75
76         * expression.cs : conditional operator should check possibly
77           incorrect assign expression. Fixed bug #75946.
78
79 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
80
81         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
82           Reverting the change. gmcs is much complex than mcs on this matter.
83
84 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
85
86         * cs-tokenizer.cs : To read another token ahead of the actual 
87           consumption, use new SavedToken and cache token instead of moving
88           back the stream with SeekableStreamReader (it seemed problematic).
89         * cs-parser.jay,
90           driver.cs : Thus use StreamReader directly.
91         * support.cs : Thus removed SeekableStreamReader.
92
93 2005-08-30  Raja R Harinath  <rharinath@novell.com>
94
95         Fix #75934.
96         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
97         (ScopeInfo.EmitScopeType): Use it to construct field names from
98         names of captured locals.
99
100         Fix #75929.
101         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
102         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
103         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
104         (ExplicitConversion): Remove enum cases already handled by
105         implicit conversion.  Move implicit conversion check to the beginning.
106         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
107         * expression.cs (ArrayCreation.EmitDynamicInitializers):
108         Don't treat System.Enum as a struct.
109
110 2005-08-30  Jb Evain  <jbevain@gmail.com>
111
112         * attribute.cs: handles as expression in parameters.
113
114 2005-08-30  Raja R Harinath  <rharinath@novell.com>
115
116         Fix #75802.
117         * class.cs (TypeContainer.VerifyClsName): Don't use a
118         PartialContainer when verifying CLS compliance.
119         (AbstractPropertyEventMethod): Set Parent here, ...
120         (PropertyMethod): ... not here.
121
122 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
123
124         * attribute.cs : escaped attribute name should not be allowed to be
125           resolved (e.g. @class as classAttribute). Fixed bug #75930.
126
127 2005-08-29  Raja R Harinath  <rharinath@novell.com>
128
129         Fix #75927.
130         * convert.cs (ImplicitStandardConversionExists): Allow zero also
131         when converting a long constant to unsigned long.
132         * expression.cs (Invocation.OverloadResolve): Add sanity check to
133         detect where IsApplicable and VerifyArgumentsCompat disagree.
134
135 2005-08-29  Raja R Harinath  <rharinath@novell.com>
136         and Carlos Alberto Cortez  <carlos@unixmexico.org>
137
138         Fix #75848.
139         * class.cs (TypeContainer.CanElideInitializer): New helper.
140         (TypeContainer.EmitFieldInitializers): Use it to determine if we
141         can safely emitting the initializer of a field.
142
143 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
144
145         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
146           allowed inside a switch (without loop). Fixed bug #75433.
147
148 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
149
150         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
151         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
152
153 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
154
155         * driver.cs : kinda reverting the default encoding changes (not exact 
156           revert since I noticed that "codepage:reset" might not work fine).
157
158 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
159
160         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
161           Location. Now getter and setter store location correctly.
162           (errors/cs0111-12.cs now reports the expected location.)
163
164 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
165
166         * driver.cs : Use default encoding on the environment.
167           Removed (now that) extra parameter for SeekableStreamReader.
168         * support.cs : (SeekableStreamReader) third .ctor() argument for
169           StreamReader is not required (always true). preamble size could
170           be acquired in simpler and safe way.
171
172 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
173
174         * cs-parser.jay: report CS0642 at warning level 3
175           and report CS0642 for an if else statement also
176           fixes bug #74745. Patch by John Luke (and a bit
177           modified by me).
178           Removed extra CS0642 warning check for "while",
179           "for" and "fixed".
180         * statement.cs: In Block.Resolve(), CS0642 check
181           is reimplemented to check a sequence of an empty
182           statement and a block.
183
184           Both fix bug #66777.
185
186 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
187
188         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
189         detection until I fix it.
190         
191         * cs-tokenizer.cs: Changed error message.
192         
193         * cs-parser.jay: Fixed 2 error locations.
194         
195         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
196         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
197         properties.
198         
199         * enum.cs (GetSignatureForError): Fixed.
200         
201         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
202         method detection.
203         
204         * class.cs,
205         * typemanager.cs (RegisterProperty): Removed.
206         
207         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
208
209 2005-08-24  Raja R Harinath  <rharinath@novell.com>
210
211         Fix #75874.
212         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
213         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
214
215 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
216
217         * expression.cs : tiny fix is required for not warning positive ulong.
218           See test-441.cs.
219
220 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
221
222         * expression.cs : add CS0652 check for constant and integral
223           expression. Fixed bug #53974.
224
225 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
226
227         * expression.cs : in DoNumericPromotions(), check if there is implicit
228           conversion overload for string (to check CS0034). Fixed bug #52492.
229
230 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
231
232         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
233
234 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
235
236         * ecore.cs : report location when it is *not* Null.
237
238 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
239
240         * codegen.cs,
241           ecore.cs,
242           flowanalysis.cs,
243           expression.cs:
244           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
245           correctly. Fixed bug #75721.
246
247 2005-08-23  Raja R Harinath  <rharinath@novell.com>
248
249         * support.cs (SeekableStreamReader.Position): Avoid an expensive
250         loop that performs 'min (pos, char_count)'.
251
252         Fix #75862.
253         * expression.cs (Unary.ResolveOperator): Don't discard implicit
254         converted value in Operator.OnesComplement.
255
256 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
257
258         * anonymous.cs: If the anon method is pulled into a helper class,
259         it needs to be `internal' not `private'. Fixes runtime behavior on
260         msft. bug #75704
261
262 2005-08-20  Martin Baulig  <martin@ximian.com>
263
264         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
265         scope if we don't already have it.
266
267         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
268         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
269         fixes #75867.
270
271 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
272
273         Fix #75803
274         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
275         is a partial class.
276
277 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
278
279         The big constants rewrite
280         Fix #75746, #75685 and more
281         As a side effect saved 1MB for MWF ;-)
282         
283         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
284         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
285         enum based for corlib compilation.
286         
287         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
288         subtractions.
289         
290         * class.cs (FixedField.Define): Use ResolveAsConstant.
291         
292         * const.cs (IConstant): Interface constants and enums.
293         (Const.ResolveValue): New method for constant resolvning.
294         (ExternalConstant): Constants from imported assemblies.
295         
296         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
297         conversion; like enums.
298         (Constant.ToType): Converts this constant to different type.
299         (Constant.Increment): Adds 1.
300         
301         * convert.cs (ImplicitConversionRequired): Simplified.
302         
303         * cs-parser.jay: Create EnumMember directly.
304         
305         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
306         
307         * doc.cs (GenerateEnumDocComment): Removed.
308         
309         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
310         (ConvertIntLiteral): Removed.
311         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
312         
313         * enum.cs (EnumMember): Implement IConstant.
314         (Enum.IsValidEnumConstant): Removed.
315         (Enum.GetNextDefaultValue): Removed.
316         (Enum.FindMembers): Updated.
317         (Enum.GenerateDocComment): Iterate enum members.
318         
319         * expression.cs (Cast.TryReduce): Handle enums correctly.
320         (New.Constantify): Made public.
321         (MemberAccess.DoResolve): Removed contant specific if(s).
322         
323         * literal.cs (NullLiteral): Implement new abstract methods.
324         
325         * statement.cs (GotoCase.Resolve): Use new constant methods.
326         (SwitchLabel.ResolveAndReduce): Use new constant methods.
327         
328         * typemanager.cs (LookupEnum): Removed.
329         (IsEnumType): Fixed to work with corlib.
330         (RegisterConstant): Removed.
331         (LookupConstant): Removed.
332         (GetConstant): Changed to work with IConstant.
333
334 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
335
336         * location.cs : Fixed overflown (>255) column number.
337
338 2005-08-03  Raja R Harinath  <rharinath@novell.com>
339
340         First cut of the qualified-alias-member feature.
341         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
342         token.
343         * cs-parser.jay (DOUBLE_COLON): New token.
344         (namespace_or_type_name): Add rule for recognizing
345         qualified-alias-members.
346         (primary_expression): Likewise.
347         (element_access): Allow QualifiedAliasMember as a possible
348         type-bearing expression.
349         (local_variable_type, local_variable_pointer_type): Likewise.
350         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
351         aliases in the current and enclosing namespace declarations.
352         (NamespaceEntry.UsingAlias): Add CS0440 warning.
353         * decl.cs (MemberName.is_double_colon): New.
354         (MemberName.MemberName): Add new constructor for alias-member.
355         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
356         * expression.cs (QualifiedAliasMember): New expression type.
357
358 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
359
360         * location.cs : it borked when no argument was specified.
361
362 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
363
364         * location.cs : tiny ToString() format fix.
365
366 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
367
368         * statement.cs : oops, it was missing.
369
370 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
371
372         A set of fixes for precise line/column location.
373
374         * location.cs :
375           "token" field now holds a file/line "delta", a line number offset 
376           from the segment, and a column number. See also:
377           http://lists.ximian.com/pipermail/mono-devel-list/2004-
378           December/009508.html
379           Removed static IsNull. Use instance IsNull property instead.
380         * cs-tokenizer.cs :
381           For some tokens it stores Location. For Identifier it stores
382           LocatedToken which is a pair of string name and location.
383           Column numbers are adjusted only at getChar().
384         * report.cs :
385           Use Location.ToString() for reporting (it now contains column).
386         * cs-parser.jay :
387           Largely modified to use LocatedToken instead of
388           string (IDENTIFIER), and to acquire Location from some tokens.
389         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
390           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
391           codegen.cs :
392           Now MemberName holds Location. DeclSpace.ctor() receives Location
393           as a parameter. Removed extra parameters to all derived classes.
394           Replaced Location.IsNull() with instance property.
395         * assign.cs, expression.cs :
396           Added .ctor() overload that omits Location.
397         * attribute.cs :
398           Added "nameEscaped" flag that indicates the identifier was escaped
399           in the source file. This fixes bug #57047.
400
401 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
402
403         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
404         New method, looking for lo-case imported cls type.
405
406         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
407         here.
408
409         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
410
411         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
412
413         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
414         all_imported_types.
415         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
416
417         Optimized to save 3.5 MB for SWF compilation.
418
419 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
420
421         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
422         (PartialContainer.Create): Moved logic AddToContainer.
423         (PartialContainer.MarkForDuplicationCheck): Shares name.
424         
425         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
426         place.
427         
428         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
429         initialization.
430         (Namespace.GetSignatureForError): New method.
431         
432         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
433         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
434
435 2005-08-01  Raja R Harinath  <rharinath@novell.com>
436
437         Fix #75669.
438         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
439         member lookup rather than qualifier_type, since qualifier_type can
440         be null.
441
442 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
443
444         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
445         enum member.
446
447 2005-07-31  Miguel de Icaza  <miguel@novell.com>
448
449         * statement.cs: Copy the local exception into the exception
450         captured local.  Fixes 75674
451
452 2005-07-31  Raja R Harinath  <harinath@gmail.com>
453
454         Fix #75658.
455         * expression.cs (Invocation.OverloadResolve): Don't report error
456         CS1501 if error CS1502 has been reported.
457         (New.DoResolve): Delegate CS1501 reporting to
458         Invocation.OverloadResolve.
459
460         Fix #75656.
461         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
462         invariant-meaning-in-block property in an enclosing block if
463         necessary.
464
465 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
466
467         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
468         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
469         (Switch.CheckSwitch): Just save 50kb for SWF.
470
471 2005-07-27  Martin Baulig  <martin@ximian.com>
472
473         * anonymous.cs (CaptureContext.AddField): Added
474         `AnonymousContainer am' argument; compute its toplevel scope if
475         it's not already computed.  Fixes #75649.
476
477 2005-07-26  Raja R Harinath  <rharinath@novell.com>
478
479         Fix #75628.
480         * class.cs (Constructor.Emit): Reset block to null if the block
481         resolve fails.
482
483 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
484
485         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
486
487 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
488
489         * class.cs (MethodData.Define): Check whether accessor implementing
490         interface is public.
491
492         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
493
494 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
495
496         Fix #57245
497         * namespace.cs (LookupType): Moved same type check to...
498         
499         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
500         with the same name.
501
502 2005-07-21  Raja R Harinath  <rharinath@novell.com>
503
504         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
505         already found a typebuilder.
506         * class.cs (MethodCore.IsDuplicateImplementation): Compare
507         MemberNames, not strings.
508
509         * const.cs (Error_ExpressionMustBeConst): 
510         Rename from Error_EpressionMustBeConst.
511         * const.cs, class.cs, statement.cd: Update.
512
513 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
514
515         Fix #65573
516
517         * const.cs (Const.LookupConstantValue): Report missing contant expression
518         everytime.
519         (Error_EpressionMustBeConstant): Only one error method.
520
521         * class.cs, statement.c: Updated.
522
523 2005-07-20  Raja R Harinath  <rharinath@novell.com>
524
525         * statement.cs (Block.Flags): Add back HasVarargs.
526         (Block.flags): Make protected.
527         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
528
529         * typemanager.cs (types, typecontainers, user_types): Remove.
530         (UserTypes, TypeContainers): Likewise.
531         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
532         (CleanUp, Reset): Update.
533         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
534         (GetNestedType): Use Type.GetNestedType.
535         (CoreLookupType): Take two arguments, the namespace and the
536         basename of the type.  Update to use the Namespace.Lookup
537         mechanism.
538         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
539         (RealMemberLookup): Use IsNestedChildOf instead of playing with
540         string concatenation and substring matches.
541         * class.cs, enum.cs, delegate.cs: Update to changes.
542
543 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
544
545         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
546         Expression and made virtual.
547
548         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
549         (ImplicitStandardConversionExists): Fixed `byte' typo ?
550
551         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
552
553         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
554         error message.
555
556         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
557         change.
558
559 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
560
561         Fix #57707
562         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
563         AssemblyCultureAttribute is not used on executable.
564
565         * rootcontext.cs,
566         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
567
568 2005-07-16  Raja R Harinath  <rharinath@novell.com>
569
570         Fix #60638.
571         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
572         New.  Reports CS0252/CS0253.
573         Mostly taken from preliminary patch by Duncak Mak.
574         (Binary.DoResolveOperator): Store results of operator lookup.
575         Use them to detect if we need to warn about unintended reference
576         comparisons.
577
578 2005-07-15  Raja R Harinath  <rharinath@novell.com>
579
580         Fix #72969.
581         * namespace.cs (Namespace.Lookup): Add back location parameter.
582         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
583         * delegate.cs, ecore.cs, expression.cs: Update to changes.
584
585         * codegen.cs (EmitContext.DeclSpace): Make readonly.
586         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
587         (Namespace.LookupType): ... this.
588         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
589         of namespaces.
590         * typemanager.cs (LookupTypeReflection): Remove buggy code that
591         purported to handle pointers.
592         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
593         CoreLookupType.
594
595 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
596
597         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
598         type as namespace.
599
600 2005-07-15  Raja R Harinath  <rharinath@novell.com>
601
602         * namespace.cs (Namespace.Lookup): Drop location parameter.
603         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
604         (NamespaceEntry.Lookup): ... this.
605         (NamespaceEntry.Error_AmbiguousTypeReference):
606         Move here from DeclSpace.
607         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
608         names ...
609         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
610         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
611         Move to NamespaceEntry.
612         * delegate.cs, expression.cs: Update to changes.
613
614 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
615
616         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
617         CheckAttributeType and refactored.
618         (Attribute.ResolvePossibleAttributeType): Changed to reuse
619         ResolveAsTypeTerminal error handling.
620         (ResolveAsTypeTerminal): Introduced because of global attributes extra
621         handling.
622         (GetSignatureForError): Print errors in same way.
623
624         * class.cs,
625         * codegen.cs: Reflect attribute GetSignatureForError change.
626
627         * ecore.cs,
628         * expression.cs: Add silent parameter to ResolveAsTypeStep.
629
630         * namespace.cs (UsingEntry): Refactored to make fields private.
631
632         * assign.cs,
633         statement.cs: Error_UnexpectedKind has extra parameter.
634
635 2005-07-14  Raja R Harinath  <rharinath@novell.com>
636
637         * ecore.cs (IAlias): Remove.
638         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
639         that implement the interface.
640         * namespace.cs (Namespace): Likewise.
641         (Namespace.declspaces): Renamed from 'defined_names'.
642         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
643         DeclSpace instead of an IAlias.
644         * tree.cs (Tree.AddDecl): Update.
645
646 2005-07-12  Raja R Harinath  <rharinath@novell.com>
647
648         * statement.cs (Block.Flags); Remove HasVarargs.
649         (Block.HasVarargs): Move to ToplevelBlock.
650         (Block.ThisVariable, Block.AddThisVariable): Likewise.
651         (Block.Variables): Make protected.  Initialize variable hashtable
652         if necessary.
653         (Block.AddVariable): Update.
654         (Block.Resolve): Update to changes.
655         (ToplevelBlock.HasVarargs): New boolean.
656         (ToplevelBlock.ThisVariable): Move here from Block.
657         (ToplevelBlock.AddThisVariable): Likewise.
658         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
659         * expression.cs (This.ResolveBase): Update to changes.
660         (ArglistAccess.DoResolve): Likewise.
661
662 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
663
664         Fix #75321
665         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
666
667         * class.cs (TypeContainer.VerifyMembers): Distinguish between
668         not used and not used & assigned.
669         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
670
671 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
672
673         Fix #75053
674         * expression.cs (Is.DoResolve): null is never provided type.
675
676 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
677
678         Fix #52496
679         * cs-parser.jay: Less strict event error rule to catch more errors.
680
681 2005-07-08  Martin Baulig  <martin@ximian.com>
682
683         Fix test-iter-10.cs - distinguish whether we `yield' in a property
684         gettter (allowed) or setter (not allowed).
685
686         * class.cs (Accessor): Implement IIteratorContainer.
687         (Accessor.Yields): New public field.
688         (PropertyBase.PropertyMethod.Define): Handle iterators on a
689         per-accessor basis.
690
691         * cs-parser.jay
692         (get_accessor_declaration, set_accessor_declaration): Set the
693         `yields' flag on the accessor, not the property.
694         (property_declaration): Do the iterators check on a per-accessor
695         basis and not for the whole property.
696
697 2005-07-08  Martin Baulig  <martin@ximian.com>
698
699         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
700         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
701
702 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
703
704         Fix #74975
705         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
706         (ExtractSecurityPermissionSet): Cope with self referencing security
707         attributes properly.
708
709         * driver.cs (SetOutputFile): Made public property OutputFile.
710
711 2005-07-07  Raja R Harinath  <rharinath@novell.com>
712
713         Fix #75486.
714         * class.cs (TypeContainer.first_nonstatic_field): Rename from
715         has_nonstatic_fields.  Make into a FieldBase pointer.
716         (TypeContainer.AddField): Add CS0282 check.
717         (TypeContainer.EmitType): Update.
718
719 2005-07-06  Miguel de Icaza  <miguel@novell.com>
720
721         * cs-tokenizer.cs (consume_identifier): Do not create strings to
722         compare if they start with __.
723
724 2005-07-06  Raja R Harinath  <rharinath@novell.com>
725
726         * statement.cs (Switch.SwitchGoverningType): Only look at
727         UserCasts that don't need implicit standard conversions to one of
728         the allowed switch types (Fixes test-322.cs).
729         (LocalInfo.Resolve): Re-enable sanity-test.
730
731 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
732
733         * cs-tokenizer.cs (consume_identifier): Detect double undescores
734         
735         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
736         
737         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
738
739 2005-07-06  Raja R Harinath  <rharinath@novell.com>
740
741         Fix #75472.
742         * ecore.cs (SimpleName.GetSignatureForError): Add.
743         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
744         (MemberAccess.GetSignatureForError): Add.
745
746 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
747  
748         The big error and warning messages review.
749         
750         * anonymous.cs,
751         * assign.cs,
752         * attribute.cs,
753         * class.cs,
754         * codegen.cs,
755         * convert.cs,
756         * cs-parser.jay,
757         * cs-tokenizer.cs,
758         * decl.cs,
759         * delegate.cs,
760         * doc.cs,
761         * driver.cs,
762         * ecore.cs,
763         * enum.cs,
764         * expression.cs,
765         * flowanalysis.cs,
766         * iterators.cs,
767         * literal.cs,
768         * location.cs,
769         * modifiers.cs,
770         * namespace.cs,
771         * parameter.cs,
772         * pending.cs,
773         * report.cs,
774         * rootcontext.cs,
775         * statement.cs,
776         * support.cs,
777         * tree.cs,
778         * typemanager.cs: Updated.
779         
780         * class.cs: (MethodCore.SetYields): Moved here to share.
781         (PropertyMethod.Define): Moved iterator setup here.
782         
783         * iterators.cs: Add orig_method to have full access to parent
784         container.
785
786 2005-07-05  Raja R Harinath  <rharinath@novell.com>
787
788         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
789         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
790         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
791         variable of struct type.
792         * expression.cs (Unary.ResolveOperator): Update to change.
793         (Indirection.VerifyFixed): Likewise.
794         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
795         (ParameterReference.VerifyFixed): Value parameters are fixed.
796         (This.VerifyFixed): Treat 'this' as a value parameter.
797         * statement.cs (LocalInfo.IsFixed): Remove.
798
799 2005-07-01  Martin Baulig  <martin@ximian.com>
800
801         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
802         `ec.EmitThis ()' to get the correct scope.
803
804 2005-07-01  Martin Baulig  <martin@ximian.com>
805
806         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
807         instance is a ParameterReference; fixes #75299.
808
809 2005-07-01  Martin Baulig  <martin@ximian.com>
810
811         Reverted Marek's latest patch (r46725):
812         - it contains structural changes which are neither mentioned in
813           the ChangeLog nor explained anywhere; for example the additional
814           argument of EmitContext's and Iterator's .ctor's and the
815           TypeContainer.DefineMembers() change.
816         - structural changes like this should go in in seperate patches
817           and not be hidden in a huge patch which just seems to affect
818           warnings and errors.
819           a big and hard to understand patch.
820         - it breaks iterators and causes regressions, for instance in
821           test-iter-03.cs.      
822
823 2005-06-30  Raja R Harinath  <rharinath@novell.com>
824
825         Fix #75412.
826         * expression.cs (Indexers.map): Remove.
827         (Indexers.Append): Filter out inaccessible setters and getters.
828         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
829
830         Fix #75283.
831         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
832         Refactored from ...
833         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
834         (FieldExpr.Emit, PropertyExpr.Emit): Update.
835         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
836         * expression.cs (Invocation.EmitCall): Add CS0120 check.
837
838 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
839
840         Fix #75322
841         * class.cs (FieldBase.GetInitializerExpression): One more field
842         for backup.
843
844 2005-06-28  Miguel de Icaza  <miguel@novell.com>
845
846         * pending.cs: Do not define a proxy if the base method is virtual,
847         it will be picked up by the runtime (bug 75270).
848
849 2005-06-08  Martin Baulig  <martin@ximian.com>
850
851         The big Iterators rewrite :-)
852
853         * iterators.cs: Rewrite this to use the anonymous methods framework.
854
855         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
856         before the TypeContainers; see 2test-21.cs.
857
858         * class.cs
859         (TypeContainer.DefineType): Don't create a new EmitContext if we
860         already have one (this only happens if we're an Iterator).
861         (TypeContainer.Define): Also call Define() on all our iterators.
862         (Method.CreateEmitContext): Added support for iterators.
863
864         * anonymous.cs
865         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
866         (AnonymousContainer.CreateMethodHost): Moved here from
867         AnonymousMethod and made abstract.
868         (AnonymousContainer.CreateScopeType): New abstract method.
869         (AnonymousContainer.IsIterator): New public property.
870         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
871         get the ScopeTypeBuilder rather than manually defining it here. 
872         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
873         iterators here.
874
875         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
876         before RootContext.DefineTypes().
877
878         * codegen.cs (EmitContext.RemapToProxy): Removed.
879         (EmitContext.CurrentAnonymousMethod): Changed type from
880         AnonymousMethod -> AnonymousContainer.
881         (EmitContext.ResolveTopBlock): Protect from being called twice.
882         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
883         (EmitContext.EmitThis): Removed the iterators hacks; use the
884         anonymous methods framework for that.
885
886         * statement.cs
887         (ToplevelBlock.Container): Make this a property, not a field.
888         (ToplevelBlock.ReParent): New public method; move the
889         ToplevelBlock into a new container.
890         (Foreach.TemporaryVariable): Simplify.
891
892 2005-06-05  Martin Baulig  <martin@ximian.com>
893
894         * statement.cs (LocalInfo.CompilerGenerated): New flag.
895         (Block.AddTemporaryVariable): New public method; creates a new
896         `LocalInfo' for a temporary variable.
897         (Block.EmitMeta): Create the LocalBuilders for all the temporary
898         variables here.
899         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
900         non-iterator variables.
901
902 2005-06-05  Martin Baulig  <martin@ximian.com>
903
904         * statement.cs (Foreach.TemporaryVariable): Create the
905         LocalBuilder in the Emit phase and not in Resolve since in some
906         situations, we don't have an ILGenerator during Resolve; see
907         2test-19.cs for an example.
908
909 2005-06-04  Martin Baulig  <martin@ximian.com>
910
911         **** Merged r45395 from GCS ****
912
913         The big Foreach rewrite - Part II.
914
915         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
916         with `PropertyInfo ienumerator_getcurrent'.
917
918         * codegen.cs (VariableStorage): Removed.
919
920         * statement.cs
921         (Foreach): Derive from Statement, not ExceptionStatement.
922         (Foreach.CollectionForeach): New nested class.  Moved all the code
923         dealing with collection foreach here.
924         (Foreach.ForeachHelperMethods): Removed.
925         (Foreach.TemporaryVariable): Implement IMemoryLocation.
926
927 2005-05-23  Martin Baulig  <martin@ximian.com>
928
929         * statement.cs (Try.DoResolve): Don't create a `finally' if we
930         don't need to.  Fix #75014.
931
932 2005-05-20  Martin Baulig  <martin@ximian.com>
933
934         Merged r44808 from GMCS.
935
936         * class.cs (TypeContainer.CircularDepException): Removed.
937         (TypeContainer.DefineType): Removed the `InTransit' stuff.
938         (TypeContainer.CheckRecursiveDefinition): Check for circular class
939         (CS0146) and interface (CS0529) dependencies here.
940
941 2005-06-21  Raja R Harinath  <rharinath@novell.com>
942
943         * expression.cs (Invocation.EmitCall): Fix initialization
944         'this_call' to reflect current behaviour.  Fix indentation.
945
946         * convert.cs (FindMostEncompassedType): Add two trivial special
947         cases (number_of_types == 0 || number_of_types == 1).
948         (FindMostEncompasingType): Likewise.
949
950 2005-06-17  Raja R Harinath  <rharinath@novell.com>
951
952         Some cleanups preparing for the fix of #75283.
953         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
954         error testing.
955         (EventExpr.InstanceResolve): Likewise.
956         (EventExpr.DoResolve): Remove redundant checks.
957
958 2005-06-10  Duncan Mak  <duncan@novell.com>
959
960         * cs-tokenizer.cs (process_directives): New flag for controlling
961         the processing of preprocessor directives.
962         (x_token): After seeing a '#', return Token.NONE instead of going
963         to handle_preprocessing_directive() when not processing
964         directives. This avoids unnecessary processing during the token peek in
965         is_punct().
966
967         This fixes #74939.
968
969         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
970         the existing error reporting methods instead of Report.Error.
971
972         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
973         after Raja's rewrite.
974
975 2005-06-08  Miguel de Icaza  <miguel@novell.com>
976
977         * class.cs: Small fix.
978
979 2005-06-08  Raja R Harinath  <rharinath@novell.com>
980
981         Fix #75160.
982         * class.cs (GetPartialBases): Fix return value check of
983         part.GetClassBases.
984
985 2005-06-07  Raja R Harinath  <rharinath@novell.com>
986
987         Ensure that partial classes are registered in their enclosing
988         namespace.  Initial part of fix of #75160.
989         * tree.cs (Tree.RecordDecl): Add new namespace argument.
990         Register declspace with namespace here, not in
991         DeclSpace.RecordDecl.
992         * cs-parser.jay: Pass namespace to RecordDecl.
993         * class.cs (PartialContainer.Create): Likewise.
994         (ClassPart.DefineType): New sanity-check.  Throws an exception if
995         called.
996         * decl.cs (Declspace.RecordDecl): Remove.
997         * namespace.cs (NamespaceEntry.DefineName): Remove.
998
999 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1000
1001         * rootcontext.cs: Reset TargetExt as well.
1002
1003 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1004
1005         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1006         -langversion:ISO-1.
1007
1008 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1009
1010         Fix #75080, cs0119.cs.
1011         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1012         of ...
1013         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1014         allowing ExprClass.Type and ExprClass.Namespace for
1015         ResolveFlags.VariableOrValue.
1016         (Expression.Resolve) [1-argument variant]: Change default resolve
1017         flags based on language version.
1018         (Expression.Error_UnexpectedKind): Use a simple string array
1019         rather than an ArrayList.
1020         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1021         not ExprClass.Type.
1022         (TypeOfVoid.DoResolve): Likewise.
1023         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1024         flags argument -- it always has the same value.
1025
1026 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1027
1028         Fix #75081.
1029         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1030         Use it in the error message.
1031         * assign.cs, expression.cs, statement.cs: Update.
1032
1033 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1034
1035         Fix #75088.
1036         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1037         the "almostMatchedMember" case too.
1038         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1039         that failed the accessibility checks to 'almost_match'.
1040
1041 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1042
1043         * attribute.cs: Use internal MethodBuilder methods to set
1044         ExactSpelling and SetLastError on PInvoke methods, instead
1045         of passing them via charset.  Fixes #75060.
1046
1047 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1048
1049         * parameter.cs (Parameter): Remove TODO comment.
1050         (Parameter.DefineParameter): Remove Location parameter.
1051         (Parameters.LabelParameters): Likewise.
1052         * class.cs (Constructor.Emit): Update to change.
1053         (MethodData.Emit): Likewise.
1054         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1055         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1056
1057 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1058
1059         * parameter.cs,
1060           Removed Parameters.Location and added Parameter.Location instead.
1061           Removed Location parameter from Emit() and GetSignature().
1062         * anonymous.cs,
1063           class.cs,
1064           cs-parser.jay,
1065           delegate.cs,
1066           iterators.cs,
1067           statement.cs :
1068           Modified all related calls.
1069
1070 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1071
1072         Improve user-defined conversion handling.
1073         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1074         applicable operators.
1075         (AddConversionOperators): New.  Helper for GetConversionOperators.
1076         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1077         there is only one most encompassed/encompassing type.
1078         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1079         "applicable operator" handling.
1080         (UserConversion): Move cache here from GetConversionOperators.
1081         Directly cache the chosen operator, rather than the whole
1082         MethodGroup.
1083         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1084         case.  Allow conversion of decimal to sbyte and byte too.
1085         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1086         New static methods.  Used to avoid allocating EmptyExpressions in
1087         convert.cs.
1088
1089 2005-05-24  Duncan Mak  <duncan@novell.com>
1090
1091         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1092         another class, used in Convert.ExplicitNumericConversion.
1093         (CastToDecimal): New class, similar to above, but casts to
1094         System.Decimal, used in Convert.ImplicitNumericConversion and also
1095         in explicit convesion from double/float to decimal.
1096
1097         * convert.cs (ImplicitNumericConversion): Handle implicit
1098         conversions to System.Decimal.
1099         (ExplicitNumericConversion): handle explicit conversions to
1100         System.Decimal.
1101
1102         This fixes #68711.
1103         
1104 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1105
1106         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1107         know the type at this stage, just break through.   Fixes #75008 
1108
1109 2005-05-19  Martin Baulig  <martin@ximian.com>
1110
1111         * delegate.cs
1112         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1113         to disable error reporting.
1114
1115         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1116         here since we don't want to report an error; see the new test-336.cs.
1117
1118 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1119
1120         * statement.cs (ToplevelBlock.GetParameterReference)
1121         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1122         Move here from class Block.
1123         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1124         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1125
1126 2005-05-18  Martin Baulig  <martin@ximian.com>
1127
1128         Fix #74978.
1129
1130         * flowanalysis.cs
1131         (FlowBranching.Reachability): Add non-static public And() and Or()
1132         methods.
1133         (FlowBranchingSwitch): New class; do the `break_origins' thing
1134         like in FlowBranchingLoop.
1135         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1136         reachability, not just locals and parameters.
1137         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1138         switch; MergeBreakOrigins() now takes care of that.
1139
1140 2005-05-18  Martin Baulig  <martin@ximian.com>
1141
1142         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1143         a loop and may leave it, reset the barrier; fixes #74974.
1144
1145 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1146         
1147         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1148         is back.
1149         
1150         * cs-parser.jay: Catch more lexical errors.
1151         
1152         * report.cs: Add one more Error method.
1153         
1154         * rootcontext.cs,
1155         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1156
1157 2005-05-17  Martin Baulig  <martin@ximian.com>
1158
1159         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1160         #70970. 
1161
1162 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1163
1164         Fix test-382.cs.  Emit values of decimal constants.
1165         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1166         Carved out of ...
1167         (TypeContainer.AddField): ... this.
1168         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1169         with initializers to include 'Const's.
1170         (ClassPart.RegisterFieldForInitialization): Forward to
1171         PartialContainer.
1172         * const.cs (Const.Const): Pass initializer to base class.
1173         (Const.Define): In case of decimal constants, register them for
1174         initialization in a static constructor.
1175
1176 2005-05-14  Martin Baulig  <martin@ximian.com>
1177
1178         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1179         do not call ResolveUnreachable() on unreachable statements in
1180         here, see the comment in the source code.
1181
1182 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1183
1184         Fix #74934.
1185         * expression.cs (BinaryResolveOperator): If one of the operands of
1186         an equality comparison is 'null' and the other is a pointer type,
1187         convert the null to a NullPointer.
1188         * convert.cs (ImplicitReferenceConversion): If the expression is a
1189         NullLiteral and the target type is a pointer type, return a
1190         NullPointer instead.
1191         (ImplicitConversionStandard): Likewise.
1192
1193 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1194         
1195         * cs-parser.jay: Set readonly context based on special constructs.
1196         
1197         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1198         readonly variable error handling.
1199         
1200         * rootcontext.cs (EmitCode): Don't verify members when error
1201         occurred.
1202         
1203         * statement.cs (LocalInfo): Add reaodnly context information.
1204         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1205
1206 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1207
1208         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1209         for #74041 to initialize 'resolved' to false only for explicit
1210         blocks.  Fixes #74873.
1211
1212 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1213
1214         Fix #74920.
1215         * typemanager.cs (unmanaged_enclosing_types): New.
1216         (IsUnmanagedType): Avoid infloops by using
1217         'unmanaged_enclosing_types' to talk with recursive invocations.
1218
1219 2005-05-13  Martin Baulig  <martin@ximian.com>
1220
1221         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1222         instance variable, not a local.  Fix #74873.
1223         (Block.ResolveUnreachable): Set it to true here.
1224
1225 2005-05-11  Duncan Mak  <duncan@novell.com>
1226
1227         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1228         continuing to process for 'arg'.
1229         (handle_preprocessing_directive): Check the argument of the #endif
1230         directive and report error CS1025 if there are any trailing
1231         characters.
1232
1233         According to the C# spec, having even whitespace after the #endif
1234         directive is illegal; however, because we call arg.TrimEnd ()
1235         beforehand, we have the same behavior as csc, allowing whitespace
1236         after the directive.
1237
1238         Fixes #74892.
1239
1240 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1241
1242         Fix #74863.
1243         
1244         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1245         (Constructor.GetObsoleteAttribute): Implemented correctly.
1246
1247 2005-05-10  Martin Baulig  <martin@ximian.com>
1248
1249         * support.cs (ReflectionParameters.ParameterModifier): Use
1250         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1251         and `ParameterAttributes.In'.  Fixes #74884.
1252
1253 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1254
1255         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1256         
1257         * expression.cs (Argument.GetParameterModifier): Turned to property.
1258         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1259         
1260         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1261         its C# equivalent.
1262         
1263 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1264
1265         Fix #74852.
1266         * decl.cs (MemberCache.AddMethods): Register override methods,
1267         rather than non-override methods.
1268         * typemanager.cs (RegisterOverride): New.
1269         (IsOverride): Update.
1270
1271 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1272
1273         Fix #73105.
1274         
1275         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1276         recursive declaration.
1277         
1278         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1279         
1280 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1281
1282         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1283         
1284         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1285
1286 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1287
1288         Fix #74797.
1289         * decl.cs (DeclSpace.FamilyAccessible): 
1290         Use TypeManager.IsNestedFamilyAccessible.
1291
1292         Fix reopened #64812.
1293         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1294         internal'.
1295
1296 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1297             Abin Thomas  <projectmonokochi@rediffmail.com>
1298             Anoob V E  <projectmonokochi@rediffmail.com>
1299             Harilal P R  <projectmonokochi@rediffmail.com>
1300
1301         Fix #64812.
1302         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1303         allow access to all static members.
1304
1305 2005-05-04  Martin Baulig  <martin@ximian.com>
1306
1307         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1308
1309 2005-05-04  Martin Baulig  <martin@ximian.com>
1310
1311         Fix #74655.
1312
1313         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1314         section at the end; make things work if `default' is not the last
1315         section.        
1316
1317 2005-05-04  Martin Baulig  <martin@ximian.com>
1318
1319         Fix #70400.
1320
1321         * statement.cs (Switch): Replaced the `got_default' field with a
1322         `default_section' one.
1323         (Switch.CheckSwitch): Set `default_section' here.
1324         (Switch.Resolve): If we're a constant switch and the constant is
1325         not found, use the default section.
1326
1327 2005-05-03  Martin Baulig  <martin@ximian.com>
1328
1329         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1330
1331         * statement.cs (Foreach.ArrayForeach): New nested class.
1332         (Foreach.TemporaryVariable): New nested class.
1333         (Foreach.EmitArrayForeach): Removed; this is now in the new
1334         ArrayForeach class.
1335
1336 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1337
1338         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1339         more conservative.
1340         (VerifyPendingMethods): Revert change below.
1341
1342         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1343         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1344         that used to trigger warning -28.  Remove warning -28.
1345         * expression.cs (Invocation.OverloadResolve): Use
1346         TypeManager.IsOverride to distinguish override methods.
1347
1348         Fix #74773.
1349         * pending.cs (VerifyPendingMethods): If a base type implements the
1350         requested interface, don't bother checking individual methods of
1351         the base type.  As a side-effect, this prevents the creation of
1352         unnecessary proxies.
1353
1354 2005-05-02  Martin Baulig  <martin@ximian.com>
1355
1356         Fix #70182.
1357
1358         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1359         Also `And' the locals if the old vector is null.
1360         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1361         null; in this case we basically reset all the variables.        
1362
1363 2005-05-02  Martin Baulig  <martin@ximian.com>
1364
1365         Fix #74529.
1366
1367         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1368         Added `FlowBranching branching' argument; always `and' the
1369         variables instead of `or'ing them unless we're an infinite loop.
1370
1371         * statement.cs (While.Resolve): Create a new sibling unless we're
1372         infinite.       
1373
1374 2005-05-02  Martin Baulig  <martin@ximian.com>
1375
1376         Fix #70140.
1377
1378         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1379         arguments; use it instead of creating a new TopLevelBlock.
1380         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1381         our ConstructorInitializer.
1382
1383         * statement.cs
1384         (TopLevelBlock.TopLevelBranching): New public property.
1385         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1386         and create our `TopLevelBranching'.
1387
1388         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1389         anonymous method host, use `block.TopLevelBranching' rather than
1390         creating a new branching.
1391
1392 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1393
1394         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1395         a ScopeInfo, if any of the current children is a child of the new
1396         entry, move those children there.
1397
1398 2005-04-30  Martin Baulig  <martin@ximian.com>
1399
1400         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1401         at the beginning of a SwitchSection.  Fix #73335.
1402
1403 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1404
1405         Fix #74378
1406         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1407         
1408         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1409         (FieldExpr.DoResolve): Obsolete members are ignored for field
1410         initializers.
1411         
1412 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1413
1414         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1415         of arrays detection.
1416
1417         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1418         verification.
1419         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1420
1421         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1422         arrays report.
1423
1424 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1425
1426         * cs-parser.jay: Use the prefered version of -unsafe in error
1427         message.
1428
1429 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1430
1431         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1432         circumstances.
1433
1434 2005-04-20  John Luke  <john.luke@gmail.com>
1435
1436         * driver.cs: fix typo in error message, --outout to --output
1437
1438 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1439
1440         * codegen.cs (InRefOutArgumentResolving): New field.
1441         
1442         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1443         fields outside contructor.
1444         
1445         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1446         
1447 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1448
1449         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1450         parameter code was not completed ever, so it was not as up-to-date
1451         as local variables.  Must finish it.
1452
1453         The bug fix was to compare the Toplevel of the block, not the
1454         current block.  Thanks for Ben for pointing this out. 
1455
1456 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1457
1458         * decl.cs (AddMethods): Use the declaring type of the problem
1459         method to determine if we want to squash a warning.
1460
1461 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1462
1463         * attribute.cs: Removed debug output.
1464
1465         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1466         
1467         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1468         Report.Stderr.
1469         
1470 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1471
1472         Fix #74481.
1473         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1474         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1475         all null comparisons against reference types.
1476
1477 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1478
1479         Fix# 74565
1480         * class.cs (TypeContainer.CircularDepException) New nested
1481         exception class.
1482         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1483         (TypeContainer.DefineType): Removed error, reset InTransit before
1484         exit.
1485         (Class.DefineType): Throw exception when is in Transit.
1486         Catch exception and report error.
1487         (Struct.DefineType): Throw exception when is in Transit.
1488         Catch exception and report error.
1489         (Interface.DefineType): Throw exception when is in Transit.
1490         Catch exception and report error.
1491
1492         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1493         handle nested exception handlers.
1494
1495         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1496         a catch.
1497
1498         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1499         InFinally and InCatch storage.
1500
1501         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1502         (Catch.Resolve): Set and Restore ec.InCatch.
1503         (Try.Resolve): Set and Restore ec.InFinally.
1504         (Try.HasCatch): True when try has catch.
1505
1506 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1507
1508         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1509           for the same event member, so exclude such cases from warning 419.
1510           Fixed bug #74633.
1511
1512 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1513
1514         * expression.cs (Binary.ResolveOperator): Apply patch from John
1515         Luke to fix bug 59864: operators &, | and ^ on enumerations
1516         require that the same enum type on both sides.
1517
1518         * driver.cs: Add warnings to old flag usage, this is to assist
1519         people who produce Makefiles and hope that the Makefiles will be
1520         used on Windows.
1521
1522         * class.cs (TypeContainer.EmitType): Moved the definition of the
1523         special $PRIVATE$ field from the resolve phase to the Emit phase.
1524         During resolve we do not know if we are a struct with
1525         HasExplicitLayout, we know this only after the attributes for the
1526         type are emitted.
1527
1528         Set the FieldOffset to zero on the dummy field that we create for
1529         the class.   Fixes 74590.
1530
1531 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1532
1533         Fix #73834.
1534         * ecore.cs (PropertyExpr.resolved): New.
1535         (DoResolve): Use it to handle a case of double resolution here.
1536         Handle a case of identical-name-and-type-name.
1537         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1538         resolution by storing the results of expression resolution back
1539         into the "probes" array.
1540
1541 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1542
1543         Fix cs0208-7.cs and cs0208-8.cs.
1544         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1545         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1546         error reporting to point out the reason a struct is not unmanaged.
1547
1548 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1549
1550         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1551           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1552
1553 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1554
1555         Fix #74528.
1556         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1557         IdenticalNameAndTypeName here.
1558         (EventExpr.InstanceResolve): Likewise.
1559
1560 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1561
1562         C# 2.0 DefaultCharSetAttribute implementation
1563         
1564         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1565         which allows us to set GlobalNamespace for every resolve.
1566         (Attribute.ResolveArguments): Cut from Resolve.
1567         (Attribute.GetCharSetValue): Returns CharSet named argument.
1568         (Attribute.DefinePInvokeMethod): Gets default charset from
1569         module settings.
1570         (GlobalAttribute.ResolveAsTypeStep): Override.
1571         (GlobalAttribute.ResolveArguments): Override.
1572         
1573         * class.cs (TypeAttr): Is protected.
1574         
1575         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1576         (ModuleClass.DefaultCharSetType): New memeber.
1577         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1578         
1579         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1580         charset from module.
1581         
1582         * delegate.cs (TypeAttr): Override.
1583         (Delegate.DefineType): Use this TypeAttr.
1584         
1585         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1586         at very early stage (before types are defined) to resolve model
1587         module attributes. It will probably not work with corlib but it
1588         should be ok.
1589         
1590         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1591         charset from module.
1592         
1593         * typemanager.cs (default_charset_type): New type.
1594
1595 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1596
1597         * decl.cs (MemberCache.AddMethods): Don't warn if
1598         System.Object.Finalize has buggy MethodAttributes.
1599
1600         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1601         removed below.
1602
1603 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1604
1605         * doc.cs : detect ambiguous reference to overloaded members.
1606           Fixed bug #71603. MS 1.1 csc does not detect it.
1607
1608 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1609
1610         * doc.cs : delegates must not be referenced with parameters.
1611           Fixed bug #71605.
1612
1613 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1614
1615         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1616
1617 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1618
1619         * driver.cs (MainDriver): Stop processing if the CLS stage found
1620         errors. 
1621
1622         (CompilerCallableEntryPoint.InvokeCompiler): Always
1623         reset after execution;   Take a TextWriter argument for the
1624         output.
1625
1626         * report.cs: Use the error stream instead of hardcoding stderr. 
1627
1628 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1629
1630         * class.cs: Reduce code paths to test, too small of an
1631         optimization to make it worth the extra testing.  Always perform
1632         it. 
1633
1634 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1635
1636         Fix #74510.
1637         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1638         operators that had errors reported on them.
1639
1640 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1641
1642         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1643         argument types.
1644         (Attribute.Resolve): Add named argument type checking.
1645         
1646         * class.cs (FixedField.Define): Use IsPrimitiveType
1647         
1648         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1649         
1650         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1651         unsafe parameter types.
1652         
1653         * statement.cs (Using.ResolveExpression): Add better error description.
1654         
1655         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1656         
1657 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1658
1659         Fix #74484.
1660         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1661         AttributeUsageAttribute in the emitcontext of the attribute class,
1662         not in the emitcontext of the attributable entity it was attached to.
1663         * cs-parser.jay: Use 'current_class', not 'current_container',
1664         when creating a GlobalAttribute.
1665
1666 2005-04-08  Alp Toker  <alp@atoker.com>
1667
1668         * pending.cs: The fix to #58413 failed to compile methods implementing
1669         interfaces with/without params modifiers and vice versa, even though
1670         params modifiers aren't part of the signature. Make the modifier check
1671         less strict as in csc.
1672
1673 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1674             Anoob V E  <projectmonokochi@rediffmail.com>
1675             Harilal P R  <projectmonokochi@rediffmail.com>
1676
1677         Fix #58413.
1678         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1679         modifiers of pending methods.
1680         (PendingImplementation.PendingImplementation): Initialize it.
1681         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1682         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1683         with ParameterData.  Add check for modifiers.
1684         * class.cs (MethodData.Define): Update to changes.
1685
1686 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1687
1688         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1689
1690 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1691
1692         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1693         property.
1694         
1695         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1696         
1697         * rootcontext.cs,
1698         * typemanager.cs: Registered RequiredAttributeAttribute.
1699         
1700 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1701
1702         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1703         Warning CS0169 is back at level 3.
1704         (IMethodData.SetMemberIsUsed): New method.
1705         
1706         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1707         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1708         
1709         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1710
1711         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1712         contants.
1713         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1714         is used.
1715         
1716         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1717         is used.
1718         
1719         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1720         to avoid the problems with nested types.
1721
1722 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1723             Anoob V.E  <projectmonokochi@rediffmail.com>
1724             Harilal P.R  <projectmonokochi@rediffmail.com>
1725             Raja R Harinath  <rharinath@novell.com>
1726
1727         Fix #73820.
1728         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1729         attribute.
1730         * typemanager (GetConstructor): Make public.
1731
1732 2005-04-05  John Luke  <john.luke@gmail.com>
1733             Raja R Harinath  <rharinath@novell.com>
1734
1735         Fix #62232.
1736         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1737         struct too.  Return false quicker in a few cases.
1738         (VerifyUnManaged): Use it.
1739
1740 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1741
1742         Fix #74041.
1743         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1744         not 'unreachable_seen'.
1745
1746 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1747
1748         * attribute.cs (Attribute.GetValue): Removed unused.
1749         
1750         * codegen.cs (CodeGen.TrimExt): Removed unused.
1751         
1752         * cs-parser.jay (output): Removed unused.
1753         
1754         * cs-tokenizer.cs (hex_digits): Removed unused.
1755         
1756         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1757         
1758         * expression.cs (Indirection.LoadExprValue): Removed unused.
1759         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1760         
1761         * iterators.cs (Iterator.param_types): Removed unused.
1762         
1763         * statement.cs (Goto.block): Removed unused.
1764         (ToplevelBlock.did): Removed unused.
1765         (Switch.ResolveConstantSwitch): Removed unused.
1766
1767 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1768
1769         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1770         resetting thingy.
1771
1772 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1773
1774         Fix #74232 and cs0208-3.cs.
1775         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1776         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1777         unmanaged type.  Don't use FieldBuilders when 't' is a
1778         TypeBuilder.  Use ModFlags and MemberType fields.
1779         * class.cs (MemberBase.member_type): Rename from MemberType.
1780         (MemberBase.MemberType): New property.  Determines member_type on
1781         demand.
1782         (MemberBase.DoDefine): Don't initialize MemberType here.
1783         (FieldMember.Define): Likewise.
1784
1785 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1786
1787         Fix #74241
1788         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1789         Attributes are emitted there.
1790         
1791 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1792
1793         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1794         keyword in 'partial enum' too.
1795         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1796         is not allowed).
1797         Report from Kamil Skalski <nazgul@omega.pl>.
1798
1799         Fix #74309.
1800         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1801         have partial containers too.
1802
1803         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1804         in block' checks to Block.CheckInvariantMeaningInBlock.
1805         * statement.cs (Block.GetKnownVariableInfo): Make private.
1806         (Block.IsVariableUsedInChildBlock): Remove.
1807         (Block.IsVariableUsedInBlock): Likewise.
1808         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1809         conflicting declaration.
1810         (Block.AddVariable): Make error messages less long-winded and more
1811         specific.  Show location of conflicting declaration.
1812         * parameter.cs (Parameters.Location): New readonly property.
1813
1814 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1815
1816         Clean up semantics of invoking ResolveMemberAccess.
1817         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1818         can have an instance, ensure that we pass in a non-TypeExpression
1819         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1820         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1821         argument.  Update to changes and simplify.
1822         (FieldExpr.Emitinstance): Remove CS0120 check.
1823         (PropertyExpr.EmitInstance): Likewise.
1824         * expression.cs (Argument.Resolve): Likewise.
1825         (Invocation.DoResolve): Update to changes in semantics of
1826         InstanceExpression.
1827
1828 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1829
1830         Fix #74241
1831         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1832         customization.
1833         
1834         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1835
1836 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1837
1838         Fix difference in behaviour with commandline invocation.
1839         * driver.cs (Driver.Reset): New.
1840         (CompilerCallableEntryPoint): Call it.
1841
1842         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1843         variable" warnings if the boolean expression failed to resolve.
1844
1845 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1846
1847         * attribute.cs: Fix the union of several permissions when some of them
1848         are unrestricted (so the result isn't an unrestricted permission set).
1849         Fix #74036.
1850
1851 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1852
1853         * ecore.cs (MemberExpr): New class.  Convert from interface
1854         IMemberExpr.
1855         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1856         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1857         error checks.
1858         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1859         (MethodGroupExpr.IsExplicitImpl): Remove.
1860         (Expression.GetFieldFromEvent): Remove.
1861         (SimpleName.MemberStaticCheck): Remove.
1862         (SimpleName.DoSimpleNameResolve): Update to changes.
1863         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1864         (MemberAccess.IdenticalNameAndTypeName): Remove.
1865         (MemberAccess.error176): Move to MemberExpr.
1866         (MemberAccess.DoResolve): Update to changes.
1867         (BaseAccess.DoResolve): Likewise.
1868
1869 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1870
1871         C# 2.0 Conditional attribute class implementation
1872         
1873         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1874         Analyzes class whether it has attribute which has ConditionalAttribute
1875         and its condition is not defined.
1876         
1877         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1878         (Class.IsExcluded): New method. Search for at least one defined
1879         condition in ConditionalAttribute of attribute class.
1880
1881 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1882
1883         * ecore.cs (PropertyExpr): Derive from Expression, not
1884         ExpressionStatement.
1885         (PropertyExpr.EmitStatement): Remove.
1886
1887 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1888
1889         Fix #74060.
1890         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1891         internal field "value__" of an enum be private.  The examples for
1892         "value__" that I found on MSDN all used FieldAttributes.Private.
1893
1894         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1895         Don't mention IL method attribute names.
1896
1897         Fix #47991.  Remove a TODO.
1898         * statement.cs (Block.Toplevel): Make into a field.
1899         (Block.Parameters): Move into ToplevelBlock.
1900         (Block.known_variables): Rename from child_variable_names.
1901         (Block.Block): Remove variants that take Parameters.  Initialize
1902         'Toplevel' with the immediately surrounding toplevel block.
1903         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1904         LocalInfo parameter.
1905         (Block.GetKnownVariableInfo): New.
1906         (Block.IsVariableNameUsedInChildBlock): Update.
1907         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1908         the block, even though it may not be in scope.
1909         (Block.AddVariable): Remove Parameters parameter.  Use
1910         Toplevel.Parameters instead.
1911         (Block.AddConstant): Remove Parameters parameter.
1912         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1913         (Block.IsParamaterReference): Likewise.
1914         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1915         (ToplevelBlock.Parameters): New.  Moved from Block.
1916         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1917         initialize Parameters to a non-null value.
1918         * cs-parser.jay: Update to changes.
1919         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1920         simple names that mean different things in the same block.  Use
1921         Block.IsVariableNameUsedInBlock.
1922
1923 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1924
1925         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1926         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1927         GetTypeHandle.  It is possible for a reflected type to derive from
1928         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1929         System.Array during mscorlib compilation).
1930         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1931         contain a method_hash, don't create one either.  Don't create a
1932         deep copy of the base cache's method_hash.
1933         (MemberCache.SetupCache): Rename back from DeepCopy.
1934         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1935         already initialized.  If we see an override function, add its
1936         underlying base virtual function to the member_hash too.
1937
1938         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1939
1940 2005-03-26  Raja R Harinath  <harinath@acm.org>
1941
1942         Fix #73038.
1943         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1944         fails to resolve, ensure that the LHS is still resolved as an
1945         lvalue.
1946
1947 2005-03-25  Raja R Harinath  <harinath@acm.org>
1948
1949         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1950         ec.ContainerType.
1951         (Enum.current_ec): Remove.
1952         (Enum.LookupEnumValue): Remove EmitContext argument.
1953         Just uses the one created during DefineType.
1954         (Enum.FindMembers): Update.
1955         * expression.cs (MemberAccess.DoResolve): Update.
1956
1957 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1958
1959         * assign.cs (Assign.DoResolve): Check for CS1717 when
1960         source and target are same (uses Equals).
1961
1962         * expression.cs (LocalVariableReference, ParameterReference,
1963         This): Implemented Equals, GetHashCode.
1964
1965         * statement.cs (Block.GetParameterReference): Removed useless
1966         local variable.
1967
1968 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1969
1970         Fix cs0128.cs
1971         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1972         blocks before deciding whether the error is cs0136 or cs0128.
1973
1974         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1975         (using_alias_directive, using_namespace_directive): Pass
1976         MemberName, not an expression to Namespace.UsingAlias and
1977         Namespace.Using.
1978         (MakeName): Use the MemberName of the namespace.
1979         * namespace.cs (Namespace.MemberName): New.
1980         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1981         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1982         Likewise.
1983         * decl.cs (MemberName.Name): Make readonly.
1984         (MemberName.FromDotted): New "constructor".
1985         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1986         (MemberCore.Name): Compute from MemberName on demand.
1987         (MemberCore.SetMemberName): Provide a way to change the
1988         MemberName.
1989         (MemberCore.AddToContainer): Don't take a fullname parameter.
1990         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1991         fully qualified name of the container to the member name.
1992         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1993         only if the type is a member of the root container.
1994         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1995         MemberName.Left rather than searching for an embedded ".".
1996         (PartialContainer.CreatePart): Update to changes in RootContext.
1997         (MemberBase.ShortName): Turn into a property.  Use
1998         MemberCore.SetMemberName.
1999         (MemberBase.ExplicitInterfaceName): Remove.
2000         (MemberBase.UpdateMemberName): Remove.
2001         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2002         (PropertyBase.SetMemberName): New override.
2003         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2004         (Tree.GetDecl): New.
2005         (Tree.AllDecls): Rename from Decls.
2006         * attribute.cs, enum.cs, report.cs: Update to changes.
2007         * driver.cs (MainDriver): Use MemberName.FromDotted on
2008         RootContext.MainClass.
2009
2010 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2011
2012         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2013         checks.
2014
2015         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2016
2017 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2018
2019         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2020         property accessor modifiers.
2021
2022         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2023         fixed buffer attribute (CS1716).
2024         (PropertyMethod.HasCustomAccessModifier): When property accessor
2025         has custom modifier.
2026
2027         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2028         modifiers.
2029         (PropertyExpr.DoResolveLValue): Add CS0272.
2030
2031 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2032
2033         * convert.cs: When converting to a pointer, use the proper Conv.U
2034         or Conv.I depending on the source data type.
2035
2036         * cs-tokenizer.cs: Make the size for large decimal constants,
2037         fixes #72957.
2038
2039 2005-03-17  Martin Baulig  <martin@ximian.com>
2040
2041         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2042         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2043
2044 2005-03-17  Martin Baulig  <martin@ximian.com>
2045
2046         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2047         to bool so we can return an error condition.
2048         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2049         returned an error.
2050
2051 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2052
2053         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2054         attributes.
2055
2056 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2057
2058         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2059         Refactor to avoid traversing the list of assemblies, and to avoid
2060         string concatenation.
2061         * typemanager.cs (guid_attr_type): Remove.
2062         (negative_hits, pointers, references): Remove hashes.
2063         (type_hash): New.
2064         (GetConstructedType): New.  Uses type_hash to handle constructed
2065         types (arrays, references, pointers).
2066         (GetReferenceType, GetPointerType): Use it.
2067         (GetNestedType): New.  Uses type_hash to handle nested types of
2068         reflected types.
2069         (LookupType, LookupTypeDirect): Remove.
2070         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2071         'types' hash and LookupTypeReflection directly.
2072         (params_string, params_object): Use GetConstructedType.
2073         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2074         top-level types.
2075         (Namespace.Lookup): Use cached_types.
2076         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2077         provided by old TypeManager.LookupType.
2078         * rootcontext.cs (MakeFQN): Remove.
2079         * decl.cs (DeclSpace.MakeFQN): Likewise.
2080         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2081         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2082         TypeManager.GetConstructedType.
2083         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2084
2085 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2086
2087         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2088         indexers.
2089
2090         * cs-parser.jay: Reports CS1527 for any namespace element.
2091
2092         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2093         Added CS0407.
2094
2095         * expression.cs (ParameterReference.IsAssigned): Changed error to
2096         CS0269.
2097         (Error_WrongNumArguments): Moved CS0245 detection here.
2098
2099         * statement.cs (Return.Resolve): Add CS1622 report.
2100
2101 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2102
2103         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2104
2105 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2106
2107         * attribute.cs expression.cs: Get rid of some allocations.
2108
2109 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2110
2111         * doc.cs : just eliminate the latest change.
2112
2113 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2114
2115         * doc.cs : commented out the latest change. It breaks xml-030.cs
2116
2117 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2118
2119         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2120           fail. So invoke CreateType() in FindDocumentedType().
2121
2122 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2123
2124         * cs-tokenizer.cs : added IsKeyword().
2125         * doc.cs : Detect keyword incorrectly used as identifier.
2126           Allow identifiers prefixed by @.
2127
2128 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2129
2130         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2131         It caused exception in namespace resolving (again!).
2132         
2133         * class.cs (Class.ctor): Removed exit.
2134         (PropertyMethod.ctor): ditto.
2135         
2136         * codegen.cs (Codegen.Reset): Reset static data.
2137         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2138         
2139         * cs-tokenizer.cs (Cleanup): Removed.
2140         
2141         * driver.cs (GetSystemDir): Rewrote to one line command.
2142         It caused problem with unloaded dynamic modules.
2143         (UnixParseOption): Removed Exit.
2144         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2145         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2146         Now can be mcs used as library.
2147         
2148         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2149         empty location.
2150         
2151         * location.cs (Reset): Reset static data.
2152         
2153         * namespace.cs (Reset): Reset static data.
2154         
2155         * report.cs (Report.Reset): Reset static data.
2156         
2157         * rootcontext.cs (RootContext.Reset): Reset static data.
2158         
2159         * tree.cs (RootTypes.ctor): Use Location.Null
2160         
2161         * typemanager.cs (TypeManager.Reset): Reset static data.
2162         (CoreLookupType): Removed Exit.
2163         (TypeHandle.Reset): Reset static data.
2164         
2165 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2166
2167         Fix #73516.
2168         * typemanager.cs (ComputeNamespaces): Import namespaces from
2169         referenced modules too.
2170
2171 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2172
2173         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2174         than '.'.
2175
2176 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2177
2178         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2179         enclosing DeclSpace.  This ensures that a name-lookup populates
2180         more caches and there are fewer 'TypeExpression's.  Carve out
2181         nested type lookup into ...
2182         (LookupNestedTypeInHierarchy): ... this.
2183
2184 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2185
2186         Clean up a few partial-class semantics.  
2187         Fixes test-357.cs and cs1618-2.cs.
2188         * cs-parser.jay (struct_declaration): Use 'current_class' as
2189         parent of newly-created struct.  Remove call to Register ().
2190         Use 'pop_current_class' to complete handing the current struct.
2191         (interface_declaration): Likewise.
2192         (class_declaration): Likewise.
2193         (enum_declaration): Use 'current_class' as parent of newly created
2194         enum.
2195         (delegate_declaration): Likewise.
2196         (pop_current_class): New function.  This is used to handle closing
2197         up the 'current_class' and 'current_container', and pointing them
2198         to the enclosing class/container.
2199         (CSharpParser): Initialize 'current_class' too.
2200         * decl.cs (MemberCore): Add check for invariant: a partial
2201         container is not a parsed entity, and thus does not enclose any
2202         parsed members.
2203         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2204         (DeclSpace.BaseTypeExpr): Use it.
2205         (DeclSpace.LookupType): Add check for invariant.
2206         * class.cs (TypeContainer): Add check for invariant: a nested
2207         class should have the same NamespaceEntry as its enclosing class.
2208         (TypeContainer.EmitFieldInitializers): Make virtual.
2209         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2210         MemberCore.
2211         (TypeContainer.Register): Remove.
2212         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2213         null.  Use TypeResolveEmitContext for resolving base types and
2214         interfaces.  Move initialization of Parts.TypeBuilder here from
2215         ...
2216         (TypeContainer.DefineNestedTypes): ... here.
2217         (PartialContainer): Take a Namespace not a NamespaceEntry.
2218         (PartialContainer.Create): Don't use Register.  Call the
2219         appropriate Add... function directly.
2220         (ClassPart): Take both the PartialContainer and the enclosing
2221         class as constructor arguments.
2222         (ClassPart.EmitFieldInitializers): Override.
2223         (ClassPart.PartFindNestedTypes): Remove.
2224         (FieldBase.GetInitializerExpression): Resolve the initializer
2225         expression in the emit context of the enclosing class.
2226         * tree.cs (RootTypes): Remove Register ().
2227         
2228 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2229
2230         * cs-parser.jay: Removed CS0134.
2231         
2232         * driver.cs: Removed CS1901.
2233         
2234         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2235         for predefined types.
2236
2237 2005-03-07  Duncan Mak  <duncan@novell.com>
2238
2239         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2240         well. Fixes bug #73454.
2241
2242 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2243
2244         * cs-tokenizer.cs (xtoken): Add CS1035.
2245         
2246         * class.cs (MethodData.Define): Add CS0683.
2247         (FieldMember.ctor): Add CS0681.
2248
2249 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2250
2251         * ecore.cs (SimpleName.DoResolve): Rename from
2252         SimpleName.DoResolveAllowStatic.
2253         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2254         Pass 'intermediate' flag to MemberStaticCheck.
2255         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2256         of "intermediate" lookups via MemberAccess.
2257         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2258         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2259
2260 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2261
2262         Fix #73394.
2263         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2264         slipped in because of variable names that are identical to a
2265         builtin type's BCL equivalent ('string String;', 'int Int32;').
2266         (PropertyExpr.EmitInstance): Likewise.
2267
2268 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2269
2270         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2271         
2272         * report.cs (warning_ignore_table): Made public.
2273
2274 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2275
2276         Fix #73282.
2277         * class.cs (MethodData.Emit): Pass 'container' to
2278         container.GetObsoleteAttribute instead of 'container.Parent'.
2279
2280 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2281
2282         * cs-parser.jay: Add 1534 error test.
2283
2284         * iterators.cs (Yield.CheckContext): Add error 1629.
2285         (Iterator.ctor): Save unsafe modifier.
2286         (MoveNextMethod.DoEmit): Restore unsafe context.
2287
2288         * namespace.cs (UsingAlias): Better error message.
2289
2290 2005-03-03  Dan Winship  <danw@novell.com>
2291
2292         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2293         the warning message [#73219]
2294
2295 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2296
2297         Fix compile with MCS 1.0.0.0.
2298         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2299         w_restore to not depend on string constant folding.
2300
2301 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2302
2303         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2304         CS0246 check to users who passed 'silent = false'.
2305         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2306         check.
2307         (SimpleName.SimpleNameResolve): Update.
2308         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2309         (MemberAccess.IdenticalNameAndTypeName): Update.
2310         * doc.cs (FindDocumentedTypeNonArray): Update.
2311
2312 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2313
2314         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2315         * parameters.cs (ComputeAndDefineParameters): Remove.
2316         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2317         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2318         Use GetParameterInfo.
2319
2320 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2321
2322         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2323
2324 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2325
2326         Unify DeclSpace.LookupType and DeclSpace.FindType.
2327         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2328         is in charge of defining nested types on demand.
2329         (DeclSpace.LookupType): Use it when the current_type is a
2330         TypeBuilder.  Use LookupTypeDirect for reflected types.
2331         (DeclSpace.FindType): Remove.
2332         (DeclSpace.LookupInterfaceOrClass): Likewise.
2333         (DeclSpace.DefineTypeAndParents): Likewise.
2334         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2335         DeclSpace.LookupType.
2336         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2337         * typemanager.cs (LookupType): Simplify.
2338         (AddUserType): Remove type from negative_hits.
2339         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2340         * class.cs (TypeContainer.FindMembers): Move handling of nested
2341         types ...
2342         (TypeContainer.FindMembers_NestedTypes): ... here.
2343         (TypeContainer.FindNestedType): Implement override.
2344         (ClassPart.FindNestedType): Delegate to PartialContainer.
2345         (ClassPart.PartFindNestedType): Looks up the nested types of the
2346         part alone.
2347
2348 2005-03-02  Martin Baulig  <martin@ximian.com>
2349
2350         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2351         static constructor in static classes.
2352
2353 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2354
2355         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2356         sizeParamIndex is not specified.
2357
2358 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2359
2360         Fix #73117
2361         * report.cs (WarningMessage.IsEnabled): Missing null check.
2362
2363 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2364
2365         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2366         in the fields and not in the properties.
2367
2368 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2369
2370         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2371         fields as well.
2372
2373 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2374
2375         * attribute.cs: Small refactoring (improved robustness).
2376         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2377         (ValidateGuid): Removed.
2378         (Resolve): Removed referenced to above mentioned.
2379         (GetAttributeUsage): Made private and changed to work without
2380         class assistance.
2381         (GetIndexerAttributeValue): Don't crash.
2382         (GetConditionalAttributeValue): Ditto.
2383         (GetClsCompliantAttributeValue): Ditto.
2384         (ExtractSecurityPermissionSet): All attributes exceptions are
2385         error 648.
2386         (GetPropertyValue): New helper.
2387         (GetMethodImplOptions): New method.
2388         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2389         some missing properties.
2390         
2391         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2392         (Method.ApplyAttributeBuilder): Updated.
2393         
2394         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2395         exception.
2396
2397 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2398
2399         Fix #73052.
2400         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2401         non-simple types (array, pointer, reference).
2402
2403 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2404
2405         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2406
2407         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2408         for operators.
2409         (Method.CheckBase): Catch wrong destructor here.
2410         (MethodData.Define): Add errors 550, 668.
2411
2412         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2413
2414         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2415
2416         * pending.cs (VerifyPendingMethods): Add error 551.
2417
2418         * typemanager.cs (CSharpName): Next error report helper.
2419
2420 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2421
2422         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2423         attributes. Removed useless attribute double check.
2424         It saves almost 2MBs for corlib.
2425
2426 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2427
2428         Fix #72924.
2429         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2430         called twice in case of error.
2431
2432 2005-02-23  Chris Toshok  <toshok@ximian.com>
2433
2434         Fix compiler portions of #72827.
2435         * statement.cs (Block.Emit): call Begin/EndScope on the
2436         EmitContext instead of the ILGenerator.
2437
2438         * codegen.cs (EmitContext.BeginScope): new method, call
2439         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2440         we have one.)
2441         (EmitContext.BeginScope): same, but EndScope and CloseScope
2442
2443         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2444         offset and call the superclass's OpenScope(int) with it.
2445         (SymbolWriter.CloseScope): get the current il
2446         offset and call superclass's CloseScope(int) with it.
2447
2448 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2449
2450         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2451         CS1677 for out and ref as well.
2452
2453         * class.cs (Method.Define): Add error CS1599 detection.
2454         
2455         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2456         
2457         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2458         
2459         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2460         
2461         * support.cs.cs (ModifierDesc): New helper method.
2462
2463 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2464             Abin Thomas  <projectmonokochi@rediffmail.com>
2465             Anoob V E  <projectmonokochi@rediffmail.com>
2466             Harilal P R  <projectmonokochi@rediffmail.com>
2467
2468         Fix #57851, #72718.
2469         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2470         MemberLookup (used for error reporting) actually returns a result.
2471         Fix error report number (122, not 112).
2472
2473 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2474             Anoob V E  <projectmonokochi@rediffmail.com>
2475             Harilal P R  <projectmonokochi@rediffmail.com>
2476
2477         Fix #71134.
2478         * pending.cs (PendingImplementation.GetAbstractMethods):
2479         Find NonPublic members too.
2480
2481 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2482
2483         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2484         Fixed error 217.
2485         
2486         * class.cs (MethodCore.CheckMethodAgainstBase):
2487         Add error 239 report.
2488
2489 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2490
2491         Fix #68955.
2492         * expression.cs (Invocation.IsApplicable): Make public.
2493         (Invocation.IsParamsMethodApplicable): Likewise.
2494         * delegate.cs (Delegate.VerifyApplicability): Don't use
2495         Invocation.VerifyArgumentCompat for parameter applicability
2496         testing.  Use Invocation.IsApplicable and
2497         Invocation.IsParamsMethodApplicable.
2498
2499 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2500
2501         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2502         
2503         * class.cs (Operator.Define): Add error 217 report.
2504         
2505 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2506
2507         * namespace.cs (UsingEntry.Resolve): Undo change below.
2508
2509 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2510
2511         Fix #72756.
2512         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2513         disable the error message when the extended MemberLookup also
2514         fails.
2515         (Expression.MemberLookupFinal): Update.
2516         (SimpleName.DoSimpleNameResolve): Update.
2517         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2518         Don't use MemberLookupFinal.
2519         (New.DoResolve): Update.
2520         (BaseAccess.CommonResolve): Update.
2521
2522 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2523
2524         Fix #72732.
2525         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2526         occured previously, don't resolve again.
2527
2528 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2529
2530         Fix #69949
2531         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2532         argument. Call ResolveAttributeUsage for unresolved.
2533         when types doesn't match ctor arguments.
2534         
2535         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2536         for nested attribute classes.
2537         (Class.attribute_usage): Removed.
2538         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2539         for attribute class.
2540         
2541         * ecore.cs (IsAttribute): Removed.
2542         
2543         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2544         
2545         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2546         now normal types.
2547         (attribute_types): Removed.
2548         (EmitCode): Global attributes are emited as the latest.
2549
2550 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2551
2552         * class.cs (EmitFieldInitializers): Don't emit field initializer
2553         for default values when optimilization is on.
2554         
2555         * constant.cs (Constant.IsDefaultValue): New property.
2556         
2557         * driver.cs: Add /optimize handling.
2558         
2559         * constant.cs,
2560         * ecore.cs,
2561         * literal.cs: Implement new IsDefaultValue property.
2562         
2563         * rootcontext.cs (Optimize): New field, holds /optimize option.
2564
2565 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2566
2567         Fix crasher in re-opened #72347.
2568         * namespace.cs (Namespace.Lookup): Return null if
2569         DeclSpace.DefineType returns null.
2570
2571         Fix #72678.
2572         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2573
2574 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2575
2576         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2577         now returns null if it cannot resolve to an lvalue.
2578         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2579         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2580         returned null.  Remove check for SimpleName.
2581         (EventExpr.DoResolveLValue): New.
2582         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2583         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2584         error from ...
2585         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2586         avoid CS0131 error.
2587         (Unary.ResolveOperator): Move CS0211 check ...
2588         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2589         CS0131 error.
2590         (Unary.DoResolveLValue): Simplify.
2591         (AddressOf.DoResolveLValue): New.
2592         (ArrayAccess.DoResolveLValue): New.
2593
2594 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2595
2596         * attribute.cs (Attribute.Resolve): Add arguments casting for
2597         when types doesn't match ctor arguments.
2598
2599 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2600
2601         Fix parts of #63202.
2602         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2603         lookup of operator in base type.  Ensure that all checks happen
2604         when the operator resolves to an "op_..." method.
2605
2606 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2607
2608         Fix #71992.
2609         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2610         'ignore_cs0104' parameter.  Pass it to ...
2611         (NamespaceEntry.Lookup): ... this.
2612         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2613         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2614         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2615         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2616         Update.  Request that cs0104 errors be ignored.
2617         (ComposedCast.ResolveAsTypeStep): Update.
2618
2619 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2620
2621         Fix #59209.
2622         * expression.cs (Invocation.BetterFunction): Remove support for
2623         comparing virtual functions and their overrides.
2624         (Invocation.IsOverride): New.
2625         (Invocation.OverloadResolve): Don't consider 'override' functions
2626         during candidate selection.  Store them in a lookaside list.
2627         If the selected method is a 'virtual' function, use the list to
2628         find any overrides that are closer to the LHS type.
2629
2630 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2631
2632         * expression.cs (New.DoResolve): Add complex core type reduction.
2633         (New.Constantify): Converts complex core type syntax like 'new int ()'
2634         to simple constant.
2635         
2636 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2637
2638         * decl.cs (EntryType.EntryType): New constructor to create an
2639         updated copy of a cache entry.
2640         (MemberCache.AddMethods): Use it.
2641         (MemberCache.ClearDeclaredOnly): Remove.
2642         (MemberCache.MemberCache): Update.
2643
2644 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2645
2646         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2647         variable.  This one is represents the actual low-level declaration
2648         of the method, as opposed to the semantic level `IsStatic'.   
2649
2650         An anonymous method which is hosted into a static method might be
2651         actually an instance method.  IsStatic would reflect the
2652         container, while MethodIsStatic represents the actual code
2653         generated.
2654
2655         * expression.cs (ParameterReference): Use the new MethodIsStatic
2656         instead of IsStatic.
2657
2658         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2659         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2660         set on the current EmitContext. 
2661
2662         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2663         resolve our casted expression as an LValue.  This triggers the
2664         proper LValue processing that is later required by Assign.
2665
2666         This fixes 72347.
2667
2668         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2669
2670 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2671
2672         C# 2.0 Fixed buffer implementation
2673
2674         * anonymous.cs: Update after RegisterHelperClass renaming.
2675
2676         * attribute.cs (AttributeTester.fixed_buffer_cache):
2677         Cache of external fixed buffers.
2678         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2679         implementation if field is fixed buffer else null.
2680
2681         * class.cs
2682         (TypeContainer.AddField): Accept FieldMember instead of Field.
2683         (FieldBase.IsFieldClsCompliant): Extracted code from
2684         VerifyClsCompliance descendant customization.
2685         (FixedField): New class handles fixed buffer fields.
2686         (FixedFieldExternal): Keeps information about imported fixed
2687         buffer.
2688         (IFixedField): Make access to internal or external fixed buffer
2689         same.
2690
2691         * cs-parser.jay: Add fixed buffer parsing.
2692
2693         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2694         buffer.
2695
2696         * expression.cs (Indirection): Extended implementation to accept
2697         fixed buffer field.
2698         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2699         (ElementAccess.MakePointerAccess): Get type as parameter.
2700         (DoResolve): Add fixed buffer field expression conversion.
2701         (DoResolveLValue): Ditto.
2702         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2703         (ArrayPtr): Derives from FixedBufferPtr.
2704         (ArrayPtr.Emit): Add extra emit for array elements.
2705
2706         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2707
2708         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2709         for compiler generated types.
2710         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2711
2712         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2713         and consume less memory.
2714         (Fixed.Resolve): Add fixed buffer case.
2715
2716         * typemanager.cs (compiler_generated_attr_ctor,
2717         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2718         (HasElementType): Add our own implementation to work on every
2719         runtime.
2720
2721 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2722
2723         * anonymous.cs (CaptureContext): Track whether `this' has been
2724         referenced.   
2725
2726         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2727         only captured `this' if it was implicitly done (instance
2728         methods/variables were used). 
2729
2730         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2731         `this' must be captured.
2732
2733 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2734  
2735         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2736         is null it means that there has been no need to capture anything,
2737         so we just create a sibling.
2738
2739         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2740
2741         Just a partial fix.  The other half is fairly elusive.
2742         
2743 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2744
2745         Fix #52586, cs0121-4.cs.
2746         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2747         and return a hashtable.
2748         (MemberCache.ClearDeclaredOnly): New.
2749         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2750         the method_hash of a base type too.
2751         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2752         type methods.  Overwrite entries with the same MethodHandle so
2753         that the ReflectedType is correct.  The process leaves in base
2754         virtual functions and their overrides as distinct entries.
2755         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2756         matters since it was boxed in a ArrayList before.
2757         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2758         modifier.
2759         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2760         case of a virtual function and its override (choose the overload
2761         as better).
2762         (Invocation.OverloadResolve): Avoid 'override' members during
2763         'applicable_type' calculation.
2764
2765 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2766
2767         Combine two near-redundant caches.
2768         * typemanager.cs (method_params): Rename from method_internal_params.
2769         (TypeManager.GetParameterData): New.  Replace
2770         Invocation.GetParameterData.
2771         (TypeManager.LookupParametersByBuilder): Remove.
2772         * expression.cs (Invocation.method_parameter_cache): Remove.
2773         (Invocation.GetParameterData): Remove.
2774         Update to changes.
2775         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2776         Update to changes.
2777
2778 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2779
2780         Fix #72015.
2781         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2782         TypeManager.multicast_delegate_type is null, resolve it by looking
2783         up "System.MulticastDelegate".
2784         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2785
2786 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2787             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2788             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2789
2790         Fix cs0164.cs.
2791         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2792         (LabeledStatement.AddReference): New.  Set 'referenced'.
2793         (Goto.Resolve): Use it.
2794
2795 2005-02-05  John Luke  <john.luke@gmail.com>
2796
2797         * driver.cs: remove duplicate -doc line in Usage ()
2798
2799 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2800
2801         * location.cs (Location.AddFile): Fix CS2002 error report.
2802
2803 2005-02-02  Martin Baulig  <martin@ximian.com>
2804
2805         * delegate.cs (Delegate.DefineType): Report an internal error if
2806         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2807         details.        
2808
2809 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2810
2811         Fix a crasher in a variant of #31984.
2812         * const.cs (Constant.CheckBase): New override that defers the
2813         new-or-override check in case the base type hasn't been populated
2814         yet.
2815         (Constant.Define): Ensure the new-or-override check is performed.
2816
2817 2005-02-01  Duncan Mak  <duncan@ximian.com>
2818
2819         * const.cs (LookupConstantValue): Check that `ce' is not null
2820         before calling GetValue ().
2821
2822 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2823
2824         Fix test-334.cs (#69519).
2825         * cs-parser.jay (using_alias_directive): Pass in an expression to
2826         NamespaceEntry.UsingAlias.
2827         (using_namespace_directive): Pass in an expression to
2828         NamespaceEntry.Using.
2829         (namespace_name): Don't flatten to a string.
2830         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2831         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2832         ResolveAsTypeStep.
2833         (NamespaceEntry.UsingEntry): Likewise.
2834         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2835         changes.
2836         (NamespaceEntry.LookupForUsing): Remove.
2837         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2838         names.
2839         (NamespaceEntry.Lookup): Remove support for dotted names.
2840
2841 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2842
2843         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2844         split into two.
2845         (NamespaceEntry.ImplicitParent): Compute on demand.
2846         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2847         parallels the current.
2848         (NamespaceEntry.LookupForUsing): Use it.
2849         (NamespaceEntry.Lookup): If the current namespace-entry is
2850         implicit, don't search aliases and using tables.
2851
2852 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2853
2854         Fix #31984.
2855         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2856         BaseCache here.
2857         (TypeContainer.BaseCache): Compute on demand.
2858         (TypeContainer.FindMembers): Define constants and types if they're
2859         not already created.
2860         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2861         check.
2862         * const.cs (Constant.Define): Make idempotent.
2863
2864 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2865
2866         * pending.cs: Produce better code (no nops produced by using Ldarg
2867         + value).
2868         
2869         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2870         i - 1' it should be arg + 1.
2871
2872         Fixes bug #71819.
2873
2874 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2875
2876         * attribute.cs (Attribute.CheckAttributeType): Make private
2877         non-virtual.
2878         (Attribute.ResolveType): Make virtual.
2879         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2880         handling of RootContext.Tree.Types.
2881
2882 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2883
2884         Update attribute-handling to use the SimpleName/MemberAccess
2885         mechanisms.
2886         * cs-parser.jay (attribute): Pass in an expression to the
2887         constructors of Attribute and GlobalAttribute.
2888         * attribute.cs (Attribute): Take an expression for the name.
2889         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2890         passed in attribute name expression.
2891         (Attribute.CheckAttributeType): Use it.
2892         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2893         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2894         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2895         argument to prevent error messages if the lookup fails.
2896
2897 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2898
2899         * expression.cs (Indirection): Implemented IVariable interface
2900         to support indirection in AddressOf operator.
2901         (PointerArithmetic.Emit): Add optimalization for case where
2902         result can be precomputed.
2903
2904 2005-01-26  Martin Baulig  <martin@ximian.com>
2905
2906         * class.cs (TypeContainer.AttributeTargets): Return the correct
2907         AttributeTargets depending on our `Kind' instead of throwing an
2908         exception; fixes #71632.
2909
2910 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2911
2912         Fix #71257
2913         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2914         constant members.
2915
2916 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2917
2918         Fix #71602.
2919         * expression.cs (MemberAccess.DoResolve): Don't complain with
2920         cs0572 when the LHS of a member access has identical name and type
2921         name.
2922
2923 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2924
2925         Fix #71651, #71675
2926         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2927         CreatePermission.
2928         Create custom PermissionSet only for PermissionSetAttribute.
2929
2930 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2931
2932         Fix #71649
2933         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2934         delegates in static class.
2935
2936 2005-01-24  Martin Baulig  <martin@ximian.com>
2937
2938         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2939         merging an implicit block, just use its reachability.
2940
2941         * statement.cs (Block.Resolve): Make the unreachable code check
2942         work wrt. implicit blocks; see test-337 from #63842.
2943
2944 2005-01-21  Alp Toker  <alp@atoker.com>
2945  
2946         * cs-parser.jay: destructor_declaration's container is PartialContainer
2947         not Class when partial types are used, so use Kind prop instead of
2948         'is'.
2949         
2950 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2951
2952         * cs-parser.jay: Improve error reporting when an interface
2953         declares new types.
2954
2955 2005-01-20  Dick Porter  <dick@ximian.com>
2956
2957         * support.cs: SeekableStreamReader fix from Sandor Dobos
2958         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2959         chars are read.  Fixes bug 70369.
2960
2961 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2962
2963         * cs-parser.jay (catch_clause): Simplify current_block handling
2964         somewhat.
2965
2966 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2967
2968         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2969         code with ImplicitStandardConversion to handle the implicit
2970         conversion of method groups into valid delegate invocations. 
2971
2972         The problem is that in parameter handling we were using this code
2973         path.  Fixes bug #64698
2974
2975 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2976
2977         * cs-parser.jay: Fix several infelicities.
2978         - Avoid assigning to the parser value stack.  Code like 
2979           '$3 = null' is unclean.  Synthesize a value for the code block
2980           instead. 
2981         - Avoid using oob_stack for storing location information.  Use ...
2982         (_mark_): ... this.  New (empty) rule.  Saves the current location
2983         in $$.
2984         (foreach_statement): Avoid using oob_stack for current_block
2985         handling.  Use technique used in for_statement and
2986         using_statement.  Synthesize a value for the code block to store
2987         additional intermediate information.
2988
2989 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2990
2991         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2992         of a different type is only allowed to private fields of a
2993         containing type, not on fields of a base class.
2994
2995         See test-174.cs and error cs0122-9.cs
2996
2997 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2998
2999         Fix test-335.cs (bug #58126).
3000         * cs-parser.jay (argument): Split out non-expression parts of the
3001         rule into 'non_simple_argument'.
3002         (invocation_expression): Support parenthesized invocations with
3003         multiple arguments, and with single non-simple arguments.
3004
3005 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3006
3007         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3008         places.
3009
3010 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3011
3012         Fix cs0038-1.cs, cs1640-6.cs.
3013         * ecore.cs (Expression.Resolve): Remove special-case for
3014         SimpleName in error-handling.
3015         (Expression.almostMatchedMembers): Relax access permission to
3016         protected.
3017         (Expression.MemberLookupFailed): Handle duplicates in
3018         almostMatchedMembers list.
3019         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3020         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3021         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3022         overload if the passed in MemberInfo is a MethodBase.
3023
3024 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3025
3026         Fix #70749
3027         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3028         for non-CAS & merge permission sets properly.
3029
3030 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3031
3032         Improve standard-compliance of simple name and member access 
3033         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3034         * ecore.cs (FullNamedExpression): New abstract base class 
3035         for Namespaces and TypeExpressions.
3036         (ResolveFlags.SimpleName): Remove.
3037         (SimpleName): Remove support for dotted names.
3038         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3039         DeclSpace.FindType and DeclSpace.LookupType.
3040         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3041         (Expression.ExprClassName): Make member function.
3042         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3043         a namespace.  Remove creation of dotted "SimpleName"s.
3044         (MemberAccess.DoResolve): Likewise.
3045         * decl.cs (DeclSpace.Cache): Make private.
3046         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3047         (DeclSpace.FindType): Update.
3048         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3049         FullNamedExpression.
3050         * namespace.cs (Namespace): Derive from FullNamedExpression
3051         so that it can be part of expression resolution.
3052         (Namespace.Lookup): Return an FullNamedExpression.
3053         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3054         namespace.
3055         * rootcontext.cs (NamespaceLookup): Remove.
3056         (LookupType): Move to DeclSpace.
3057         * attribute.cs (CheckAttributeType): Update.
3058         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3059         (FindDocumentedTypeNonArray): Likewise.
3060
3061 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3062
3063         Fix cs0509.cs, cs1632.cs.
3064         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3065         is the same as IsInterface.
3066         (TypeContainer.GetClassBases): Likewise.
3067         * statement.cs (LabeledStatement.ig): New field.
3068         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3069         label.
3070         (LabeledStatement.DoEmit): Check that the label was created with
3071         the same ILGenerator.
3072
3073 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3074
3075         Fix #71058
3076         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3077         accessors to its properties.
3078
3079         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3080         from accessors to property.
3081         
3082 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3083
3084         Fix #70722
3085         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3086         only for overrides.
3087         
3088 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3089
3090         * attribute.cs: Check for null and empty strings.  
3091
3092         I have lost another battle to Paolo.
3093
3094 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3095
3096         Fix #70942
3097         * class.cs (PropertyMethod): Set Parent field in ctors.
3098         (SetMethod.InternalParameters): Add unsafe switch hack.
3099         Override MarkForDuplicationCheck where it is appropriate.
3100
3101         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3102         It says whether container allows members with the same name.
3103         Base default is no.
3104         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3105         Removed is_method parameter.
3106
3107 2005-01-06  Duncan Mak  <duncan@ximian.com>
3108
3109         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3110         because the previous change led to incorrect reporting of CS1032
3111         ("Cannot define/undefine preprocessor symbols after first token in
3112         file"). Instead of using `tokens_seen' as the only flag that
3113         triggers CS1040, introduce `comments_seen'. This new flag is used
3114         to signify having seen comments on the current line, so it is
3115         unset after a newline.
3116
3117 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3118
3119         * doc.cs : When searching for a type, find nested type too.
3120           This fixes bug #71040.
3121
3122 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3123
3124         * doc.cs :
3125           - Warn missing member comment on those classes which also does not
3126             have doc comments. Fixed bug #71041.
3127           - Don't warn missing doc comment on default constructor.
3128             Fixed bug #71042.
3129
3130 2005-01-06  Duncan Mak  <duncan@ximian.com>
3131
3132         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3133         comments, set `tokens_seen' to true. This allows us to detect
3134         misplaced preprocessor directives (i.e. not at the beginning of
3135         the a line, nor after whitespaces). In that case, report error
3136         CS1040. This fixes bug #56460.
3137
3138         * cs-parser.jay (interface_member_declaration): Add checks for
3139         IsExplicitImpl, and report CS0541 error if an interface member is
3140         defined as an explicit interface declaration.
3141
3142 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3143
3144         Fix #70817
3145         * class.cs (PropertyMethod): Set Parent field in ctors.
3146         (SetMethod.InternalParameters): Add unsafe switch hack.
3147         
3148         * decl.cs (MemberCore.Parent): Cannot be readonly.
3149
3150 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3151
3152         * decl.cs (DeclSpace.ResolveType): Remove.
3153         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3154         Merge in code from ...
3155         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3156         * class.cs, enum.cs: Update to changes.
3157
3158 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3159
3160         * anonymous.cs: Ensure that we init the scope of our parent if it
3161         has not been initialized yet.
3162
3163 2004-12-30  Duncan Mak  <duncan@ximian.com>
3164
3165         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3166         if field.FieldBuilder is null. Fixes #70758.
3167
3168         * convert.cs: Fixed some typos and updated some of the comments.
3169         (ImplicitStandardConversionExists):
3170         (TryImplicitIntConversion): If `target_type' is an interface and
3171         the type of `ic' implements this interface, return true or a new
3172         BoxedCast instead of null. This fixes #70468.
3173
3174 2004-12-29  Duncan Mak  <duncan@ximian.com>
3175
3176         * expression.cs (Argument.Emit): Check that Expr is
3177         IMemoryLocation before casting to it, and report CS1510 otherwise.
3178
3179         This fixes #70402.
3180
3181 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3182
3183         * statement.cs (Block.ThisVariable): remove the recursion here, to
3184         make the --profile more sane.
3185
3186 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3187
3188         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3189         assembly, by JB Evain.
3190
3191 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3192
3193         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3194           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3195         "parent" refers to enclosing type/class.  "base" refers to superclass.
3196
3197 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3198
3199         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3200         Ensure that we only have GlobalAttributes.
3201         * attribute.cs (Attribute.Emit): Make non-virtual.
3202         (GlobalAttribute.Emit): Remove.
3203         (Attribute.Resolve): Make virtual.
3204         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3205         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3206         the argument. Don't create one.
3207         (Attribute.GetObsoleteAttribute): Likewise.
3208         (Attribute.GetClsCompliantAttributeValue): Likewise.
3209         * class.cs, decl.cs: Update to changes.
3210
3211 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3212
3213         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3214         
3215         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3216         
3217         * statement.cs (Foreach.Resolve): Add error 186 report.
3218
3219 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3220
3221         * expression.cs (Conditional.DoResolve): Add warning 429.
3222         
3223         * statement.cs (If.Resolve): Add warning 665.
3224
3225 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3226
3227         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3228         except when in the parser, and in GlobalAttribute.
3229         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3230         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3231         RootContext.Tree.Types.NamespaceEntry once work is done.
3232         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3233         and resets RootContext.Tree.Types.NamespaceEntry.
3234
3235 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3236
3237         * cs-parser.jay: Don't create a block for every variable.
3238
3239 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3240
3241         * location.cs: Provide extra information.
3242
3243         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3244         variables from the captured environment, it is the ldarg_0.
3245
3246 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3247
3248         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3249         find a conclusion.
3250         
3251         * class.cs: Changed warning level for 169 to avoid developer
3252         displeasure from warning flooding. It will be changed back when they
3253         fix most of current BCL warnings.
3254         
3255         * RootContext.cs: Pushed default WarningLevel to 3.
3256         
3257         * statement.cs: Removed unused variable.
3258
3259 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3260
3261         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3262         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3263         Add error 502 report.
3264         (StaticClass.DefineType): Add error 441 report.
3265         (Class.AllowedModifiersProp): New virtual property as temporary
3266         extension to AllowedModifiers.
3267         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3268         to share implementation with StaticClass and don't call virtual
3269         methods from ctor.
3270         
3271         * driver.cs (MainDriver): Add error 1558 test.
3272
3273         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3274         report. Moved error 36 test here.
3275
3276         * statement.cs (Throw.Resolve): Add error 724 report.
3277
3278         * typemanager.cs: Add out_attribute_type core type.
3279         
3280 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3281
3282         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3283         3018 report.
3284         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3285
3286         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3287         3017 report.
3288         
3289         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3290
3291         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3292         Add error 3023 report.
3293         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3294
3295         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3296         implementation.
3297
3298 2004-12-12  John Luke  <john.luke@gmail.com>
3299
3300         * driver.cs (AddArgs): take -- into account when
3301         adding arguments, fixes bug 65710 
3302
3303 2004-12-12  Martin Baulig  <martin@ximian.com>
3304
3305         * expression.cs (Unary.TryReduceNegative): Added support for
3306         SByteConstant and ByteConstant.
3307         (Unary.Reduce): Check error values from TryReduceNegative().
3308
3309 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3310
3311         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3312         and report exception as error 182.
3313
3314 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3315
3316         * driver.cs (Main): Fix message when there are warnings.
3317
3318 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3319
3320         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3321
3322 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3323
3324         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3325         Reduced number of warnings.
3326         
3327         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3328
3329 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3330
3331         * driver.cs: Removed message.
3332
3333         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3334
3335 2004-12-08    <vargaz@freemail.hu>
3336
3337         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3338
3339 2004-12-08  Martin Baulig  <martin@ximian.com>
3340
3341         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3342         instead of a CS3002 for properties and indexer.
3343
3344 2004-12-08  Martin Baulig  <martin@ximian.com>
3345
3346         * decl.cs (MemberName.ToString): Make this work again.
3347
3348 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3349
3350         * attribute.cs (Resolve): Add error 591 detection.
3351
3352         * class.cs (FieldMember.Define): Add error 1547 detection.
3353         (Indexer.Define): Add error 620 detection.
3354         (Operator.Define): Add error 590 detection.
3355
3356         * ecore.cs: Missing argument for error 79.
3357
3358         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3359         detection.
3360
3361 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3362
3363         Fix #70106
3364         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3365         only.
3366
3367 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3368
3369         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3370           Some operator comments were suppressed.
3371         * doc.cs : Implicit/explicit operator name in doc comments are like
3372           "op_Explicit(type)~returnType", so added suffix handling.
3373
3374 2004-12-07  Martin Baulig  <martin@ximian.com>
3375
3376         * decl.cs
3377         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3378         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3379         (DeclSpace.ec): New protected field; store the EmitContext here.
3380         (DeclSpace.EmitContext): New public property; moved here from
3381         `TypeContainer'.
3382         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3383         EmitContext.
3384
3385         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3386         (Enum.Emit): Don't create a new EmitContext.
3387
3388         * delegate.cs (Delegate.DefineType): Always create the
3389         EmitContext.
3390
3391         * iterators.cs (Iterators.DefineIterator): Create a new
3392         EmitContext and store it in `ec'.
3393
3394 2004-08-24  Martin Baulig  <martin@ximian.com>
3395
3396         * typemanager.cs
3397         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3398         this for accessibility checks.
3399         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3400         IsNestedFamilyAccessible.
3401         (TypeManager.IsSubclassOf): New method, do what the name actually
3402         says.   
3403
3404 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3405
3406         Fix crash on cs0657-17.cs.
3407         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3408         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3409         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3410         the case where the NamespaceEntry gets overwritten.
3411
3412 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3413
3414         Fixed #69195, #56821
3415         * ecore.cs (ResolveBoolean): Tiny refactoring.
3416
3417         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3418         of right expression resolving when left is false constant and
3419         operator is LogicalAnd OR true constant and operator is LogicalOr.
3420
3421         * statement.cs (ResolveUnreachable): Always reports warning.
3422
3423 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3424
3425         * class.cs: Distinguish between 1721 and 1722 (just a little help
3426         for the programmer).
3427
3428 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3429
3430         * delegate.cs: Only allow this on new versions of the language. 
3431
3432 2004-12-02  Duncan Mak  <duncan@ximian.com>
3433
3434         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3435         Expression class.
3436         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3437         here as a static method. Take an additional bool out parameter
3438         `must_do_cs1540_check' for signaling to InstanceResolve.
3439         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3440         member field from PropertyExpr class and made it an argument of
3441         the method instead.
3442         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3443         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3444         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3445         and `remove_accessor' as well as InstanceResolve: report CS0122
3446         where applicable.
3447
3448         Fixes #70129.
3449
3450 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3451
3452         Fix test-327.cs, test-328.cs, and put in early infrastructure
3453         for eventually fixing #52697.
3454         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3455         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3456         from other methods.
3457         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3458         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3459         (VerifyUsing, error246): Update.
3460         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3461         'NamespaceEntry.LookupNamespaceOrType'.
3462
3463 2004-12-03  Martin Baulig  <martin@ximian.com>
3464
3465         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3466         method as our child, call AnonymousMethod.Compatible() on it.
3467
3468 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3469
3470         Disable XML documentation support in 'basic' profile.
3471         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3472         Redirect XmlElement to System.Object.
3473         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3474         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3475         * mcs.exe.sources: Add doc-bootstrap.cs.
3476         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3477         of doc.cs.
3478
3479 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3480
3481         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3482           comments are allowed.
3483
3484 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3485
3486         * delegate.cs: Add checks for subtypes in paramaters and return values
3487         in VerifyMethod () to add support for Covariance/Contravariance
3488         in delegates.
3489         
3490 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3491
3492         * report.cs: Remove extra closing parenthesis.
3493
3494         * convert.cs (Error_CannotImplicitConversion): If the name of the
3495         types are the same, provide some extra information.
3496
3497         * class.cs (FieldBase): Use an unused bit field from the field to
3498         encode the `has_offset' property from the FieldMember.  This saves
3499         a couple of Ks on bootstrap compilation.
3500
3501         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3502         method as our child, return the AnonymousMethod resolved
3503         expression.
3504
3505         * expression.cs (New.DoResolve): Allow return values from
3506         NewDelegate to also include AnonymousMethods.
3507
3508         Fixes #70150.
3509
3510 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3511
3512         Fix bug #70102
3513         * attribute.cs (Resolve): Improved implementation of params
3514         attribute arguments.
3515
3516         * support.cs (ParameterData): Add HasParams to be faster.
3517
3518 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3519
3520         all things are for /doc support:
3521
3522         * doc.cs: new file that supports XML documentation generation.
3523         * mcs.exe.sources: added doc.cs.
3524         * driver.cs:
3525           Handle /doc command line option.
3526           Report error 2006 instead of 5 for missing file name for /doc.
3527           Generate XML documentation when required, after type resolution.
3528         * cs-tokenizer.cs:
3529           Added support for picking up documentation (/// and /** ... */),
3530           including a new XmlCommentState enumeration.
3531         * cs-parser.jay:
3532           Added lines to fill Documentation element for field, constant,
3533           property, indexer, method, constructor, destructor, operator, event
3534           and class, struct, interface, delegate, enum.
3535           Added lines to warn incorrect comment.
3536         * rootcontext.cs :
3537           Added Documentation field (passed only when /doc was specified).
3538         * decl.cs:
3539           Added DocComment, DocCommentHeader, GenerateDocComment() and
3540           OnGenerateDocComment() and some supporting private members for
3541           /doc feature to MemberCore.
3542         * class.cs:
3543           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3544         * delegate.cs:
3545           Added overriden DocCommentHeader.
3546         * enum.cs:
3547           Added overriden DocCommentHeader and GenerateDocComment().
3548
3549 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3550
3551         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3552         unwrapping the enumeration values, chain to
3553         DoConstantNumericPromotions again, so we can promote things to the
3554         fundamental types (takes care of enums that are bytes, sbytes).
3555
3556         Fixes bug #62054.
3557
3558 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3559
3560         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3561         Fix long-standing bug in type-lookup.  Use FindType instead of
3562         LookupType when ec.ResolvingTypeTree.
3563         (Attribute.ResolveType, Attribute.Resolve)
3564         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3565         Update to changes.
3566         (Attributes.Search): Remove internal version.  Update.
3567         (Attributes.SearchMulti): Update.
3568         (Attributes.GetClsCompliantAttribute): Remove.
3569         (Attributes.GetIndexerNameAttribute): Remove.
3570         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3571         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3572         * class.cs (Indexer.Define): Likewise.
3573
3574 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3575
3576         Fix bug #68790
3577         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3578         MarshallByReference members access.
3579
3580         * expression.cs: Use CheckMarshallByRefAccess;
3581         Better error CS0197 message.
3582
3583         * report.cs: Print whole related error message.
3584
3585 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3586
3587         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3588         the current directory to help debugging.
3589
3590 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3591
3592         * class (GetClassBases): Better error 60 report.
3593         (EventProperty): Disabled warning 67 detection.
3594
3595 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3596
3597         Fix bug #60324
3598         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3599
3600         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3601         precise values.
3602
3603 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3604
3605         Fix bug #49488
3606         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3607
3608         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3609
3610 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3611
3612         * attribute.cs (Attribute.Resolve): Refine error reporting and
3613         report a cs0117 if the identifier does not exist, to distinguish
3614         from 0617 which is a miss-use of the actual identifier.
3615
3616         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3617         between cs0070 and cs0079.
3618
3619         * class.cs (MemberBase.DoDefine): When reporting a wrong
3620         accessibility level, we use MethodCore to compare instead of
3621         Method (this was a regression in some refactoring effort).
3622
3623         So now we correctly report cs0056 again.
3624
3625         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3626         testing the target_type (which was known to be object_type) and
3627         not the source type (which is anonymous_method).
3628
3629         Fixed reporting of error cs1660.
3630
3631         * expression.cs (UserCast.Source): Expose the underlying cast.
3632
3633         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3634         allowed types to find a match to int32 first (most common).
3635
3636         In addition, it ignores any ImplicitUserConversions that did an
3637         internal implicit conversion (as the switch statement allows only
3638         one integral conversion to exist).
3639
3640         * class.cs (PartialContainer.Create): rename `name' to
3641         `member_name' for clarity.  Then replace the string calls with a
3642         call to MemberName.GetPartialName, as now using
3643         MemberName.ToString is an error (this is due to the side effects
3644         it had, that were fixed in the past).
3645
3646         This will restore the error reporting on a number of partial class
3647         errors that were missusing this (and getting an exception as a
3648         results, which is now just a plain textual warning, because
3649         yyparse debug output would crash otherwise).
3650
3651 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3652
3653         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3654
3655 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3656
3657         * rootcontext.cs (LookupType): Make sure to cache lookups that
3658         don't give us a negative result. This saves about 5% of corlib
3659         compilation time.
3660
3661 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3662
3663         * report.cs (AbstractMessage.Print): messages are sent to stderr
3664
3665         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3666         non-interface in the list of interfaces (at this point, either
3667         parent was properly set, or a base class is being listed in the
3668         interfaces section).
3669
3670         This flags error 1722, and resolves the crash from bug 69259.
3671
3672 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3673
3674         * statement.cs (Using.EmitExpressionFinally): make this work right
3675         for valuetypes. Fixes 69926.
3676
3677 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3678
3679         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3680         converted to an enum" here, before we try to change the underlying
3681         type.  This code exists, but it is a different code path than the
3682         one used while encoding constants.
3683
3684         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3685         old bug: when converting from the null literal to a pointer,
3686         return an EmptyCast, not the NullLiteral.
3687
3688         This fixes #69921, the recent null_type changes probably made this
3689         bug more prominent.
3690
3691         (ImplicitReferenceConversionExists): In addition, resynchronized
3692         the code here, so it matches the same code in
3693         ImplicitReferenceConversionExists for the `from any class-type S
3694         to any interface-type T'.
3695         
3696
3697 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3698
3699         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3700
3701 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3702
3703         * cs-parser.jay: Use verbosity accordingly. 
3704
3705 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3706
3707         * expression.cs (Unary.ResolveOperator): Do not report warning;
3708         AddressOf reads from variable.
3709         
3710         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3711
3712 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3713
3714         Fix bug #69462
3715
3716         * attribute.cs (Attributable): Removed CheckTargets.
3717         (Attributes.Emit): Explicit attribute targets are tested here.
3718
3719         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3720         not enabled for interfaces.
3721
3722         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3723         (GetAssemblyName): Ouch next bug there.
3724
3725 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3726
3727         * expression.cs: Error 275 added.
3728         
3729 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3730
3731         Fix bug #69177 (Implemented decimal constant support)
3732
3733         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3734         (BinaryFold): Add DecimalConstant.
3735
3736         * const.cs (Define): Decimal constant 
3737         (is not constant.
3738         (ChangeType): Add decimal type handling.
3739         (LookupConstantValue): Don't set value for decimal type but
3740         emit DecimalConstantAttribute. Needed for constant optimization.
3741
3742         * constant.cs (ToDecimal): New method.
3743         (ConvertToDecimal): New method.
3744         (IntConstant): Implemented ConvertToDecimal.
3745         (DecimalConstant.Emit): Emit optimized version for decimals in
3746         int range.
3747
3748         * expression.cs (ResolveOperator): Changed order of constant
3749         reduction to work correctly with native types which have
3750         overloaded operators.
3751         (ResolveMemberAccess): Extract constant value from attribute
3752         for decimal type.
3753
3754         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3755
3756         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3757         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3758         (ChangeType): Decimal is special.
3759         (TypeToCoreType): Add decimal type.
3760
3761 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3762
3763         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3764         decimal types.
3765
3766 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3767
3768         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3769         test cs1667-5.cs.
3770
3771 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3772
3773         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3774
3775         * pending.cs (PendingImplementation): Grab only interfaces.
3776
3777 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3778
3779         * statement.cs (ForeachHelperMethods): Add location member and
3780         error 202 detection.
3781
3782 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3783
3784         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3785         automatically handled by executable.make.
3786         (PROGRAM): Make profile-specific.
3787
3788 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3789
3790         * expression.cs (DoResolveBase): Fixed wrong warning for out
3791         variables.
3792
3793 2004-11-18  Martin Baulig  <martin@ximian.com>
3794
3795         Merged latest changes into gmcs.  Please keep this comment in
3796         here, it makes it easier for me to see what changed in MCS since
3797         the last time I merged.
3798
3799 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3800
3801         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3802         (TypeHandle.GetMemberCache): New.
3803         (TypeHandle.TypeHandle): Update.
3804         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3805         (TypeManager.LookupParentInterfacesCache):
3806         Rename from LookupInterfaceCache.  Optimize slightly.
3807         (TypeManager.MemberLookup_FindMembers): Update.
3808         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3809         multi-type variant.
3810         (AddCacheContents): Rename from AddHashtable.
3811         * class.cs (TypeContainer.parent_container): Remove.
3812         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3813         (TypeContainer.DoDefineMembers): Don't initialize it.
3814         Update to name changes.
3815         
3816 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3817
3818         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3819         that factors the code to check access modifiers on override.  
3820
3821         (PropertyBase): Use the code here.
3822
3823         Patch from Lluis S'anchez, fixes bug #69361.
3824
3825 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3826
3827         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3828         routine that is used to report the use of a captured variable
3829         whose address has been taken.
3830
3831         There are two checks: one when variables are being captured and
3832         the other check is when the address of a variable is taken. 
3833         
3834         (because an anonymous methods might be resolved before *or* after
3835         the address has been taken) and 
3836
3837         * expression.cs (Conditional.DoResolve): Remove the special
3838         casing that Martin added to trueExpr and falseExpr being both
3839         NullLiteral.  We get the right behavior now just by introducing
3840         the null_type into the compiler. 
3841
3842         * convert.cs (ExplicitConversion): Change the code to use
3843         null_type instead of testing `expr is NullLiteral'.
3844         (ImplicitConversionStandard): use null_type too.
3845         (ImplicitReferenceConversionExists): use null_type too.
3846         (ImplicitReferenceConversion): use null_type too.
3847
3848         * literal.cs: The type of `NullLiteral' is now null_type instead
3849         of object_type. 
3850         (Resolve): Set the type here.
3851
3852         * typemanager.cs: Introduce null_type.
3853
3854 2004-11-17  Martin Baulig  <martin@ximian.com>
3855
3856         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3857         direction, like FindMembers() does.  Fixes #69546, testcase is in
3858         test-315.cs.    
3859
3860 2004-11-16  Martin Baulig  <martin@ximian.com>
3861
3862         This is based on a patch from Marek Safar, see bug #69082.
3863         Fixes bugs #63705 and #67130.
3864
3865         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3866         method; create a MemberCache for an interface type and cache the
3867         result.
3868
3869         * decl.cs (IMemberContainer.ParentContainer): Removed.
3870         (IMemberContainer.ParentCache): New property.
3871         (MemberCache.SetupCacheForInterface): Removed.
3872         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3873         to create a cache for an interface's "parent".
3874
3875         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3876         interfaces too.
3877
3878 2004-11-16  Martin Baulig  <martin@ximian.com>
3879
3880         Merged back from gmcs; these changes already went into gmcs a
3881         couple of weeks ago.
3882
3883         * typemanager.cs
3884         (TypeManager.AddUserType): Removed the `ifaces' argument.
3885         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3886         `TypeExpr []'.
3887         (TypeManager.AddUserInterface): Removed.
3888         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3889         `TypeExpr []'.
3890         (TypeManager.GetInterfaces): Likewise.
3891         (TypeManager.GetExplicitInterfaces): Likewise.
3892
3893         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3894
3895         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3896         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3897
3898 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3899
3900         * statement.cs: Avoid adding bools to a hashtable.
3901
3902 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3903
3904         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3905         calling an unsafe method from a safe location.
3906
3907 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3908
3909         Fix #69167
3910         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3911
3912 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3913
3914         * namespace.cs (VerifyUsing): use GetPartialName instead of
3915         ToString. 
3916
3917 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3918
3919         * statement.cs (Return.Resolve): Fix regression in typo: if
3920         `in_exc', we have to request a NeedReturnLabel, this was a typo
3921         introduced in the anonymous method check-in.  Fixes #69131.
3922
3923         * Indexers were using the ShortName when defining themselves,
3924         causing a regression in the compiler bootstrap when applying the
3925         patch from 2004-11-02 (first part), now they use their full name
3926         and the bug is gone.
3927
3928 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3929
3930         * driver.cs: Strip the path from the names of embedded resources. Fixes
3931         #68519.
3932
3933 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3934
3935         Fix error message regression: cs0104-2.cs.
3936         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3937         (AliasEntry.Resolve): Update.
3938         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3939         'silent' flag.
3940         (RootContext.LookupType): Update.
3941
3942 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3943
3944         * cs-parser.jay: Add support for handling accessor modifiers
3945         * class: Add support port accessor modifiers and error checking,
3946         define PropertyMethod.Define as virtual (not abstract anymore)
3947         * ecore.cs: Add checking for proeprties access with access modifiers
3948         * iterators.cs: Modify Accessor constructor call based in the modified
3949         constructor
3950 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3951
3952         * expression.cs (StringConcat): Handle being called twice,
3953         as when we have a concat in a field init with more than two
3954         ctors in the class
3955
3956 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3957
3958         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3959         special case explicit implementations, we should always produce
3960         the .property or .event declaration.
3961         
3962         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3963         since it will not return correct data if people use this
3964         unresolved in the presence of using statements (see test-313).
3965
3966         * class.cs (MethodData.Define): If we are an explicit interface
3967         implementation, set the method name to the full name of the
3968         interface plus the name of the method.  
3969
3970         Notice that using the method.MethodName.GetFullName() does not
3971         work, as it will only contain the name as declared on the source
3972         file (it can be a shorthand in the presence of using statements)
3973         and not the fully qualifed type name, for example:
3974
3975         using System;
3976
3977         class D : ICloneable {
3978                 object ICloneable.Clone ()  {
3979                 }
3980         }
3981
3982         Would produce a method called `ICloneable.Clone' instead of
3983         `System.ICloneable.Clone'.
3984
3985         * namespace.cs (Alias.Resolve): Use GetPartialName.
3986         
3987 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3988
3989         * cs-parser.jay: Add error 1055 report.
3990
3991 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3992
3993         * assign.cs (Assign.DoResolve): Only do the transform of
3994         assignment into a New if the types are compatible, if not, fall
3995         through and let the implicit code deal with the errors and with
3996         the necessary conversions. 
3997
3998 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3999
4000         * cs-parser.jay: Add error 1031 report.
4001
4002         * cs-tokenizer.cs: Add location for error 1038.
4003
4004 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4005
4006         * cs-parser.jay: Add error 1016 report.
4007
4008 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4009
4010         * cs-parser.jay: Add errors 1575,1611 report.
4011
4012 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4013
4014         * cs-parser.jay: Add error 1001 report.
4015
4016 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4017
4018         Fix #68850
4019         * attribute.cs (GetMarshal): Add method argument for
4020         caller identification.
4021
4022         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4023         agument for GetMarshal and RuntimeMissingSupport.
4024
4025 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4026
4027         * attribute.cs (ExtractSecurityPermissionSet): Removed
4028         TypeManager.code_access_permission_type.
4029
4030         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4031
4032 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4033
4034         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4035         for obsolete use of a variable here.   Fixes regression on errors
4036         cs0619-25 and cs0619-26.
4037
4038 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4039
4040         Fix #62358, implemented security attribute encoding.
4041
4042         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4043         Tests permitted SecurityAction for assembly or other types.
4044         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4045         data from SecurityPermissionAttribute to PermisionSet class.
4046
4047         * class.cs (ApplyAttributeBuilder): Added special handling
4048         for System.Security.Permissions.SecurityAttribute based types.
4049
4050         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4051         special handling for System.Security.Permissions.SecurityAttribute
4052         based types.
4053
4054         * enum.cs (ApplyAttributeBuilder): Added special handling
4055         for System.Security.Permissions.SecurityAttribute based types.
4056
4057         * parameter.cs (ApplyAttributeBuilder): Added special handling
4058         for System.Security.Permissions.SecurityAttribute based types.
4059
4060         * rootcontext.cs: Next 2 core types.
4061
4062         * typemanager.cs (TypeManager.security_permission_attr_type):
4063         Built in type for the SecurityPermission Attribute.
4064         (code_access_permission_type): Build in type.
4065
4066 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4067
4068         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4069         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4070         all of this information into
4071         EmitContext.EmitCapturedVariableInstance.
4072         
4073         * codegen.cs (EmitCapturedVariableInstance): move here the
4074         funcionality of emitting an ldarg.0 in the presence of a
4075         remapping.   This centralizes the instance emit code.
4076
4077         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4078         then emit a load of this: it means that we have reached the
4079         topmost ScopeInfo: the one that contains the pointer to the
4080         instance of the class hosting the anonymous method.
4081
4082         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4083         captures to the topmost CaptureContext.
4084
4085 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4086
4087         * expression.cs (LocalVariableReference): Move the knowledge about
4088         the iterators into codegen's EmitCapturedVariableInstance.
4089
4090 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4091
4092         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4093         all code paths return a value from an anonymous method (it is the
4094         same as the 161 error, but for anonymous methods).
4095
4096 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4097
4098         The introduction of anonymous methods in the compiler changed
4099         various ways of doing things in the compiler.  The most
4100         significant one is the hard split between the resolution phase
4101         and the emission phases of the compiler.
4102
4103         For instance, routines that referenced local variables no
4104         longer can safely create temporary variables during the
4105         resolution phase: they must do so from the emission phase,
4106         since the variable might have been "captured", hence access to
4107         it can not be done with the local-variable operations from the runtime.
4108         
4109         * statement.cs 
4110
4111         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4112         is a toplevel block.
4113
4114         (ToplevelBlock): A new kind of Block, these are the blocks that
4115         are created by the parser for all toplevel method bodies.  These
4116         include methods, accessors and anonymous methods.
4117
4118         These contain some extra information not found in regular blocks:
4119         A pointer to an optional CaptureContext (for tracking captured
4120         local variables and parameters).  A pointer to the parent
4121         ToplevelBlock.
4122         
4123         (Return.Resolve): Catch missmatches when returning a value from an
4124         anonymous method (error 1662).
4125         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4126         phase.
4127
4128         (Break.Resolve): ditto.
4129
4130         (SwitchLabel): instead of defining the labels during the
4131         resolution phase, we now turned the public ILLabel and ILLabelCode
4132         labels into methods called GetILLabelCode() and GetILLabel() that
4133         only define the label during the Emit phase.
4134
4135         (GotoCase): Track the SwitchLabel instead of the computed label
4136         (its contained therein).  Emit the code by using
4137         SwitchLabel.GetILLabelCode ().
4138
4139         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4140         whether the Local has been captured or not.
4141
4142         (LocalInfo.IsCaptured): New property, used to tell whether the
4143         local has been captured.
4144         
4145         * anonymous.cs: Vastly updated to contain the anonymous method
4146         support.
4147
4148         The main classes here are: CaptureContext which tracks any
4149         captured information for a toplevel block and ScopeInfo used to
4150         track the activation frames for various local variables.   
4151
4152         Each toplevel block has an optional capture context associated
4153         with it.  When a method contains an anonymous method both the
4154         toplevel method and the anonymous method will create a capture
4155         context.   When variables or parameters are captured, they are
4156         recorded on the CaptureContext that owns them, for example:
4157
4158         void Demo () {
4159              int a;
4160              MyDelegate d = delegate {
4161                  a = 1;
4162              }
4163         }
4164
4165         Here `a' will be recorded as captured on the toplevel
4166         CapturedContext, the inner captured context will not have anything
4167         (it will only have data if local variables or parameters from it
4168         are captured in a nested anonymous method.
4169
4170         The ScopeInfo is used to track the activation frames for local
4171         variables, for example:
4172
4173         for (int i = 0; i < 10; i++)
4174                 for (int j = 0; j < 10; j++){
4175                    MyDelegate d = delegate {
4176                         call (i, j);
4177                    }
4178                 }
4179
4180         At runtime this captures a single captured variable `i', but it
4181         captures 10 different versions of the variable `j'.  The variable
4182         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4183         recorded on a child.  
4184
4185         The toplevel ScopeInfo will also track information like the `this'
4186         pointer if instance variables were referenced (this is necessary
4187         as the anonymous method lives inside a nested class in the host
4188         type of the method). 
4189
4190         (AnonymousMethod): Expanded to track the Toplevel, implement
4191         `AnonymousMethod.Compatible' to tell whether an anonymous method
4192         can be converted to a target delegate type. 
4193
4194         The routine now also produces the anonymous method content
4195
4196         (AnonymousDelegate): A helper class that derives from
4197         DelegateCreation, this is used to generate the code necessary to
4198         produce the delegate for the anonymous method that was created. 
4199
4200         * assign.cs: API adjustments for new changes in
4201         Convert.ImplicitStandardConversionExists.
4202
4203         * class.cs: Adjustments to cope with the fact that now toplevel
4204         blocks are of type `ToplevelBlock'. 
4205
4206         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4207         insteda of standard blocks.
4208
4209         Flag errors if params arguments are passed to anonymous methods.
4210
4211         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4212         `CurrentAnonymousMethod' which points to the current Anonymous
4213         Method.  The variable points to the AnonymousMethod class that
4214         holds the code being compiled.  It is set in the new EmitContext
4215         created for the anonymous method.
4216
4217         (EmitContext.Phase): Introduce a variable and an enumeration to
4218         assist in enforcing some rules about when and where we are allowed
4219         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4220         only one that enfonces this right now).
4221
4222         (EmitContext.HaveCaptureInfo): new helper method that returns
4223         whether we have a CapturedContext initialized.
4224
4225         (EmitContext.CaptureVariable): New method used to register that a
4226         LocalInfo must be flagged for capturing. 
4227
4228         (EmitContext.CapturedParameter): New method used to register that a
4229         parameters must be flagged for capturing. 
4230         
4231         (EmitContext.CapturedField): New method used to register that a
4232         field must be flagged for capturing. 
4233
4234         (EmitContext.HaveCapturedVariables,
4235         EmitContext.HaveCapturedFields): Return whether there are captured
4236         variables or fields. 
4237
4238         (EmitContext.EmitMethodHostInstance): This is used to emit the
4239         instance for the anonymous method.  The instance might be null
4240         (static methods), this (for anonymous methods that capture nothing
4241         and happen to live side-by-side with the current method body) or a
4242         more complicated expression if the method has a CaptureContext.
4243
4244         (EmitContext.EmitTopBlock): Routine that drives the emission of
4245         code: it will first resolve the top block, then emit any metadata
4246         and then emit the code.  The split is done so that we can extract
4247         any anonymous methods and flag any captured variables/parameters.
4248         
4249         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4250         during this phase, the ILGenerator should not be used as labels
4251         and local variables declared here might not be accessible to any
4252         code that is part of an anonymous method.  
4253
4254         Exceptions to this include the temporary variables that are
4255         created by some statements internally for holding temporary
4256         variables. 
4257         
4258         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4259         metadata for a cb
4260
4261         (EmitContext.TemporaryReturn): This method is typically called
4262         from the Emit phase, and its the only place where we allow the
4263         ReturnLabel to be defined other than the EmitMeta.  The reason is
4264         that otherwise we would have to duplicate a lot of logic in the
4265         Resolve phases of various methods that today is on the Emit
4266         phase. 
4267
4268         (EmitContext.NeedReturnLabel): This no longer creates the label,
4269         as the ILGenerator is not valid during the resolve phase.
4270
4271         (EmitContext.EmitThis): Extended the knowledge in this class to
4272         work in anonymous methods in addition to iterators. 
4273
4274         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4275         code is necessary on the stack to access the instance to a local
4276         variable (the variable will be accessed as a field).
4277
4278         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4279         EmitContext.EmitAddressOfParameter): Routines to support
4280         parameters (not completed at this point). 
4281         
4282         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4283         will also remove the parameters.
4284
4285         * convert.cs (Convert): Define a `ConstantEC' which points to a
4286         null.  This is just to prefity some code that uses
4287         ImplicitStandardConversion code and do not have an EmitContext
4288         handy.
4289
4290         The idea is to flag explicitly that at that point in time, it is
4291         known that the conversion will not trigger the delegate checking
4292         code in implicit conversions (which requires a valid
4293         EmitContext). 
4294
4295         Everywhere: pass new EmitContext parameter since
4296         ImplicitStandardConversionExists now requires it to check for
4297         anonymous method conversions. 
4298
4299         (Convert.ImplicitStandardConversionExists): If the type of an
4300         expression is the anonymous_method_type, and the type is a
4301         delegate, we invoke the AnonymousMethod.Compatible method to check
4302         whether an implicit conversion is possible. 
4303
4304         (Convert.ImplicitConversionStandard): Only do implicit method
4305         group conversions if the language level is not ISO_1.
4306
4307         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4308         MethodInfo for the Invoke method.  used by Delegate and
4309         AnonymousDelegate.
4310
4311         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4312         method conversions if the target type is a delegate.
4313
4314         Removed extra debugging nops.
4315
4316         (LocalVariableReference): Turn the `local_info' into a public
4317         field. 
4318
4319         Add `prepared' field, the same hack used for FieldExprs to cope
4320         with composed assignments, as Local variables do not necessarily
4321         operate purely on the stack as they used to: they can be captured
4322         fields. 
4323
4324         Add `temp' for a temporary result, like fields.
4325
4326         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4327
4328         It now copes with Local variables that are captured and emits the
4329         proper instance variable to load it from a field in the captured
4330         case. 
4331
4332         (ParameterReference.DoResolveBase): During the resolve phase,
4333         capture parameters if we are in an anonymous method.
4334
4335         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4336         anonymous method, use the EmitContext helper routines to emit the
4337         parameter reference.
4338
4339         * iterators.cs: Set RemapToProxy to true/false during the
4340         EmitDispose class.
4341
4342         * parameters.cs (GetParameterByName): New helper method. 
4343
4344         * typemanager.cs (anonymous_method_type) a new type that
4345         represents an anonyous method.  This is always an internal type,
4346         used as a fencepost to test against the anonymous-methodness of an
4347         expression. 
4348         
4349 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4350
4351         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4352         561 report.
4353         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4354
4355 2004-10-18  Martin Baulig  <martin@ximian.com>
4356
4357         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4358         `Type' directly, but call ResolveType() on it.
4359         (Catch.Resolve): Likewise.
4360         (Foreach.Resolve): Likewise.
4361
4362 2004-10-18  Martin Baulig  <martin@ximian.com>
4363
4364         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4365         `Type' directly, but call ResolveType() on it.
4366         (Probe.DoResolve): Likewise.
4367         (ArrayCreation.LookupType): Likewise.
4368         (TypeOf.DoResolve): Likewise.
4369         (SizeOf.DoResolve): Likewise.
4370
4371 2004-10-18  Martin Baulig  <martin@ximian.com>
4372
4373         * expression.cs (Invocation.BetterFunction): Put back
4374         TypeManager.TypeToCoreType().
4375
4376 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4377
4378         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4379         the ResolveType.
4380
4381 2004-10-18  Martin Baulig  <martin@ximian.com>
4382
4383         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4384         `Type' directly, but call ResolveType() on it.
4385
4386 2004-10-18  Martin Baulig  <martin@ximian.com>
4387
4388         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4389         `Type' directly, but call ResolveType() on it.
4390         (MemberBase.DoDefine): Likewise.
4391
4392         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4393         `Type' directly, but call ResolveType() on it.
4394         (ComposedCast.DoResolveAsTypeStep): Likewise.
4395
4396         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4397         `Type' directly, but call ResolveType() on it.
4398
4399 2004-10-17  John Luke  <john.luke@gmail.com>
4400
4401         * class.cs (Operator.GetSignatureForError): use CSharpName
4402
4403         * parameter.cs (Parameter.GetSignatureForError): Returns
4404         correct name even if was not defined.
4405
4406 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4407
4408         Fix #65816.
4409         * class.cs (TypeContainer.EmitContext): New property.
4410         (DefineNestedTypes): Create an emitcontext for each part.
4411         (MethodCore.DoDefineParameters): Use container's emitcontext.
4412         Pass type array to InternalParameters.
4413         (MemberBase.DoDefine): Use container's emitcontext.
4414         (FieldMember.Define): Likewise.
4415         (Event.Define): Likewise.
4416         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4417         Pass type array to InternalParameters.
4418         (SetIndexerMethod.GetParameterInfo): Likewise.
4419         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4420         * delegate.cs (Define): Pass emitcontext to
4421         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4422         array to InternalParameters.
4423         * expression.cs (ParameterReference.DoResolveBase): Pass
4424         emitcontext to GetParameterInfo.
4425         (ComposedCast.DoResolveAsTypeStep): Remove check on
4426         ec.ResolvingTypeTree.
4427         * parameter.cs (Parameter.Resolve): Change argument to
4428         EmitContext.  Use ResolveAsTypeTerminal.
4429         (Parameter.GetSignature): Change argument to EmitContext.
4430         (Parameters.ComputeSignature): Likewise.
4431         (Parameters.ComputeParameterTypes): Likewise.
4432         (Parameters.GetParameterInfo): Likewise.
4433         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4434         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4435         * support.cs (InternalParameters..ctor): Remove variant that takes
4436         a DeclSpace.
4437         * typemanager.cs (system_intptr_expr): New.
4438         (InitExpressionTypes): Initialize it.
4439
4440 2004-10-12  Chris Toshok  <toshok@ximian.com>
4441
4442         * cs-parser.jay: fix location for try_statement and catch_clause.
4443
4444 2004-10-11  Martin Baulig  <martin@ximian.com>
4445
4446         * report.cs: Don't make --fatal abort on warnings, we have
4447         -warnaserror for that.
4448
4449 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4450
4451         More DeclSpace.ResolveType avoidance.
4452         * decl.cs (MemberCore.InUnsafe): New property.
4453         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4454         with newly created EmitContext.
4455         (FieldMember.Define): Likewise.
4456         * delegate.cs (Delegate.Define): Likewise.
4457         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4458         only if normal name-lookup fails.
4459         (TypeExpr.DoResolve): Enable error-checking.
4460         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4461         (SizeOf.DoResolve): Likewise.
4462         (ComposedCast.DoResolveAsTypeStep): Likewise.
4463         (StackAlloc.DoResolve): Likewise.
4464         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4465         (Block.Unsafe): New property.
4466         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4467         (Unsafe): Set 'unsafe' flag of contained block.
4468         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4469         (Fixed.Resolve): Likewise.
4470         (Catch.Resolve): Likewise.
4471         (Using.ResolveLocalVariableDecls): Likewise.
4472         (Foreach.Resolve): Likewise.
4473
4474 2004-10-05  John Luke <john.luke@gmail.com>
4475
4476         * cs-parser.jay: add location to error CS0175
4477
4478 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4479
4480         * ecore.cs (Expression.Constantity): Add support for turning null
4481         into a constant.
4482
4483         * const.cs (Const.Define): Allow constants to be reference types
4484         as long as the value is Null.
4485
4486 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4487
4488         * namespace.cs (NamespaceEntry.Using): No matter which warning
4489         level is set, check if this namespace name has already been added.
4490
4491 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4492
4493         * expression.cs: reftype [!=]= null should always use br[true,false].
4494         # 67410
4495
4496 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4497
4498         Fix #67108
4499         * attribute.cs: Enum conversion moved to 
4500         GetAttributeArgumentExpression to be applied to the all
4501         expressions.
4502
4503 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4504
4505         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4506         * class.c (TypeContainer.DefineType): Flag error if
4507         base types aren't accessible due to access permissions.
4508         * decl.cs (DeclSpace.ResolveType): Move logic to
4509         Expression.ResolveAsTypeTerminal.
4510         (DeclSpace.ResolveTypeExpr): Thin layer over
4511         Expression.ResolveAsTypeTerminal.
4512         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4513         Refactor code into NestedAccess.  Use it.
4514         (DeclSpace.NestedAccess): New.
4515         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4516         argument to silence errors.  Check access permissions.
4517         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4518         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4519         (Cast.DoResolve): Likewise.
4520         (New.DoResolve): Likewise.
4521         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4522         (TypeOf.DoResolve): Likewise.
4523
4524         * expression.cs (Invocation.BetterConversion): Return the Type of
4525         the better conversion.  Implement section 14.4.2.3 more faithfully.
4526         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4527         section 14.4.2.2 explicit.
4528         (Invocation.OverloadResolve): Update.
4529         (Invocation): Remove is_base field.
4530         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4531         (Invocation.Emit): Likewise.
4532
4533 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4534
4535         * README: Update to changes.
4536
4537 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4538
4539         * cs-parser.jay: Reverted 642 warning fix.
4540
4541 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4542
4543         Fix bug #66615
4544         * decl.cs (FindMemberWithSameName): Indexer can have more than
4545         1 argument.
4546
4547 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4548
4549         * expression.cs (LocalVariableReference.DoResolveLValue):
4550         Do not report warning 219 for out values.
4551         (EmptyExpression.Null): New member to avoid extra allocations.
4552
4553 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4554
4555         * cs-parser.jay: Fix wrong warning 642 report.
4556
4557         * cs-tokenizer.cs (CheckNextToken): New helper;
4558         Inspect next character if is same as expected.
4559
4560 2004-09-23  Martin Baulig  <martin@ximian.com>
4561
4562         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4563         (Convert.ImplicitReferenceConversionExists): Likewise.
4564
4565 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4566
4567         * class.cs (Operator.Define): Add error 448 and 559 report.
4568
4569 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4570
4571         * class.cs (MemberBase.IsTypePermitted): New protected
4572         method for checking error CS0610.
4573
4574 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4575
4576         * class.cs (TypeContainer.HasExplicitLayout): New property
4577         Returns whether container has StructLayout attribute set Explicit.
4578         (FieldMember): New abstract class for consts and fields.
4579         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4580         (Field): Reuse FieldMember.
4581
4582         * const.cs (Const): Reuse FieldMember.
4583
4584         * rootcontext.cs: EmitConstants call moved to class.
4585
4586 2004-09-22  Martin Baulig  <martin@ximian.com>
4587
4588         Thanks to Peter Sestoft for this bug report.
4589
4590         * expression.cs (Conditional): If both the `trueExpr' and the
4591         `falseExpr' is a NullLiteral, return a NullLiteral.
4592
4593 2004-09-22  Martin Baulig  <martin@ximian.com>
4594
4595         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4596         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4597         for the "get_Current" call.
4598
4599 2004-09-22  Martin Baulig  <martin@ximian.com>
4600
4601         Marek and me just fixed one of our oldest bugs: #28562 :-)
4602
4603         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4604
4605         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4606         we're an EnumConstant, just return that.
4607         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4608         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4609         to get the value which'll actually be written into the attribute.
4610         However, we have to use GetValue() to access the attribute's value
4611         in the compiler.        
4612
4613 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4614
4615         * constant.cs (Constant.IsNegative): New abstract property
4616         IsNegative.
4617
4618         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4619         (StackAlloc.DoResolve): Reused IsNegative.
4620
4621 2004-09-21  Martin Baulig  <martin@ximian.com>
4622
4623         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4624         if we're used in an iterator, we may be called from different
4625         methods.
4626
4627         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4628         we actually have an exception block.
4629
4630 2004-09-20  John Luke <jluke@cfl.rr.com>
4631
4632         * class.cs, cs-parser.jay: Improve the error report for 1520:
4633         report the actual line where the error happens, not where the
4634         class was declared.
4635
4636         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4637         Pass location information that was available elsewhere.
4638
4639 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4640
4641         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4642         runtime to delay sign assemblies.
4643
4644 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4645
4646         * cs-parser.jay: Do not report the stack trace, this is barely
4647         used nowadays.
4648
4649 2004-08-22  John Luke  <john.luke@gmail.com>
4650  
4651         * driver.cs : check that a resource id is not already used
4652         before adding it, report CS1508 if it is, bug #63637
4653
4654 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4655
4656         * ecore.cs: Removed dead code.
4657
4658 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4659
4660         * class.cs: Do not report warning CS0067 on the interfaces.
4661
4662 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4663
4664         * cs-parser.jay: Add error 504 report.
4665
4666 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4667
4668         * rootcontext.cs: WarningLevel is 4 by default now.
4669
4670         * statement.cs (Fixed.Resolve): Do not null
4671         VariableInfo.
4672
4673 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4674
4675         Fixed bug #55780
4676         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4677         deep search when property is not virtual.
4678         (PropertyExpr.ResolveAccessors): Make one call for both
4679         accessors.
4680
4681 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4682
4683         Fixed bug #65766
4684         * statement.cs: Error 152 report constains also location.
4685
4686 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4687
4688         Fixed bug #65766
4689         * const.cs: Explicitly set constant as static.
4690
4691 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4692
4693         Fixed bug #64226
4694         * cs-parser.jay: Add error 1017 report.
4695
4696 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4697
4698         Fixed bug #59980, #64224
4699         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4700
4701         * typemanager.cs (IsSpecialMethod): Simplified
4702
4703 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4704
4705         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4706         condition with better params.
4707
4708 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4709
4710         Fixed bug #65238
4711         * attribute.cs (Resolve): Property has to have both
4712         accessors.
4713
4714 2004-09-14  Martin Baulig  <martin@ximian.com>
4715
4716         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4717
4718 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4719
4720         Fixed bug #61902
4721         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4722         called and is obsolete then this member suppress message
4723         when call is inside next [Obsolete] method or type.
4724
4725         * expression.cs: Use TestObsoleteMethodUsage member.
4726
4727 2004-09-14  Martin Baulig  <martin@ximian.com>
4728
4729         * cs-parser.jay: Sync a bit with the GMCS version.
4730
4731 2004-09-14  Martin Baulig  <martin@ximian.com>
4732
4733         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4734         (CSharpParser.yacc_verbose_flag): New public field.
4735
4736         * genericparser.cs: Removed.
4737
4738 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4739
4740         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4741
4742 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4743
4744         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4745
4746 2004-09-10  Martin Baulig  <martin@ximian.com>
4747
4748         Backported my MemberName changes from GMCS into MCS.
4749
4750         - we are now using a special `MemberName' class instead of using
4751         strings; in GMCS, the `MemberName' also contains the type
4752         arguments.
4753
4754         - changed the grammar rules a bit:
4755           * the old `member_name' is now a `namespace_or_type_name':
4756             The rule is that we use `namespace_or_type_name' everywhere
4757             where we expect either a "member name" (GetEnumerator) or a
4758             "member name" with an explicit interface name
4759             (IEnumerable.GetEnumerator).
4760             In GMCS, the explicit interface name may include type arguments
4761             (IEnumerable<T>.GetEnumerator).
4762           * we use `member_name' instead of just `IDENTIFIER' for
4763             "member names":
4764             The rule is that we use `member_name' wherever a member may
4765             have type parameters in GMCS.       
4766
4767         * decl.cs (MemberName): New public class.
4768         (MemberCore.MemberName): New public readonly field.
4769         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4770         (DeclSpace): Likewise.
4771
4772         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4773         * enum.cs (Enum.ctor): Likewise.
4774
4775         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4776         MemberName.     
4777         (AliasEntry.ctor): Take a MemberName, not an Expression.
4778         (AliasEntry.UsingAlias): Likewise.
4779
4780         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4781         (IMethodData.MemberName): Changed type from string to MemberName.
4782         (MemberBase.ExplicitInterfaceName): Likewise.
4783         (AbstractPropertyEventMethod.SetupName): Make this private.
4784         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4785         argument; compute the member name here.
4786         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4787         on the `member.MemberName' and the `prefix'.
4788
4789         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4790         not `type_name'.
4791         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4792         thus, we get a `MemberName' instead of a `string'.  These
4793         declarations may have type parameters in GMCS.
4794         (interface_method_declaration, delegate_declaration): Likewise.
4795         (class_declaration, interface_declaration): Likewise.
4796         (method_header): Use `namespace_or_type_name' instead of
4797         `member_name'.  We may be an explicit interface implementation.
4798         (property_declaration, event_declaration): Likewise.
4799         (member_name): This is now just an `IDENTIFIER', not a
4800         `namespace_or_type_name'.
4801         (type_name, interface_type): Removed.
4802         (namespace_or_type_name): Return a MemberName, not an Expression.
4803         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4804         call GetTypeExpression() on the MemberName to get an expression.
4805         (IndexerDeclaration.interface_type): Changed type from string to
4806         MemberName.
4807         (MakeName): Operate on MemberName's instead of string's.
4808
4809 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4810
4811         Fix bug #55770.
4812         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4813         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4814         lookup to avoid symbols introduced by 'using'.
4815         * rootcontext.cs (NamespaceLookup): Update.
4816
4817 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4818
4819         * class.cs (TypeContainer.DoDefineMembers): Do not call
4820         DefineDefaultConstructor for static classes.
4821
4822 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4823
4824         * attribute.cs (Attribute.Resolve): Add error 653 report.
4825
4826         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4827         report.
4828         (Method.ApplyAttributeBuilder): Add error 685 report.
4829         (Operator.Define): Add error 564 report.
4830
4831         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4832
4833         * expression.cs (Invocation.DoResolve): Add error
4834         245 and 250 report.
4835
4836         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4837         error 674 report.
4838
4839 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4840
4841         * class.cs (ConstructorInitializer.Resolve):
4842         Wrong error number (515->516).
4843
4844 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4845
4846         * class.cs (Indexer.Define): Add error 631 report.
4847
4848 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4849
4850         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4851
4852 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4853
4854         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4855
4856 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4857
4858         * cs-parser.jay: Added error CS0241 report.
4859
4860 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4861
4862         * cs-parser.jay (fixed_statement): Introduce a scope for the
4863         declaration in the 'fixed' statement.
4864
4865 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4866
4867         * cs-parser.jay: Added CS0230 error report.
4868
4869 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4870
4871         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4872
4873 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4874
4875         * expression.cs (Argument.Resolve): Added error CS0192 and
4876         CS0199 report.
4877
4878 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4879
4880         C# 2.0 #pragma warning feature
4881
4882         * cs-tokenizer.cs (PreProcessPragma): New method; 
4883         Handles #pragma directive.
4884
4885         * report.cs (WarningRegions): New class; Support
4886         class for #pragma warning directive. It tests whether
4887         warning is enabled for a given line.
4888
4889 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4890
4891         * const.cs: Add more descriptive error report, tahnks to
4892         Sebastien. 
4893
4894 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4895
4896         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4897
4898 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4899
4900         * expression.cs: Apply patch from Ben: Remove dead code from
4901         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4902         as that code just threw an exception anwyays.
4903
4904         * const.cs: Remove the call to the turnintoconstant, for details
4905         see bug: #63144
4906         
4907         * literal.cs: The type of the null-literal is the null type;  So
4908         we use a placeholder type (literal.cs:System.Null, defined here)
4909         for it.
4910
4911         * expression.cs (Conditional.DoResolve): Remove some old code that
4912         is no longer needed, conversions have been fixed.
4913
4914         (ArrayCreationExpression.DoResolve): Return false if we fail to
4915         resolve the inner expression.
4916
4917 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4918
4919         Fix test-290.cs.
4920         * cs-parser.jay (delegate_declaration): Record a delegate
4921         declaration as a type declaration.
4922         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4923
4924 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4925
4926         * parameter.cs: Do not crash if the type can not be resolved. 
4927
4928         * expression.cs: Report errors with unsafe pointers, fixes #64896
4929
4930 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4931
4932         * expression.cs: Pointer arith always needs to do a conv.i
4933         if the operand is a long. fix 65320
4934
4935 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4936
4937         Fixed cs0619-37.cs, cs0619-38.cs
4938
4939         * enum.cs (GetObsoleteAttribute): Removed.
4940
4941         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4942         on Enum member is double staged. The first is tested member
4943         and then enum.
4944
4945 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4946
4947         Fixed #56986, #63631, #65231
4948
4949         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4950         adds member to name container.
4951         (TypeContainer.AddToTypeContainer): New method, adds type to
4952         name container.
4953         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4954         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4955         AddOperator): Simplified by reusing AddToMemberContainer.
4956         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4957         instead of field.
4958         (Method.CheckForDuplications): Fixed implementation to test all
4959         possibilities.
4960         (MemberBase): Detection whether member is explicit interface
4961         implementation is now in constructor.
4962         (MemberBase.UpdateMemberName): Handles IndexerName.
4963         (Accessor): Changed to keep also location information.
4964         (AbstractPropertyEventMethod): Is derived from MemberCore.
4965         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4966         will be emited or not.
4967         (PropertyBase.AreAccessorsDuplicateImplementation):
4968         Tests whether accessors are not in collision with some method.
4969         (Operator): Is derived from MethodCore to simplify common
4970         operations.
4971
4972         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4973         must be performed.
4974         (DeclSpace.AddToContainer): Adds the member to defined_names
4975         table. It tests for duplications and enclosing name conflicts.
4976
4977         * enum.cs (EnumMember): Clean up to reuse the base structures
4978
4979 2004-09-03  Martin Baulig  <martin@ximian.com>
4980
4981         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4982         into TypeContainer, to make partial classes work again.
4983
4984 2004-09-03  Martin Baulig  <martin@ximian.com>
4985
4986         * rootcontext.cs (RootContext.V2): Removed.
4987
4988 2004-03-23  Martin Baulig  <martin@ximian.com>
4989
4990         * expression.cs (Invocation.OverloadResolve): Added `bool
4991         may_fail' argument and use it instead of the Location.IsNull() hack.
4992
4993 2004-09-03  Martin Baulig  <martin@ximian.com>
4994
4995         Merged latest changes into gmcs.  Please keep this comment in
4996         here, it makes it easier for me to see what changed in MCS since
4997         the last time I merged.
4998
4999 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5000
5001         Fix #61128.
5002         * expression.cs (BetterConversion): Don't allow either conversion 
5003         to be null.  Remove redundant implicit conversion test when 'q ==
5004         null' -- when this function is invoked, we already know that the
5005         implicit conversion exists.
5006         (BetterFunction): Assume that 'best' is non-null.  Remove
5007         redundant reimplementation of IsApplicable when 'best' is null.
5008         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5009         number of arguments.
5010         (IsAncestralType): Extract from OverloadResolve.
5011         (OverloadResolve): Make robust to the MethodGroupExpr being
5012         unsorted.  Implement all the logic of Section 14.5.5.1, and
5013         support overloading of methods from multiple applicable types.
5014         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5015
5016         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5017         (RealError, Warning): Append type of report to related symbol.
5018
5019 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5020
5021         * enum.cs: Fixed CLS-Compliance checks for enum members.
5022         Error tests cs3008-8.cs, cs3014-8.cs
5023
5024 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5025
5026         Fixed bug #62342, #63102
5027         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5028         like ImplementMethod.
5029
5030 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5031
5032         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5033         Fixed bug #65170.
5034
5035 2004-09-02  Martin Baulig  <martin@ximian.com>
5036
5037         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5038         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5039         on the MethodBase.
5040
5041 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5042
5043         C# 2.0 Static classes implemented
5044
5045         * class.cs (TypeContainer): instance_constructors,
5046         initialized_fields, initialized_static_fields,
5047         default_constructor, base_inteface_types are protected to be
5048         accessible from StaticClass.
5049         (TypeContainer.DefineDefaultConstructor): New virtual method
5050         for custom default constructor generating
5051         (StaticClass): New class to handle "Static classes" feature.
5052
5053         * cs-parser.jay: Handle static keyword on class like instance
5054         of StaticClass.
5055
5056         * driver.cs: Added "/langversion" command line switch with two
5057         options (iso-1, default).
5058
5059 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5060
5061         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5062
5063 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5064
5065         * delegate.cs: Style.
5066
5067 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5068
5069         * delegate.cs: Add seperate instance expr field for miguel.
5070
5071 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5072
5073         * PointerArithmetic (Resolve): make sure we are not doing
5074         pointer arith on void*. Also, make sure we are resolved
5075         by not setting eclass until resolve.
5076
5077         All callers: Make sure that PointerArithmetic gets resolved.
5078
5079 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5080
5081         * ArrayCreation (LookupType): If the type does not resolve 
5082         to an array, give an error.
5083
5084 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5085
5086         * statement.cs (Try.Resolve): Fixed bug #64222
5087
5088 2004-08-27  Martin Baulig  <martin@ximian.com>
5089
5090         * class.cs
5091         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5092         crash here.     
5093
5094 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5095
5096         * ecore.cs (Constantify): Get underlying type via
5097         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5098         Windows in special cases.
5099
5100 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5101
5102         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5103         for obtaining also private methods.
5104         (GetRemoveMethod): Used GetRemoveMethod (true)
5105         for obtaining also private methods.
5106
5107 2004-08-24  Martin Baulig  <martin@ximian.com>
5108
5109         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5110         MethodAttributes.HideBySig for operators.
5111
5112 2004-08-23  Martin Baulig  <martin@ximian.com>
5113
5114         Back to the old error reporting system :-)
5115
5116         * report.cs (Message): Removed.
5117         (Report.MessageData, ErrorData, WarningData): Removed.
5118         (Report.Error, Warning): Back to the old system.
5119
5120 2004-08-23  Martin Baulig  <martin@ximian.com>
5121
5122         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5123
5124         * class.cs (TypeContainer.ParentContainer): New public virtual
5125         method; replaces the explicit interface implementation.
5126         (ClassPart.ParentContainer): Override.
5127
5128 2004-08-23  Martin Baulig  <martin@ximian.com>
5129
5130         * statement.cs (Switch): Added support for constant switches; see
5131         #59428 or test-285.cs.
5132
5133 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5134
5135         Fixed bug #62740.
5136         * statement.cs (GetEnumeratorFilter): Removed useless
5137         logic because C# specs is strict. GetEnumerator must be
5138         public.
5139
5140 2004-08-22  Martin Baulig  <martin@ximian.com>
5141
5142         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5143         a switch and may break, reset the barrier.  Fixes #59867.
5144
5145 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5146
5147         CLS-Compliance speed up (~5% for corlib)
5148
5149         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5150         New method. Tests container for CLS-Compliant names
5151
5152         * class.cs (TypeContainer.VerifyClsName): New method.
5153         Checks whether container name is CLS Compliant.
5154         (Constructor): Implements IMethodData.
5155
5156         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5157         low-case table for CLS Compliance test.
5158         (MemberCache.VerifyClsParameterConflict): New method.
5159         Checks method parameters for CS3006 error.
5160
5161         * enum.cs (EnumMember): Is derived from MemberCore.
5162         (Enum.VerifyClsName): Optimized for better performance.
5163
5164 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5165
5166         * report.cs: Renamed Error_T to Error and changed all
5167         references.
5168
5169 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5170
5171         * class.cs (TypeContainer.IndexerArrayList): New inner class
5172         container for indexers.
5173         (TypeContainer.DefaultIndexerName): New constant for default
5174         indexer name. Replaced all "Item" with this constant.
5175         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5176
5177         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5178         DefaultMemberAttribute constructor.
5179
5180 2004-08-05  Martin Baulig  <martin@ximian.com>
5181
5182         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5183         Fix bug #59429.
5184
5185 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5186
5187         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5188         multi platforms problem.
5189
5190         * compiler.csproj: Included shared files.
5191
5192 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5193
5194         Fix bug 60333, 55971 in the more general way
5195         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5196         Added arg_type argument for constant conversion.
5197         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5198
5199 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5200
5201         Fix bug #59760
5202         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5203         OperatorArrayList, MethodCoreArrayList for typecontainer
5204         containers. Changed class member types to these new types.
5205         (MethodArrayList.DefineMembers): Added test for CS0659.
5206
5207 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5208
5209         * cfold.cs: Synchronize the folding with the code in expression.cs
5210         Binary.DoNumericPromotions for uint operands.
5211
5212         * attribute.cs: Revert patch from Raja, it introduced a regression
5213         while building Blam-1.2.1 (hard to isolate a test case).
5214
5215 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5216
5217         Fix for #55382
5218         * class.cs:
5219         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5220         name collision.
5221         (MethodCore.parent_method): New member. The method we're overriding
5222         if this is an override method.
5223         (MethodCore.CheckBase): Moved from Method class and made common.
5224         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5225         private.
5226         (MethodCore.CheckForDuplications): New abstract method. For custom
5227         member duplication search in a container
5228         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5229         method and its return type.
5230         (Event.conflict_symbol): New member. Symbol with same name in the
5231         parent class.
5232
5233         * decl.cs:
5234         (MemberCache.FindMemberWithSameName): New method. The method
5235         is looking for conflict with inherited symbols.
5236
5237 2004-08-04  Martin Baulig  <martin@ximian.com>
5238
5239         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5240
5241         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5242
5243 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5244
5245         * report.cs (Message): New enum for better error, warning reference in
5246         the code.
5247         (MessageData): New inner abstract class. It generally handles printing of
5248         error and warning messages.
5249         Removed unused Error, Warning, Message methods.
5250
5251 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5252
5253         Fix for cs0592-8.cs test
5254         * attribute.cs
5255         (Attributable.ValidAttributeTargets): Made public.
5256         (Attribute.ExplicitTarget): New member for explicit target value.
5257         (Attribute.CheckTargets): Now we translate explicit attribute
5258         target to Target here.
5259
5260 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5261
5262         * ecore.cs (MethodGroupExpr): new IsBase property.
5263
5264         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5265
5266         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5267         rather than an instance expr.
5268
5269         (DelegateCreation.Emit): Use the method group rather than
5270         the instance expression. Also, if you have base.Foo as the
5271         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5272
5273         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5274
5275         (NewDelegate.DoResolve): Only check for the existance of Invoke
5276         if the method is going to be needed. Use MethodGroupExpr.
5277
5278         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5279
5280         * expression.cs: For pointer arith., make sure to use
5281         the size of the type, not the size of the pointer to
5282         the type.
5283
5284 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5285
5286         Fix for #60722
5287         * class.cs (Class): Added error CS0502 test.
5288
5289 2004-08-03  John Luke  <jluke@cfl.rr.com>
5290             Raja R Harinath  <rharinath@novell.com>
5291
5292         Fix for #60997.
5293         * attribute.cs (Attribute.complained_before): New flag.
5294         (Attribute.ResolveType, Attribute.Resolve),
5295         (Attribute.DefinePInvokeMethod): Set it.
5296         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5297         
5298 2004-08-03  Martin Baulig  <martin@ximian.com>
5299
5300         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5301         use a user-defined operator; we still need to do numeric
5302         promotions in case one argument is a builtin type and the other
5303         one has an implicit conversion to that type.  Fixes #62322.
5304
5305 2004-08-02  Martin Baulig  <martin@ximian.com>
5306
5307         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5308         (LocalInfo.IsThis): New public property.
5309         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5310
5311 2004-08-01  Martin Baulig  <martin@ximian.com>
5312
5313         * class.cs (TypeContainer.GetClassBases): Don't set the default
5314         here since we may get called from GetPartialBases().
5315         (TypeContainer.DefineType): If GetClassBases() didn't return a
5316         parent, use the default one.
5317
5318 2004-07-30  Duncan Mak  <duncan@ximian.com>
5319
5320         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5321
5322 2004-07-30  Martin Baulig  <martin@ximian.com>
5323
5324         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5325
5326         * class.cs (SourceMethod): New public class, derive from the
5327         symbol writer's ISourceMethod.
5328         (Method): Use the new symbol writer API.
5329
5330         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5331         as argument and use the new symbol writer.
5332
5333         * location.cs
5334         (SourceFile): Implement the symbol writer's ISourceFile.
5335         (Location.SymbolDocument): Removed.
5336         (Location.SourceFile): New public property.
5337
5338         * symbolwriter.cs: Use the new symbol writer API.
5339
5340 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5341
5342         * Makefile (install-local): Remove.  Functionality moved to
5343         executable.make.
5344
5345 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5346
5347         * Makefile: Install mcs.exe.config file together with mcs.exe.
5348         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5349         correct runtime version.
5350         
5351 2004-07-25  Martin Baulig  <martin@ximian.com>
5352
5353         * class.cs
5354         (TypeContainer.RegisterOrder): Removed, this was unused.
5355         (TypeContainer, interface_order): Removed.
5356         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5357         TypeContainer as argument since we can also be called with a
5358         `PartialContainer' for a partial class/struct/interface.
5359         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5360         of checking whether we're an `Interface' - we could be a
5361         `PartialContainer'.
5362         (PartialContainer.Register): Override; call
5363         AddClass()/AddStruct()/AddInterface() on our parent.
5364
5365         * cs-parser.jay (interface_member_declaration): Add things to the
5366         `current_container', not the `current_class'.
5367
5368         * rootcontext.cs (RegisterOrder): The overloaded version which
5369         takes an `Interface' was unused, removed.
5370
5371         * typemanager.cs (TypeManager.LookupInterface): Return a
5372         `TypeContainer', not an `Interface'.
5373         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5374         contain a `PartialContainer' for an interface, so check it's
5375         `Kind' to figure out what it is.
5376
5377 2004-07-25  Martin Baulig  <martin@ximian.com>
5378
5379         * class.cs (Class.DefaultTypeAttributes): New public constant.
5380         (Struct.DefaultTypeAttributes): Likewise.
5381         (Interface.DefaultTypeAttributes): Likewise.
5382         (PartialContainer.TypeAttr): Override this and add the
5383         DefaultTypeAttributes.
5384
5385 2004-07-25  Martin Baulig  <martin@ximian.com>
5386
5387         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5388         we can just use the `Parent' field instead.
5389
5390 2004-07-25  Martin Baulig  <martin@ximian.com>
5391
5392         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5393
5394 2004-07-25  Martin Baulig  <martin@ximian.com>
5395
5396         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5397         our parts before defining any methods.
5398         (TypeContainer.VerifyImplements): Make this virtual.
5399         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5400         on our PartialContainer.
5401
5402 2004-07-25  Martin Baulig  <martin@ximian.com>
5403
5404         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5405
5406         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5407         argument, we can just use the `Parent' field instead.
5408
5409         * class.cs
5410         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5411         (MemberBase.DoDefine): Likewise.
5412
5413 2004-07-24  Martin Baulig  <martin@ximian.com>
5414
5415         * decl.cs (MemberCore.Parent): New public field.
5416         (DeclSpace.Parent): Moved to MemberCore.
5417
5418         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5419         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5420         parent's .ctor.
5421         (FieldBase, Field, Operator): Likewise.
5422         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5423         (EventField, Event): Likewise.
5424
5425 2004-07-23  Martin Baulig  <martin@ximian.com>
5426
5427         * class.cs (PartialContainer): New public class.
5428         (ClassPart): New public class.
5429         (TypeContainer): Added support for partial classes.
5430         (TypeContainer.GetClassBases): Splitted some of the functionality
5431         out into GetNormalBases() and GetPartialBases().
5432
5433         * cs-tokenizer.cs (Token.PARTIAL): New token.
5434         (Tokenizer.consume_identifier): Added some hacks to recognize
5435         `partial', but only if it's immediately followed by `class',
5436         `struct' or `interface'.
5437
5438         * cs-parser.jay: Added support for partial clases.
5439
5440 2004-07-23  Martin Baulig  <martin@ximian.com>
5441
5442         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5443         a `DeclSpace' and also made it readonly.
5444         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5445         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5446         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5447
5448         * cs-parser.jay: Pass the `current_class', not the
5449         `current_container' (at the moment, this is still the same thing)
5450         to a new Method, Property, Event, Indexer or Constructor.
5451
5452 2004-07-23  Martin Baulig  <martin@ximian.com>
5453
5454         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5455         and removed the `current_interface' one.
5456         (struct_declaration, class_declaration, interface_declaration):
5457         Set `current_class' to the newly created class/struct/interface;
5458         set their `Bases' and call Register() before parsing their body.
5459
5460 2004-07-23  Martin Baulig  <martin@ximian.com>
5461
5462         * class.cs (Kind): New public enum.
5463         (TypeContainer): Made this class abstract.
5464         (TypeContainer.Kind): New public readonly field.
5465         (TypeContainer.CheckDef): New public method; moved here from
5466         cs-parser.jay.
5467         (TypeContainer.Register): New public abstract method.
5468         (TypeContainer.GetPendingImplementations): New public abstract
5469         method.
5470         (TypeContainer.GetClassBases): Removed the `is_class' and
5471         `is_iface' parameters.
5472         (TypeContainer.DefineNestedTypes): Formerly known as
5473         DoDefineType().
5474         (ClassOrStruct): Made this class abstract.
5475
5476         * tree.cs (RootTypes): New public type. 
5477
5478 2004-07-20  Martin Baulig  <martin@ximian.com>
5479
5480         * tree.cs (Tree.RecordNamespace): Removed.
5481         (Tree.Namespaces): Removed.
5482
5483         * rootcontext.cs (RootContext.IsNamespace): Removed.
5484
5485         * cs-parser.jay (namespace_declaration): Just create a new
5486         NamespaceEntry here.
5487
5488 2004-07-20  Martin Baulig  <martin@ximian.com>
5489
5490         * statement.cs (ExceptionStatement): New abstract class.  This is
5491         now used as a base class for everyone who's using `finally'.
5492         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5493         our local variables before using them.
5494
5495         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5496         virtual method.  This is used by Yield.Resolve() to "steal" an
5497         outer block's `finally' clauses.
5498         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5499         argument.
5500
5501         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5502         version which takes an ExceptionStatement.  This version must be
5503         used to create exception branchings.
5504
5505         * iterator.cs
5506         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5507         (Iterator.EmitMoveNext): Added exception support; protect the
5508         block with a `fault' clause, properly handle 'finally' clauses.
5509         (Iterator.EmitDispose): Run all the `finally' clauses here.
5510
5511 2004-07-20  Martin Baulig  <martin@ximian.com>
5512
5513         * iterator.cs: This is the first of a set of changes in the
5514         iterator code.  Match the spec more closely: if we're an
5515         IEnumerable, then GetEnumerator() must be called.  The first time
5516         GetEnumerator() is called, it returns the current instance; all
5517         subsequent invocations (if any) must create a copy.
5518
5519 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5520
5521         * expression.cs: Resolve the constant expression before returning
5522         it. 
5523
5524 2004-07-19  Martin Baulig  <martin@ximian.com>
5525
5526         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5527         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5528         the return type of the new EmitContext.
5529
5530 2004-07-18  Martin Baulig  <martin@ximian.com>
5531
5532         * class.cs (Property.Define): Fix iterators.
5533
5534         * iterators.cs (Iterator.Define): Moved the
5535         `container.AddInterator (this)' call here from the .ctor; only do
5536         it if we resolved successfully.
5537
5538 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5539
5540         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5541         `true' for preprocessing directives that we parse.  The return
5542         value indicates whether we should return to regular tokenizing or
5543         not, not whether it was parsed successfully.
5544
5545         In the past if we were in: #if false ... #line #endif, we would
5546         resume parsing after `#line'.  See bug 61604.
5547
5548         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5549         building: IsEnumType should return true only for enums, not for
5550         enums or System.Enum itself.  This fixes #61593.
5551
5552         Likely what happened is that corlib was wrong: mcs depended on
5553         this bug in some places.  The bug got fixed, we had to add the
5554         hack, which caused bug 61593.
5555
5556         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5557         that was a workaround for the older conditions.
5558
5559 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5560
5561         * assign.cs: IAssignMethod has a new interface, as documented
5562         inline. All assignment code now uses this new api.
5563
5564         * ecore.cs, expression.cs: All classes which implement
5565         IAssignMethod now use the new interface.
5566
5567         * expression.cs (Invocation): add a hack to EmitCall so that
5568         IndexerAccess can be the target of a compound assignment without
5569         evaluating its arguments twice.
5570
5571         * statement.cs: Handle changes in Invocation api.
5572
5573 2004-07-16  Martin Baulig  <martin@ximian.com>
5574
5575         * iterators.cs: Rewrote this.  We're now using one single Proxy
5576         class for both the IEnumerable and the IEnumerator interface and
5577         `Iterator' derives from Class so we can use the high-level API.
5578
5579         * class.cs (TypeContainer.AddIterator): New method.
5580         (TypeContainer.DoDefineType): New protected virtual method, which
5581         is called from DefineType().
5582         (TypeContainer.DoDefineMembers): Call DefineType() and
5583         DefineMembers() on all our iterators.
5584         (TypeContainer.Emit): Call Emit() on all our iterators.
5585         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5586
5587         * codegen.cs (EmitContext.CurrentIterator): New public field.
5588
5589 2004-07-15  Martin Baulig  <martin@ximian.com>
5590
5591         * typemanager.cs
5592         (TypeManager.not_supported_exception_type): New type.   
5593
5594 2004-07-14  Martin Baulig  <martin@ximian.com>
5595
5596         * iterators.cs: Use real error numbers.
5597
5598 2004-07-14  Martin Baulig  <martin@ximian.com>
5599
5600         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5601         requires this to be a System.Collection.IEnumerable and not a
5602         class implementing that interface.
5603         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5604
5605 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5606
5607         * class.cs: Fixed previous fix, it broke some error tests.
5608
5609 2004-07-12  Martin Baulig  <martin@ximian.com>
5610
5611         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5612         Fixes #61293.
5613
5614 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5615
5616         * assign.cs (LocalTemporary): Add new argument: is_address,If
5617         `is_address' is true, then the value that we store is the address
5618         to the real value, and not the value itself.
5619         
5620         * ecore.cs (PropertyExpr): use the new local temporary
5621         stuff to allow us to handle X.Y += z (where X is a struct)
5622
5623 2004-07-08  Martin Baulig  <martin@ximian.com>
5624
5625         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5626         not always return, just like we're doing in Using.Resolve().
5627
5628 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5629
5630         * cs-parser.jay (fixed_statement): flag this as Pinned.
5631
5632 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5633
5634         * typemanager.cs (TypeManager): Removed MakePinned method, this
5635         mechanism is replaced with the .NET 2.x compatible mechanism of
5636         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5637
5638         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5639         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5640         `IsFixed' property which has a different meaning.
5641
5642 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5643
5644         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5645         visible from inside a nested class, not just the names of the
5646         immediately enclosing class.
5647         Fix for bug #60730.
5648
5649 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5650
5651         * expression.cs (BetterConversion): Remove buggy special-case
5652         handling of "implicit constant expression conversions".  At this
5653         point, we already know that the conversion is possible -- we're
5654         only checking to see which is better.
5655
5656 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5657
5658         * cs-parser.jay: Added error CS0210 test.
5659
5660 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5661
5662         * cs-parser.jay: Added error CS0134 test.
5663
5664 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5665
5666         Fix bug #52507
5667         * cs-parser.jay: Added error CS0145 test.
5668
5669 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5670
5671         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5672
5673 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5674         
5675         * expression.cs (StackAlloc.Resolve): The argument may not
5676         be a constant; deal with this case.
5677         
5678 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5679
5680         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5681         GetIndexerAttributeValue.
5682         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5683
5684         * class.cs (Indexer.Define): Added error tests for CS0415,
5685         CS0609.
5686
5687 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5688
5689         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5690         property code.
5691
5692 2004-06-23  Martin Baulig  <martin@ximian.com>
5693
5694         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5695         neither return nor throw, reset the barrier as well.  Fixes #60457.
5696
5697 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5698
5699         * class.cs : EventAttributes is now set to None by default.
5700           This fixes bug #60459.
5701
5702 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5703
5704         Fix bug #60219
5705         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5706         Don't throw exception but return null (it's sufficient now).
5707
5708 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5709
5710         * typemanager.cs (GetArgumentTypes): Faster implementation.
5711
5712 2004-06-18  Martin Baulig  <martin@ximian.com>
5713
5714         * attribute.cs (Attribute.Resolve): Check whether we're an
5715         EmptyCast which a Constant child.  Fixes #60333.
5716
5717 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5718
5719         * statement.cs (EmitCollectionForeach): Account for the fact that
5720         not all valuetypes are in areas which we can take the address of.
5721         For these variables, we store to a temporary variable. Also, make
5722         sure that we dont emit a `callvirt' on a valuetype method.
5723
5724 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5725
5726         * expression.cs (StackAlloc.DoReSolve): Added test for
5727         negative parameter (CS0247).
5728
5729 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5730
5731         Fix bug #59792
5732         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5733
5734 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5735
5736         Fix bug #59781
5737         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5738         ulong.
5739
5740 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5741
5742         Fix bug #58254 & cs1555.cs, cs1556.cs
5743         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5744
5745 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5746
5747         * cs-parser.jay: Added error CS1669 test for indexers.
5748
5749 2004-06-11  Martin Baulig  <martin@ximian.com>
5750
5751         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5752         call this twice: for params and varargs methods.
5753
5754 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5755
5756         * class.cs:
5757         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5758
5759 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5760
5761         * attribute.cs (Attribute.GetValidTargets): Made public.
5762
5763         * class.cs: 
5764         (AbstractPropertyEventMethod): New class for better code sharing.
5765         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5766         CS1667 report.
5767         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5768
5769 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5770
5771         Fix bug #59477.
5772         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5773         that the call to Resolve is part of a MemberAccess.
5774         (Expression.Resolve): Use it for SimpleName resolution.
5775         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5776         Add 'intermediate' boolean argument.
5777         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5778         error message when the SimpleName can be resolved ambiguously
5779         between an expression and a type.
5780         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5781         public.
5782         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5783         call on the left-side.
5784
5785 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5786
5787         * class.cs:
5788         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5789
5790 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5791
5792         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5793
5794 2004-06-11  Martin Baulig  <martin@ximian.com>
5795
5796         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5797         varargs methods if applicable.
5798
5799 2004-06-11  Martin Baulig  <martin@ximian.com>
5800
5801         * expression.cs (Invocation.EmitCall): Don't use
5802         `method.CallingConvention == CallingConventions.VarArgs' since the
5803         method could also have `CallingConventions.HasThis'.
5804
5805 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5806
5807         * class.cs (Event.GetSignatureForError): Implemented.
5808         Fixed crash in error test cs3010.cs
5809
5810 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5811
5812         * cs-tokenizer.cs: Change the way we track __arglist to be
5813         consistent with the other keywords.
5814
5815 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5816
5817         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5818         tomorrow.
5819
5820 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5821
5822         * codegen.cs: Check that all referenced assemblies have a strongname
5823         before strongnaming the compiled assembly. If not report error CS1577.
5824         Fix bug #56563. Patch by Jackson Harper.
5825         * typemanager.cs: Added a method to return all referenced assemblies.
5826         Fix bug #56563. Patch by Jackson Harper.
5827
5828 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5829
5830         * class.cs:
5831         (Method.ApplyAttributeBuilder): Moved and added conditional
5832         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5833
5834         * delegate.cs:
5835         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5836
5837 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5838
5839         Fixed #59640
5840         * class.cs: (EventField.attribute_targets): Changed default target.
5841
5842 2004-06-08  Martin Baulig  <martin@ximian.com>
5843
5844         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5845
5846 2004-06-08  Martin Baulig  <martin@ximian.com>
5847
5848         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5849
5850 2004-06-07  Martin Baulig  <martin@ximian.com>
5851
5852         Added support for varargs methods.
5853
5854         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5855         keyword.
5856
5857         * cs-parser.jay: Added support for `__arglist'.
5858
5859         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5860
5861         * expression.cs (Argument.AType): Added `ArgList'.
5862         (Invocation): Added support for varargs methods.
5863         (ArglistAccess): New public class.
5864         (Arglist): New public class.
5865
5866         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5867
5868         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5869         a method's top-level block if the method has varargs.
5870
5871         * support.cs (ReflectionParameters, InternalParameters): Added
5872         support for varargs methods.    
5873
5874 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5875
5876         * class.cs: Provide location in indexer error report.
5877
5878         * driver.cs: Use standard names.
5879
5880         * namespace.cs: Catch the use of using after a namespace has been
5881         declared also on using aliases.
5882
5883 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5884
5885         Bug #50820.
5886         * typemanager.cs (closure_private_ok, closure_invocation_type)
5887         (closure_qualifier_type, closure_invocation_assembly)
5888         (FilterWithClosure): Move to ...
5889         (Closure): New internal nested class.
5890         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5891         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5892         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5893         (MemberLookup, MemberLookupFailed): Use it.
5894         * expression.cs (New.DoResolve): Treat the lookup for the
5895         constructor as being qualified by the 'new'ed type.
5896         (Indexers.GetIndexersForTypeOrInterface): Update.
5897
5898 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5899
5900         * attribute.cs
5901         (GetConditionalAttributeValue): New method. Returns
5902         condition of ConditionalAttribute.
5903         (SearchMulti): New method.  Returns all attributes of type 't'.
5904         Use it when attribute is AllowMultiple = true.
5905         (IsConditionalMethodExcluded): New method.
5906
5907         * class.cs
5908         (Method.IsExcluded): Implemented. Returns true if method has conditional
5909         attribute and the conditions is not defined (method is excluded).
5910         (IMethodData): Extended interface for ConditionalAttribute support.
5911         (PropertyMethod.IsExcluded): Implemented.
5912
5913         * decl.cs
5914         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5915
5916         * expression.cs
5917         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5918         on the method.
5919
5920 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5921
5922         * expression.cs (ArrayCreationExpression): Make this just an
5923         `expression'. It can't be a statement, so the code here was
5924         dead.
5925
5926 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5927
5928         Fixed #59072
5929         * typemanager.cs (GetFullNameSignature): New method for
5930         MethodBase types.
5931
5932 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5933
5934         Fixed #56452
5935         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5936         Use this method when MethodBuilder is null.
5937         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5938         Added test for error CS0626 (MONO reports error for this situation).
5939         (IMethodData.GetSignatureForError): Extended interface.
5940
5941 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5942
5943         * attribute.cs
5944         (AttributeTester.GetObsoleteAttribute): Returns instance of
5945         ObsoleteAttribute when type is obsolete.
5946
5947         * class.cs
5948         (TypeContainer.VerifyObsoleteAttribute): Override.
5949         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5950         (MethodCode.VerifyObsoleteAttribute): Override.
5951         (MemberBase.VerifyObsoleteAttribute): Override.
5952
5953         * decl.cs
5954         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5955         and report proper error.
5956
5957         *delegate.cs
5958         Delegate.VerifyObsoleteAttribute): Override.
5959
5960         * ecore.cs
5961         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5962         and report proper error.
5963         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5964
5965         * enum.cs
5966         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5967         and enum member.
5968
5969         * expression.cs
5970         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5971         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5972         Added test for ObsoleteAttribute.
5973
5974         * statement.cs
5975         (Catch): Derived from Statement.
5976
5977 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5978  
5979         Fixed bug #59071 & cs0160.cs
5980  
5981         * statement.cs (Try.Resolve): Check here whether order of catch
5982         clauses matches their dependencies.
5983
5984 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
5985
5986         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
5987         caused a regression: #59343.  Referencing nested classes from an
5988         assembly stopped working.
5989
5990 2004-05-31  Martin Baulig  <martin@ximian.com>
5991
5992         MCS is now frozen for beta 2.
5993
5994 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5995
5996         * convert.cs: add a trivial cache for overload operator resolution.
5997
5998 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5999
6000         * decl.cs: If possible, use lookuptypedirect here. We can only do
6001         this if there is no `.' after the namespace. Avoids using
6002         LookupType, which does lots of slow processing.
6003         (FindNestedType) New method, does what it says :-).
6004         * namespace.cs: use LookupTypeDirect.
6005         * rootcontext.cs: use membercache, if possible.
6006         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6007
6008 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6009
6010         * expression.cs:
6011         According to the spec, 
6012
6013         In a member access of the form E.I, if E is a single identifier,
6014         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6015         field, property, localvariable, or parameter with the same type as
6016         the meaning of E as a type-name (§3.8), then both possible
6017         meanings of E are permitted.
6018
6019         We did not check that E as a simple-name had the same type as E as
6020         a type name.
6021
6022         This trivial check gives us 5-7% on bootstrap time.
6023
6024 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6025
6026         * expression.cs (Invocation.OverloadResolve): Avoid the
6027         use of hashtables and boxing here by allocating on demand.
6028
6029 2004-05-30  Martin Baulig  <martin@ximian.com>
6030
6031         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6032         we're doing a silent lookup.  Don't try to lookup nested types in
6033         TypeManager.object_type (thanks to Ben Maurer).
6034
6035 2004-05-30  Martin Baulig  <martin@ximian.com>
6036
6037         Committing a patch from Ben Maurer.
6038
6039         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6040
6041 2004-05-29  Martin Baulig  <martin@ximian.com>
6042
6043         * class.cs (IMethodData.ShouldIgnore): New method.
6044
6045         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6046         `Location' argument, we don't need it anywhere.  Use
6047         `IMethodData.ShouldIgnore ()' instead of
6048         `MethodData.GetMethodFlags ()'.
6049         (TypeManager.AddMethod): Removed.
6050         (TypeManager.AddMethod2): Renamed to AddMethod.
6051
6052 2004-05-29  Martin Baulig  <martin@ximian.com>
6053
6054         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6055
6056         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6057         converting from a class type S to an interface type and we already
6058         have an object on the stack, don't box it again.  Fixes #52578.
6059
6060 2004-05-29  Martin Baulig  <martin@ximian.com>
6061
6062         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6063         Added support for `params' parameters.  Fixes #59267.
6064
6065 2004-05-29  Martin Baulig  <martin@ximian.com>
6066
6067         * literal.cs (NullPointer): Provide a private .ctor which sets
6068         `type' to TypeManager.object_type.  Fixes #59048.
6069
6070 2004-05-29  Martin Baulig  <martin@ximian.com>
6071
6072         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6073         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6074
6075         * ecore.cs (EventExpr.instance_expr): Make the field private.
6076
6077 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6078
6079         Fixed bug #50080 & cs0214-2.cs
6080         * expression.cs (Cast.DoResolve): Check unsafe context here.
6081         
6082         * statement.cs (Resolve.DoResolve): Likewise.
6083
6084 2004-05-26  Martin Baulig  <martin@ximian.com>
6085
6086         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6087
6088         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6089         (RootContext.LookupType): Pass down the `silent' flag.
6090
6091 2004-05-25  Martin Baulig  <martin@ximian.com>
6092
6093         * expression.cs
6094         (MethodGroupExpr.IdenticalTypeName): New public property.
6095         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6096         expression actually refers to a type.
6097
6098 2004-05-25  Martin Baulig  <martin@ximian.com>
6099
6100         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6101         for #56176 and made it actually work.
6102
6103 2004-05-25  Martin Baulig  <martin@ximian.com>
6104
6105         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6106         (FieldExpr, PropertyExpr): Override and implement
6107         CacheTemporaries.  Fixes #52279.
6108
6109 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6110
6111         * location.cs: In the new compiler listing a file twice is a
6112         warning, not an error.
6113
6114 2004-05-24  Martin Baulig  <martin@ximian.com>
6115
6116         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6117         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6118
6119 2004-05-24  Martin Baulig  <martin@ximian.com>
6120
6121         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6122         walking the `using' list.  Fixes #53921.
6123
6124 2004-05-24  Martin Baulig  <martin@ximian.com>
6125
6126         * const.cs (Const.LookupConstantValue): Added support for
6127         EmptyCast's; fixes #55251.
6128
6129 2004-05-24  Martin Baulig  <martin@ximian.com>
6130
6131         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6132         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6133         which does the CS0135 check.  The reason is that we first need to
6134         check whether the variable actually exists.
6135
6136 2004-05-24  Martin Baulig  <martin@ximian.com>
6137
6138         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6139         than RootContext.LookupType() to find the explicit interface
6140         type.  Fixes #58584.
6141
6142 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6143
6144         * Makefile: Simplify.  Use executable.make.
6145         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6146
6147 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6148
6149         * decl.cs:
6150         * enum.cs:
6151         Use the invariant culture when doing String.Compare for CLS case
6152         sensitivity.
6153         
6154 2004-05-23  Martin Baulig  <martin@ximian.com>
6155
6156         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6157         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6158
6159         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6160         
6161 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6162
6163         * class.cs (MemberBase.Define): Reuse MemberType member for 
6164         resolved type. Other methods can use it too.
6165
6166 2004-05-23  Martin Baulig  <martin@ximian.com>
6167
6168         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6169         the variable also exists in the current block (otherwise, we need
6170         to report a CS0103).  Fixes #58670.
6171
6172 2004-05-23  Martin Baulig  <martin@ximian.com>
6173
6174         * flowanalysis.cs (Reachability.Reachable): Compute this
6175         on-the-fly rather than storing it as a field.
6176
6177 2004-05-23  Martin Baulig  <martin@ximian.com>
6178
6179         * flowanalysis.cs (Reachability.And): Manually compute the
6180         resulting `barrier' from the reachability.      
6181        
6182 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6183
6184         Fix bug #57835
6185         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6186         instance of ObsoleteAttribute when symbol is obsolete.
6187
6188         * class.cs
6189         (IMethodData): Extended interface for ObsoleteAttribute support.
6190
6191 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6192
6193         * attribute.cs: Fix bug #55970
6194
6195 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6196
6197         Fix bug #52705
6198         * attribute.cs
6199         (GetObsoleteAttribute): New method. Creates the instance of
6200         ObsoleteAttribute.
6201         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6202         ObsoleteAttribute when member is obsolete.
6203         (AttributeTester.Report_ObsoleteMessage): Common method for
6204         Obsolete error/warning reporting.
6205
6206         * class.cs
6207         (TypeContainer.base_classs_type): New member for storing parent type.
6208
6209         * decl.cs
6210         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6211         for this MemberCore.
6212
6213 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6214
6215         * attribute.cs, const.cs: Fix bug #58590
6216
6217 2004-05-21  Martin Baulig  <martin@ximian.com>
6218
6219         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6220         out parameters if the end of the method is unreachable.  Fixes
6221         #58098. 
6222
6223 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6224
6225         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6226         Hari was right, why extra method.
6227
6228 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6229
6230         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6231
6232 2004-05-20  Martin Baulig  <martin@ximian.com>
6233
6234         Merged this back from gmcs to keep the differences to a minumum.
6235
6236         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6237         instead of a Declspace.
6238         (Attribute.ResolveType): Likewise.
6239         (Attributes.Search): Likewise.
6240         (Attributes.Contains): Likewise.
6241         (Attributes.GetClsCompliantAttribute): Likewise.
6242
6243         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6244         argument.
6245         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6246         DeclSpace.
6247
6248 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6249
6250         Fix bug #58688 (MCS does not report error when the same attribute
6251         is assigned twice)
6252
6253         * attribute.cs (Attribute.Emit): Distinction between null and default.
6254
6255 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6256
6257         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6258         of a top-level attribute without an attribute target.
6259         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6260         Make non-static.
6261         (Attribute.Conditional_GetConditionName), 
6262         (Attribute.Obsolete_GetObsoleteMessage): Update.
6263         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6264         part of ScanForIndexerName.
6265         (Attribute.CanIgnoreInvalidAttribute): New function.
6266         (Attribute.ScanForIndexerName): Move to ...
6267         (Attributes.ScanForIndexerName): ... here.
6268         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6269         (Attributes.Search): New internal variant that can choose not to
6270         complain if types aren't resolved.  The original signature now
6271         complains.
6272         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6273         complaints suppressed.
6274         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6275         only if it not useful.
6276         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6277         top-level for attributes that are shared between the assembly
6278         and a top-level class.
6279         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6280         * class.cs: Update to reflect changes.
6281         (DefineIndexers): Fuse loops.
6282         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6283         a couple more variants of attribute names.
6284
6285 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6286
6287         Fix bug #52585 (Implemented explicit attribute declaration)
6288
6289         * attribute.cs:
6290         (Attributable.ValidAttributeTargets): New abstract method. It gets
6291         list of valid attribute targets for explicit target declaration.
6292         (Attribute.Target): It holds target itself.
6293         (AttributeSection): Removed.
6294         (Attribute.CheckTargets): New method. It checks whether attribute
6295         target is valid for the current element.
6296
6297         * class.cs:
6298         (EventProperty): New class. For events that are declared like
6299         property (with add and remove accessors).
6300         (EventField): New class. For events that are declared like field.
6301         class.cs
6302
6303         * cs-parser.jay: Implemented explicit attribute target declaration.
6304
6305         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6306         Override ValidAttributeTargets.
6307
6308         * parameter.cs:
6309         (ReturnParameter): Class for applying custom attributes on 
6310         the return type.
6311         (ParameterAtribute): New class. Class for applying custom
6312         attributes on the parameter type.
6313
6314 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6315
6316         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6317         definitions. 
6318
6319         (Method): Allow UNSAFE here.
6320
6321         * modifiers.cs: Support unsafe reporting.
6322
6323 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6324
6325         * decl.cs: Fix bug #58478.
6326
6327 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6328
6329         * statement.cs: When checking for unreachable code on an EmptyStatement,
6330         set the location. Fixes bug #58488.
6331
6332 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6333
6334         * driver.cs: Add -pkg handling.
6335
6336         From Gonzalo: UseShelLExecute=false
6337
6338 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6339
6340         * attribute.cs:
6341         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6342         for attribute.
6343         (Attribute.IsClsCompliaceRequired): Moved to base for better
6344         accesibility.
6345         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6346         when attribute is AttributeUsageAttribute.
6347         (Attribute.GetValidTargets): Simplified.
6348         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6349         attribute for this type.
6350         (Attribute.ApplyAttributes): Method renamed to Emit and make
6351         non-static.
6352         (GlobalAttributeSection): New class for special handling of global
6353         attributes (assembly, module).
6354         (AttributeSection.Emit): New method.
6355
6356         * class.cs: Implemented Attributable abstract methods.
6357         (MethodCore.LabelParameters): Moved to Parameter class.
6358         (Accessor): Is back simple class.
6359         (PropertyMethod): Implemented Attributable abstract class.
6360         (DelegateMethod): Implemented Attributable abstract class.
6361         (Event): New constructor for disctintion between normal Event
6362         and Event with accessors.
6363
6364         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6365
6366         * codegen.cs, const.cs, decl.cs, delegate.cs:
6367         (CommonAssemblyModulClass): Implemented Attributable abstract class
6368         and simplified.
6369
6370         * enum.cs: Implement IAttributeSupport interface.
6371         (EnumMember): New class for emum members. Implemented Attributable
6372         abstract class
6373
6374         * parameter.cs:
6375         (ParameterBase): Is abstract.
6376         (ReturnParameter): New class for easier [return:] attribute handling.
6377
6378         * typemanager.cs: Removed builder_to_attr.
6379
6380 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6381
6382         Fix bug #57151.
6383         * attribute.cs (Attribute.GetPositionalValue): New function.
6384         * class.cs (TypeContainer.VerifyMembers): New function.
6385         (TypeContainer.Emit): Use it.
6386         (ClassOrStruct): New base class for Class and Struct.
6387         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6388         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6389         class.
6390         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6391         then each non-static field should have a FieldOffset attribute.
6392         Otherwise, none of the fields should have a FieldOffset attribute.
6393         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6394         and FieldOffset attributes.
6395         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6396         (TypeManager.field_offset_attribute_type): New core types.
6397         (TypeManager.InitCoreTypes): Initialize them.
6398
6399 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6400
6401         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6402         Return correct type.
6403         From bug #58270.
6404
6405 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6406
6407         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6408         be implicitly converted to ulong.
6409         
6410         * expression.cs: The logic for allowing operator &, | and ^ worked
6411         was wrong, it worked before because we did not report an error in
6412         an else branch.  Fixes 57895.
6413
6414         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6415         allow volatile fields to be reference types.
6416
6417 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6418
6419         * driver.cs: Add support for /debug-
6420
6421 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6422
6423         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6424         Add a 'complain' parameter to silence errors.
6425         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6426         silently overlooked type-resolutions.
6427         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6428         to reflect changes.
6429         (Attributes.Search): New function.
6430         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6431         (Attributes.GetAttributeFullName): Remove hack.
6432         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6433         Update to reflect changes.
6434         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6435         Use Attributes.Search instead of nested loops.
6436
6437 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6438
6439         * decl.cs:
6440         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6441         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6442         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6443
6444         * report.cs: (Report.Warning): Renamed to Warning_T because of
6445         parameter collision.
6446
6447 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6448
6449         * expression.cs (MemberAccess.ResolveMemberAccess):
6450         Exit with non-zero status after Report.Error.
6451         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6452         Likewise.
6453         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6454
6455 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6456
6457         * support.cs: Don't hang when the file is empty.
6458
6459 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6460
6461         * support.cs: In SeekableStreamReader, compute the preamble size of the
6462           underlying stream. Position changes should take into account that initial
6463           count of bytes.
6464
6465 2004-05-03  Todd Berman  <tberman@sevenl.net>
6466
6467         * driver.cs: remove unused GetSysVersion function.
6468
6469 2004-05-03  Todd Berman  <tberman@sevenl.net>
6470
6471         * driver.cs: Remove the hack from saturday, as well as the hack
6472         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6473         link_paths to get that bit proper.
6474
6475 2004-05-01  Todd Berman  <tberman@sevenl.net>
6476
6477         * driver.cs: Try a LoadFrom before a Load, this checks the current
6478         path. This is currently a bug in mono that is be fixed, however, this
6479         provides a workaround for now. This will be removed when the bug
6480         is fixed.
6481
6482 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6483
6484         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6485         incomplete key pairs (#57941).
6486
6487 2004-05-01  Todd Berman  <tberman@sevenl.net>
6488
6489         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6490         from the GAC
6491
6492 2004-04-30  Jackson Harper  <jackson@ximian.com>
6493
6494         * codegen.cs: Open keys readonly.
6495         
6496 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6497
6498         * typemanager.cs: don't report cyclic struct layout when a struct
6499         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6500         which has 2 Pango.Rectangle fields.
6501
6502 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6503
6504         * expression.cs: Handle IntPtr comparisons with IL code
6505         rather than a method call.
6506
6507 2004-04-29  Martin Baulig  <martin@ximian.com>
6508
6509         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6510         the list of PropertyInfo's in class hierarchy and find the
6511         accessor.  Fixes #56013.
6512
6513 2004-04-29  Martin Baulig  <martin@ximian.com>
6514
6515         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6516
6517 2004-04-29  Martin Baulig  <martin@ximian.com>
6518
6519         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6520
6521         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6522
6523 2004-04-29  Martin Baulig  <martin@ximian.com>
6524
6525         * class.cs (ConstructorInitializer.Resolve): Check whether the
6526         parent .ctor is accessible.  Fixes #52146.
6527
6528 2004-04-29  Martin Baulig  <martin@ximian.com>
6529
6530         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6531
6532         * statement.cs (Using.EmitLocalVariableDecls): Use
6533         TypeManager.idisposable_type, not typeof (IDisposable).
6534         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6535
6536 2004-04-29  Martin Baulig  <martin@ximian.com>
6537
6538         * class.cs (Event.Define): Don't emit the field and don't set
6539         RTSpecialName and SpecialName for events on interfaces.  Fixes
6540         #57703. 
6541
6542 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6543
6544         Refactor Attribute.ApplyAttributes.
6545         * attribute.cs (Attributable): New base class for objects that can
6546         have Attributes applied on them.
6547         (Attribute): Make AttributeUsage fields public.
6548         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6549         (Attribute.IsInternalCall): New property.
6550         (Attribute.UsageAttr): Convert to a public read-only property.
6551         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6552         (Attribute.ResolveType, Attribute.Resolve)
6553         (Attribute.ScanForIndexerName): Update to reflect changes.
6554         (Attribute.CheckAttributeTarget): Re-format.
6555         (Attribute.ApplyAttributes): Refactor, to various
6556         Attributable.ApplyAttributeBuilder methods.
6557         * decl.cs (MemberCore): Make Attributable.
6558         * class.cs (Accessor): Make Attributable.
6559         (MethodData.ApplyAttributes): Use proper attribute types, not
6560         attribute names.
6561         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6562         (TypeContainer.ApplyAttributeBuilder)
6563         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6564         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6565         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6566         (Operator.ApplyAttributeBuilder): New factored-out methods.
6567         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6568         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6569         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6570         * parameter.cs (ParameterBase): New Attributable base class
6571         that can also represent Return types.
6572         (Parameter): Update to the changes.
6573
6574 2004-04-29  Jackson Harper  <jackson@ximian.com>
6575
6576         * driver.cs: Prefer the corlib system version when looking for
6577         assemblies in the GAC. This is still a hack, but its a better hack
6578         now.
6579         
6580 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6581
6582         * decl.cs, enum.cs: Improved error 3005 reporting.
6583   
6584         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6585         (related_symbols): New private member for list of symbols
6586         related to reported error/warning.
6587         
6588         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6589
6590 2004-04-29  Martin Baulig  <martin@ximian.com>
6591
6592         * ecore.cs (Expression.Constantify): If we're an enum and
6593         TypeManager.TypeToCoreType() doesn't give us another type, use
6594         t.UnderlyingSystemType.  Fixes #56178.  
6595
6596 2004-04-29  Martin Baulig  <martin@ximian.com>
6597
6598         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6599         interfaces and for each interface, only add members directly
6600         declared in that interface.  Fixes #53255.
6601
6602 2004-04-28  Martin Baulig  <martin@ximian.com>
6603
6604         * expression.cs (ConditionalLogicalOperator): Use a temporary
6605         variable for `left' to avoid that we evaluate it more than once;
6606         bug #52588.
6607
6608 2004-04-28  Martin Baulig  <martin@ximian.com>
6609
6610         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6611         `void[]' (CS1547).
6612
6613 2004-04-28  Martin Baulig  <martin@ximian.com>
6614
6615         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6616         void (CS1547).
6617
6618         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6619         whether the type is not void (CS1547).
6620
6621 2004-04-28  Martin Baulig  <martin@ximian.com>
6622
6623         * expression.cs (Unary.DoResolveLValue): Override this and report
6624         CS0131 for anything but Operator.Indirection.
6625
6626 2004-04-28  Martin Baulig  <martin@ximian.com>
6627
6628         Committing a patch from Ben Maurer; see bug #50820.
6629
6630         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6631         check for classes.
6632
6633         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6634         classes.        
6635
6636 2004-04-28  Martin Baulig  <martin@ximian.com>
6637
6638         Committing a patch from Ben Maurer; see bug #50820.
6639
6640         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6641         check for classes.
6642
6643         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6644         classes.        
6645
6646 2004-04-28  Martin Baulig  <martin@ximian.com>
6647
6648         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6649         (Block.AddLabel): Call DoLookupLabel() to only search in the
6650         current block.
6651
6652 2004-04-28  Martin Baulig  <martin@ximian.com>
6653
6654         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6655         comparing StringConstants and NullLiterals in Equality and Inequality.
6656
6657 2004-04-28  Jackson Harper  <jackson@ximian.com>
6658
6659         * driver.cs: Attempt to load referenced assemblies from the
6660         GAC. This is the quick and dirty version of this method that
6661         doesnt take into account versions and just takes the first
6662         canidate found. Will be good enough for now as we will not have more
6663         then one version installed into the GAC until I update this method.
6664
6665 2004-04-28  Martin Baulig  <martin@ximian.com>
6666
6667         * typemanager.cs (TypeManager.CheckStructCycles): New public
6668         static method to check for cycles in the struct layout.
6669
6670         * rootcontext.cs (RootContext.PopulateTypes): Call
6671         TypeManager.CheckStructCycles() for each TypeContainer.
6672         [Note: We only need to visit each type once.]
6673
6674 2004-04-28  Martin Baulig  <martin@ximian.com>
6675
6676         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6677
6678         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6679         success and added `out object value'.  Use a `bool resolved' field
6680         to check whether we've already been called rather than
6681         `ConstantValue != null' since this breaks for NullLiterals.
6682
6683 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6684
6685         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6686         setting of this flag, since the 'set' method may be non-public.
6687
6688 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6689
6690         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6691         check on current_vector.Block.
6692
6693 2004-04-27  Martin Baulig  <martin@ximian.com>
6694
6695         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6696         a field initializer.  Fixes #56459.
6697
6698 2004-04-27  Martin Baulig  <martin@ximian.com>
6699
6700         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6701         we're not attempting to use an indexer.  Fixes #52154.
6702
6703 2004-04-27  Martin Baulig  <martin@ximian.com>
6704
6705         * statement.cs (Return): Don't create a return label if we don't
6706         need it; reverts my change from January 20th.  Thanks to Ben
6707         Maurer for this.
6708
6709 2004-04-27  Martin Baulig  <martin@ximian.com>
6710
6711         According to the spec, `goto' can only leave a nested scope, but
6712         never enter it.
6713
6714         * statement.cs (Block.LookupLabel): Only lookup in the current
6715         block, don't recurse into parent or child blocks.
6716         (Block.AddLabel): Check in parent and child blocks, report
6717         CS0140/CS0158 if we find a duplicate.
6718         (Block): Removed this indexer for label lookups.
6719         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6720         this already does the error reporting for us.
6721
6722         * flowanalysis.cs
6723         (FlowBranching.UsageVector.Block): New public variable; may be null.
6724         (FlowBranching.CreateSibling): Added `Block' argument.
6725         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6726         label for the target of a `goto' and check whether we're not
6727         leaving a `finally'.
6728
6729 2004-04-27  Martin Baulig  <martin@ximian.com>
6730
6731         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6732         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6733         just for returns).
6734
6735 2004-04-27  Martin Baulig  <martin@ximian.com>
6736
6737         * statement.cs (Block.AddLabel): Also check for implicit blocks
6738         and added a CS0158 check.
6739
6740 2004-04-27  Martin Baulig  <martin@ximian.com>
6741
6742         * flowanalysis.cs (FlowBranchingLoop): New class.
6743         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6744         UsageVector's instead of an ArrayList.
6745         (FlowBranching.Label): Likewise.
6746         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6747         (FlowBranching.AddBreakVector): New method.
6748
6749 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6750
6751         * attribute.cs: Small regression fix: only convert the type if we
6752         the type is different, fixes System.Drawing build.
6753
6754 2004-04-27  Martin Baulig  <martin@ximian.com>
6755
6756         * attribute.cs (Attribute.Resolve): If we have a constant value
6757         for a named field or property, implicity convert it to the correct
6758         type.
6759
6760 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6761
6762         * statement.cs (Block.Block): Implicit blocks share
6763         'child_variable_names' fields with parent blocks.
6764         (Block.AddChildVariableNames): Remove.
6765         (Block.AddVariable): Mark variable as "used by a child block" in
6766         every surrounding block.
6767         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6768         been used in a child block, complain about violation of "Invariant
6769         meaning in blocks" rule.
6770         * cs-parser.jay (declare_local_variables): Don't use
6771         AddChildVariableNames.
6772         (foreach_statement): Don't create an implicit block: 'foreach'
6773         introduces a scope.
6774
6775 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6776
6777         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6778         converting from 0L to ulong.  Fixes 57522.
6779
6780 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6781
6782         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6783         derived class hides via 'new' keyword field from base class (test-242.cs).
6784         TODO: Handle this in the more general way.
6785         
6786         * class.cs (CheckBase): Ditto.
6787
6788 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6789
6790         * decl.cs (caching_flags): New member for storing cached values
6791         as bit flags.
6792         (MemberCore.Flags): New enum where bit flags for caching_flags
6793         are defined.
6794         (MemberCore.cls_compliance): Moved to caching_flags.
6795         (DeclSpace.Created): Moved to caching_flags.
6796
6797         * class.cs: Use caching_flags instead of DeclSpace.Created
6798         
6799 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6800
6801         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6802         if we are only a derived class, not a nested class.
6803
6804         * typemanager.cs: Same as above, but do this at the MemberLookup
6805         level (used by field and methods, properties are handled in
6806         PropertyExpr).   Allow for the qualified access if we are a nested
6807         method. 
6808
6809 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6810
6811         * class.cs: Refactoring.
6812         (IMethodData): New inteface; Holds links to parent members
6813         to avoid member duplication (reduced memory allocation).
6814         (Method): Implemented IMethodData interface.
6815         (PropertyBase): New inner classes for get/set methods.
6816         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6817         (Event): New inner classes for add/remove methods.
6818         (Event.DelegateMethod): Implemented IMethodData interface.
6819
6820         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6821         EmitContext (related to class.cs refactoring).
6822
6823 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6824
6825         * delegate.cs (Delegate.VerifyApplicability): If the number of
6826         arguments are the same as the number of parameters, first try to
6827         verify applicability ignoring  any 'params' modifier on the last
6828         parameter.
6829         Fixes #56442.
6830
6831 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6832
6833         * class.cs (TypeContainer.AddIndexer): Use
6834         'ExplicitInterfaceName' to determine if interface name was
6835         explicitly specified.  'InterfaceType' is not initialized at this time.
6836         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6837         Indexers array is already in the required order.  Initialize
6838         'IndexerName' only if there are normal indexers.
6839         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6840         (TypeContainer.Emit): Emit DefaultMember attribute only if
6841         IndexerName is initialized.
6842         Fixes #56300.
6843
6844 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6845
6846         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6847         Fixes #57007
6848
6849 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6850
6851         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6852         attributes.
6853         Fix for #56456.
6854
6855         * attribute.cs (Attribute.Resolve): Check for duplicate named
6856         attributes.
6857         Fix for #56463.
6858
6859 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6860
6861         * iterators.cs (MarkYield): track whether we are in an exception,
6862         and generate code accordingly.  Use a temporary value to store the
6863         result for our state.
6864
6865         I had ignored a bit the interaction of try/catch with iterators
6866         since their behavior was not entirely obvious, but now it is
6867         possible to verify that our behavior is the same as MS .NET 2.0
6868
6869         Fixes 54814
6870
6871 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6872
6873         * iterators.cs: Avoid creating temporaries if there is no work to
6874         do. 
6875
6876         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6877         Enumerations, use TypeManager.EnumToUnderlying and call
6878         recursively. 
6879
6880         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6881         bug #57013
6882
6883         (This.Emit): Use EmitContext.EmitThis to emit our
6884         instance variable.
6885
6886         (This.EmitAssign): Ditto.
6887
6888         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6889         codepaths, we will move all the functionality into
6890         Mono.CSharp.This 
6891
6892         (FieldExpr.EmitAssign): Ditto.
6893
6894         This fixes several hidden bugs that I uncovered while doing a code
6895         review of this today.
6896
6897         * codegen.cs (EmitThis): reworked so the semantics are more clear
6898         and also support value types "this" instances.
6899
6900         * iterators.cs: Changed so that for iterators in value types, we
6901         do not pass the value type as a parameter.  
6902
6903         Initialization of the enumerator helpers is now done in the caller
6904         instead of passing the parameters to the constructors and having
6905         the constructor set the fields.
6906
6907         The fields have now `assembly' visibility instead of private.
6908
6909 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6910
6911         * expression.cs (Argument.Resolve): Check if fields passed as ref
6912         or out are contained in a MarshalByRefObject.
6913
6914         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6915         another compiler type.
6916
6917 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6918
6919         * class.cs (Indexer.Define): use the new name checking method.
6920         Also, return false on an error.
6921         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6922         (is_identifier_[start/part]_character): make static.
6923
6924 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6925
6926         * expression.cs (Binary.ResolveOperator): Do no append strings
6927         twice: since we can be invoked more than once (array evaluation)
6928         on the same concatenation, take care of this here.  Based on a fix
6929         from Ben (bug #56454)
6930
6931 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6932
6933         * codegen.cs: Fix another case where CS1548 must be reported (when 
6934         delay-sign isn't specified and no private is available #56564). Fix
6935         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6936         error when MCS is used on the MS runtime and we need to delay-sign 
6937         (which seems unsupported by AssemblyBuilder - see #56621).
6938
6939 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6940
6941         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6942         (TypeManager.ComputeNamespaces): Faster implementation for
6943         Microsoft runtime.
6944
6945         * compiler.csproj: Updated AssemblyName to mcs.
6946
6947 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6948
6949         * rootcontext.cs: Add new types to the boot resolution.
6950
6951         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6952         MulticastDelegate is not allowed.
6953
6954         * typemanager.cs: Add new types to lookup: System.TypedReference
6955         and ArgIterator.
6956
6957         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6958         check for TypedReference or ArgIterator, they are not allowed. 
6959
6960         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6961         makes us properly catch 1510 in some conditions (see bug 56016 for
6962         details). 
6963
6964 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6965
6966         * CryptoConvert.cs: update from corlib version
6967         with endian fixes.
6968
6969 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6970
6971         * class.cs (Indexer.Define): Check indexername declaration
6972
6973 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6974
6975         * attribute.cs (IsClsCompliant): Fixed problem with handling
6976         all three states (compliant, not-compliant, undetected).
6977
6978 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6979
6980         * attribute.cs (Attribute): Location is now public.
6981         (Resolve): Store resolved arguments (pos_values) in attribute class.
6982         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6983         (GetClsCompliantAttributeValue): New method that gets
6984         CLSCompliantAttribute value.
6985         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6986         if exists else null.
6987         (AttributeTester): New class for CLS-Compliant verification routines.
6988
6989         * class.cs (Emit): Add CLS-Compliant verification.
6990         (Method.GetSignatureForError): Implemented.
6991         (Constructor.GetSignatureForError): Implemented
6992         (Constructor.HasCompliantArgs): Returns if constructor has
6993         CLS-Compliant arguments.
6994         (Constructor.Emit): Override.
6995         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6996         is needed to test only parameters.
6997         (FieldBase.GetSignatureForError): Implemented.
6998         (TypeContainer): New member for storing base interfaces.
6999         (TypeContainer.FindMembers): Search in base interfaces too.
7000
7001         * codegen.cs (GetClsComplianceAttribute): New method that gets
7002         assembly or module CLSCompliantAttribute value.
7003         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7004         for assembly.
7005         (ModuleClass.Emit): Add error 3012 test.
7006
7007         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7008
7009         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7010         state for all decl types.
7011         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7012         if CLS-Compliant tests are required.
7013         (IsClsCompliaceRequired): New method. Analyze whether code
7014         must be CLS-Compliant.
7015         (IsExposedFromAssembly): New method. Returns true when MemberCore
7016         is exposed from assembly.
7017         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7018         value or gets cached value.
7019         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7020         is explicitly marked with CLSCompliantAttribute.
7021         (IsIdentifierClsCompliant): New abstract method. This method is
7022         used to testing error 3005.
7023         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7024         for identifier and parameters CLS-Compliant testing.
7025         (VerifyClsCompliance): New method. The main virtual method for
7026         CLS-Compliant verifications.
7027         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7028         null. I don't know why is null (too many public members !).
7029         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7030         and get value of first CLSCompliantAttribute that found.
7031
7032         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7033         (VerifyClsCompliance): Override and add extra tests.
7034
7035         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7036         clscheck- disable CLS-Compliant verification event if assembly is has
7037         CLSCompliantAttribute(true).
7038
7039         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7040         ApllyAttribute is now called in emit section as in the other cases.
7041         Possible future Emit integration.
7042         (IsIdentifierClsCompliant): New override.
7043         (VerifyClsCompliance): New override.
7044         (GetEnumeratorName): Returns full enum name.
7045
7046         * parameter.cs (GetSignatureForError): Implemented.
7047
7048         * report.cs (WarningData): New struct for Warning message information.
7049         (LocationOfPreviousError): New method.
7050         (Warning): New method. Reports warning based on the warning table.
7051         (Error_T): New method. Reports error based on the error table.
7052
7053         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7054         verifications are done here.
7055
7056         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7057
7058         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7059         CLSCompliantAttribute.
7060         (all_imported_types): New member holds all imported types from other
7061         assemblies.
7062         (LoadAllImportedTypes): New method fills static table with exported types
7063         from all referenced assemblies.
7064         (Modules): New property returns all assembly modules.
7065
7066 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7067
7068         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7069         throwing a parser error.
7070
7071         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7072         which removes the hardcoded get_/set_ prefixes for properties, as
7073         IL allows for the properties to be named something else.  
7074
7075         Bug #56013
7076
7077         * expression.cs: Do not override operand before we know if it is
7078         non-null.  Fix 56207
7079
7080 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7081
7082         * typemanager.cs: support for pinned variables.
7083
7084 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7085
7086         * decl.cs, typemanager.cs: Avoid using an arraylist
7087         as a buffer if there is only one result set.
7088
7089 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7090
7091         * expression.cs: Make sure you cant call a static method
7092         with an instance expression, bug #56174.
7093
7094 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7095
7096         * class.cs (IsDuplicateImplementation): Improve error reporting to
7097         flag 663 (method only differs in parameter modifier).
7098
7099         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7100         in preprocessor directives.
7101
7102         * location.cs (LookupFile): Allow for the empty path.
7103
7104         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7105         better approach for some of that patch, but its failing with the
7106         CharSet enumeration.  For now try/catch will do.
7107
7108         * typemanager.cs: Do not crash if a struct does not have fields.
7109         Fixes 56150.
7110
7111 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7112
7113         * expression.cs: cs0213, cant fix a fixed expression.
7114         fixes 50231.
7115
7116 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7117
7118         * cs-parser.jay: detect invalid embeded statements gracefully.
7119         bug #51113.
7120
7121 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7122
7123         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7124         As a regex:
7125         s/
7126         the invocation type may not be a subclass of the tye of the item/
7127         The type of the item must be a subclass of the invocation item.
7128         /g
7129
7130         Fixes bug #50820.
7131
7132 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7133
7134         * attribute.cs: Added methods to get a string and a bool from an
7135         attribute. Required to information from AssemblyKeyFileAttribute,
7136         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7137         * codegen.cs: Modified AssemblyName creation to include support for
7138         strongnames. Catch additional exceptions to report them as CS1548.
7139         * compiler.csproj: Updated include CryptoConvert.cs.
7140         * compiler.csproj.user: Removed file - user specific configuration.
7141         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7142         Mono.Security assembly. The original class is maintained and tested in
7143         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7144         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7145         like CSC 8.0 (C# v2) supports.
7146         * Makefile: Added CryptoConvert.cs to mcs sources.
7147         * rootcontext.cs: Added new options for strongnames.
7148
7149 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7150
7151         * driver.cs: For --expect-error, report error code `2'
7152         if the program compiled with no errors, error code `1' if
7153         it compiled with an error other than the one expected.
7154
7155 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7156
7157         * compiler.csproj: Updated for Visual Studio .NET 2003.
7158         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7159         * compiler.sln: Updated for Visual Studio .NET 2003.
7160
7161 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7162
7163         * expression.cs: Fix bug #47234. We basically need to apply the
7164         rule that we prefer the conversion of null to a reference type
7165         when faced with a conversion to 'object' (csc behaviour).
7166
7167 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7168
7169         * statement.cs: Shorter form for foreach, eliminates
7170         a local variable. r=Martin.
7171
7172 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7173
7174         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7175         checks if we can use brtrue/brfalse to test for 0.
7176         * expression.cs: use the above in the test for using brtrue/brfalse.
7177         cleanup code a bit.
7178
7179 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7180
7181         * expression.cs: Rewrite string concat stuff. Benefits:
7182
7183         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7184         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7185         rather than a concat chain.
7186
7187         * typemanager.cs: Add lookups for more concat overloads.
7188
7189 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7190
7191         * expression.cs: Emit shorter il code for array init.
7192
7193         newarr
7194         dup
7195         // set 1
7196
7197         // set 2
7198
7199         newarr
7200         stloc.x
7201
7202         ldloc.x
7203         // set 1
7204
7205         ldloc.x
7206         // set 2
7207
7208 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7209
7210         * statement.cs: Before, two switch blocks would be merged if the
7211         total size of the blocks (end_item - begin_item + 1) was less than
7212         two times the combined sizes of the blocks.
7213
7214         Now, it will only merge if after the merge at least half of the
7215         slots are filled.
7216
7217         fixes 55885.
7218
7219 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7220
7221         * class.cs : csc build fix for GetMethods(). See bug #52503.
7222
7223 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7224
7225         * expression.cs: Make sure fp comparisons work with NaN.
7226         This fixes bug #54303. Mig approved this patch a long
7227         time ago, but we were not able to test b/c the runtime
7228         had a related bug.
7229
7230 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7231
7232         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7233
7234 2004-03-19  Martin Baulig  <martin@ximian.com>
7235
7236         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7237         error here and not in our caller.
7238
7239 2004-03-19  Martin Baulig  <martin@ximian.com>
7240
7241         * interface.cs: Completely killed this file.
7242         (Interface): We're now a TypeContainer and live in class.cs.
7243
7244         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7245         argument; we're now also called for interfaces.
7246         (TypeContainer.DefineMembers): Allow this method being called
7247         multiple times.
7248         (TypeContainer.GetMethods): New public method; formerly known as
7249         Interface.GetMethod().  This is used by PendingImplementation.
7250         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7251         it's now private and non-static.
7252         (Interface): Moved this here; it's now implemented similar to
7253         Class and Struct.
7254         (Method, Property, Event, Indexer): Added `bool is_interface'
7255         argument to their .ctor's.
7256         (MemberBase.IsInterface): New public field.
7257
7258         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7259         instances instead of InterfaceMethod, InterfaceProperty, etc.
7260         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7261         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7262
7263 2004-03-19  Martin Baulig  <martin@ximian.com>
7264
7265         * class.cs (MethodCore.IsDuplicateImplementation): New private
7266         method which does the CS0111 checking.
7267         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7268         Use IsDuplicateImplementation().
7269
7270 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7271
7272         * decl.cs (FindMemberToOverride): New method to find the correct
7273         method or property to override in the base class.
7274         * class.cs
7275             - Make Method/Property use the above method to find the
7276               version in the base class.
7277             - Remove the InheritableMemberSignatureCompare as it is now
7278               dead code.
7279
7280         This patch makes large code bases much faster to compile, as it is
7281         O(n) rather than O(n^2) to do this validation.
7282
7283         Also, it fixes bug 52458 which is that nested classes are not
7284         taken into account when finding the base class member.
7285
7286         Reviewed/Approved by Martin.
7287
7288 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7289
7290         * interface.cs: In all interface classes removed redundant
7291         member initialization.
7292
7293 2004-03-16  Martin Baulig  <martin@ximian.com>
7294
7295         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7296
7297 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7298
7299         * decl.cs (DefineTypeAndParents): New helper method to define a
7300         type's containers before the type itself is defined;  This is a
7301         bug exposed by the recent changes to Windows.Forms when an
7302         implemented interface was defined inside a class that had not been
7303         built yet.   
7304
7305         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7306
7307         (Check): Loop correctly to report errors modifiers
7308         (UNSAFE was not in the loop, since it was the same as TOP).
7309
7310         * interface.cs: Every interface member now takes a ModFlags,
7311         instead of a "is_new" bool, which we set on the base MemberCore. 
7312
7313         Every place where we called "UnsafeOk" in the interface, now we
7314         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7315         the unsafe settings from the member declaration instead of the
7316         container interface. 
7317
7318         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7319
7320         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7321         `set_indexer_name' to the pending bits (one per type).
7322
7323         We fixed a bug today that was picking the wrong method to
7324         override, since for properties the existing InterfaceMethod code
7325         basically ignored the method name.  Now we make sure that the
7326         method name is one of the valid indexer names.
7327
7328 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7329  
7330         * support.cs (SeekableStreamReader): Keep track of stream byte
7331         positions and don't mix them with character offsets to the buffer.
7332
7333         Patch from Gustavo Giráldez
7334
7335 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7336
7337         * interface.cs (InterfaceSetGetBase): Removed double member
7338         initialization, base class does it as well.
7339
7340 2004-03-13  Martin Baulig  <martin@ximian.com>
7341
7342         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7343         when compiling corlib.
7344
7345 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7346
7347         * convert.cs (ExplicitConversion): We were reporting an error on
7348         certain conversions (object_type source to a value type, when the
7349         expression was `null') before we had a chance to pass it through
7350         the user defined conversions.
7351
7352         * driver.cs: Replace / and \ in resource specifications to dots.
7353         Fixes 50752
7354
7355         * class.cs: Add check for duplicate operators.  Fixes 52477
7356
7357 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7358
7359         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7360         that are in the middle of the statements, not only at the end.
7361         Fixes #54987
7362
7363         * class.cs (TypeContainer.AddField): No longer set the
7364         `HaveStaticConstructor' flag, now we call it
7365         `UserDefineStaticConstructor' to diferentiate the slightly
7366         semantic difference.
7367
7368         The situation is that we were not adding BeforeFieldInit (from
7369         Modifiers.TypeAttr) to classes that could have it.
7370         BeforeFieldInit should be set to classes that have no static
7371         constructor. 
7372
7373         See:
7374
7375         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7376
7377         And most importantly Zoltan's comment:
7378
7379         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7380
7381         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7382          before its static fields are used', i.e. initialization does not need
7383          to be triggered by the first access to the type. Setting this flag
7384          helps the JIT to compile better code, since it can run the static
7385          constructor at JIT time, and does not need to generate code to call it
7386          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7387          this flag for lots of classes like String. 
7388          
7389          csc sets this flag if the type does not have an explicit static 
7390          constructor. The reasoning seems to be that if there are only static
7391          initalizers for a type, and no static constructor, then the programmer
7392          does not care when this initialization happens, so beforefieldinit
7393          can be used.
7394          
7395          This bug prevents the AOT compiler from being usable, since it 
7396          generates so many calls to mono_runtime_class_init that the AOT code
7397          is much slower than the JITted code. The JITted code is faster, 
7398          because it does not generate these calls if the vtable is type is
7399          already initialized, which is true in the majority of cases. But the
7400          AOT compiler can't do this."
7401
7402 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7403
7404         * class.cs (MethodData.Emit): Refactor the code so symbolic
7405         information is generated for destructors;  For some reasons we
7406         were taking a code path that did not generate symbolic information
7407         before. 
7408
7409 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7410
7411         * class.cs: Create a Constructor.CheckBase method that
7412         takes care of all validation type code. The method
7413         contains some code that was moved from Define.
7414
7415         It also includes new code that checks for duplicate ctors.
7416         This fixes bug #55148.
7417
7418 2004-03-09  Joshua Tauberer <tauberer@for.net>
7419
7420         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7421         a { ... }-style array creation invokes EmitStaticInitializers
7422         which is not good for reference-type arrays.  String, decimal
7423         and now null constants (NullCast) are not counted toward
7424         static initializers.
7425
7426 2004-03-05  Martin Baulig  <martin@ximian.com>
7427
7428         * location.cs (SourceFile.HasLineDirective): New public field;
7429         specifies whether the file contains or is referenced by a "#line"
7430         directive.
7431         (Location.DefineSymbolDocuments): Ignore source files which
7432         either contain or are referenced by a "#line" directive.        
7433
7434 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7435
7436         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7437         direct access to our parent, so check the method inline there.
7438
7439 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7440
7441         * expression.cs (Invocation.EmitCall): Miguel's last commit
7442         caused a regression. If you had:
7443
7444             T t = null;
7445             t.Foo ();
7446
7447         In Foo the implict this would be null.
7448
7449 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7450
7451         * expression.cs (Invocation.EmitCall): If the method is not
7452         virtual, do not emit a CallVirt to it, use Call.
7453
7454         * typemanager.cs (GetFullNameSignature): Improve the method to
7455         cope with ".ctor" and replace it with the type name.
7456
7457         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7458         as an argument the ConstructorBuilder where it is being defined,
7459         to catch the recursive constructor invocations.
7460
7461 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7462
7463         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7464         routines to check if a type is an enumerable/enumerator allow
7465         classes that implement the IEnumerable or IEnumerator interfaces.
7466
7467         * class.cs (Property, Operator): Implement IIteratorContainer, and
7468         implement SetYields.
7469
7470         (Property.Define): Do the block swapping for get_methods in the
7471         context of iterators.   We need to check if Properties also
7472         include indexers or not.
7473
7474         (Operator): Assign the Block before invoking the
7475         OperatorMethod.Define, so we can trigger the Iterator code
7476         replacement. 
7477
7478         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7479         Property and Operator classes are not created when we parse the
7480         declarator but until we have the block completed, so we use a
7481         singleton SimpleIteratorContainer.Simple to flag whether the
7482         SetYields has been invoked.
7483
7484         We propagate this setting then to the Property or the Operator to
7485         allow the `yield' to function.
7486
7487 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7488
7489         * codegen.cs: Implemented attribute support for modules.
7490         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7491         Assembly/Module functionality.
7492
7493         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7494         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7495         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7496
7497 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7498
7499         * interface.cs (FindMembers): The operation is performed on all base
7500         interfaces and not only on the first. It is required for future CLS Compliance patch.
7501
7502 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7503
7504         * statement.cs, codegen.cs:
7505         This patch deals with patterns such as:
7506
7507         public class List : IEnumerable {
7508
7509                 public MyEnumerator GetEnumerator () {
7510                         return new MyEnumerator(this);
7511                 }
7512
7513                 IEnumerator IEnumerable.GetEnumerator () {
7514                         ...
7515                 }
7516                 
7517                 public struct MyEnumerator : IEnumerator {
7518                         ...
7519                 }
7520         }
7521
7522         Before, there were a few things we did wrong:
7523         1) we would emit callvirt on a struct, which is illegal
7524         2) we emited ldarg when we needed to emit ldarga
7525         3) we would mistakenly call the interface methods on an enumerator
7526         type that derived from IEnumerator and was in another assembly. For example:
7527
7528         public class MyEnumerator : IEnumerator
7529
7530         Would have the interface methods called, even if there were public impls of the
7531         method. In a struct, this lead to invalid IL code.
7532
7533 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7534
7535         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7536           renamed to Emit.
7537
7538         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7539
7540 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7541
7542         * cs-parser.jay: Fix small regression: we were not testing V2
7543         compiler features correctly.
7544
7545         * interface.cs: If the emit context is null, then create one
7546
7547 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7548
7549         * decl.cs (GetSignatureForError): New virtual method to get full name
7550           for error messages.
7551
7552         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7553           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7554
7555         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7556           Duplicated members and code in these classes has been removed.
7557           Better encapsulation in these classes.
7558
7559 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7560
7561         * assign.cs (Assign.DoResolve): When dealing with compound
7562         assignments, there is a new rule in ECMA C# 2.4 (might have been
7563         there before, but it is documented here) that states that in:
7564
7565         a op= b;
7566
7567         If b is of type int, and the `op' is a shift-operator, then the
7568         above is evaluated as:
7569
7570         a = (int) a op b 
7571
7572         * expression.cs (Binary.ResolveOperator): Instead of testing for
7573         int/uint/long/ulong, try to implicitly convert to any of those
7574         types and use that in pointer arithmetic.
7575
7576         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7577         method to print information for from the type, not from the
7578         null-method we were given.
7579
7580 2004-02-01  Duncan Mak  <duncan@ximian.com>
7581
7582         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7583         parsing for cmd, fixes bug #53694.
7584
7585 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7586
7587         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7588         in the member name duplication tests. Property and operator name duplication
7589         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7590
7591 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * interface.cs (PopulateMethod): Fixed crash when interface method
7594         returns not existing type (error test cs0246-3.cs).
7595
7596 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7597
7598         * cs-parser.jay (interface_accessors): Re-write actions to also
7599         store attributes attached to get and set methods. Fix spelling
7600         while at it.
7601
7602         (inteface_property_declaration): Modify accordingly.
7603
7604         (InterfaceAccessorInfo): New helper class to store information to pass
7605         around between rules that use interface_accessors.
7606
7607         * interface.cs (Emit): Apply attributes on the get and set
7608         accessors of properties and indexers too.
7609
7610         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7611         right MethodBuilder when applying attributes to the get and set accessors.
7612
7613 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7614
7615         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7616
7617 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7618
7619         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7620
7621 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7622
7623         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7624         changes that treat `yield' specially when present before `break'
7625         or `return' tokens.
7626
7627         * cs-tokenizer.cs: yield is no longer a keyword.
7628
7629 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7630
7631         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7632         setting for default constructors.
7633         For default constructors are almost every time set wrong Modifier. The
7634         generated IL code has been alright. But inside mcs this values was
7635         wrong and this was reason why several of my CLS Compliance tests
7636         failed.
7637
7638 2004-01-22  Martin Baulig  <martin@ximian.com>
7639
7640         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7641         not a QualifiedIdentifier.  This is what `type_name_expression'
7642         was previously doing.
7643         (type_name_expression): Removed; the code is now in
7644         `namespace_or_type_name'.
7645         (qualified_identifier): Removed, use `namespace_or_type_name'
7646         instead.
7647         (QualifiedIdentifier): Removed this class.      
7648
7649 2004-01-22  Martin Baulig  <martin@ximian.com>
7650
7651         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7652         not a string as alias name.
7653
7654 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7655
7656         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7657         #52730 bug, and instead compute correctly the need to use a
7658         temporary variable when requesting an address based on the
7659         static/instace modified of the field and the constructor.
7660  
7661 2004-01-21  Martin Baulig  <martin@ximian.com>
7662
7663         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7664         class and namespace before looking up aliases.  Fixes #52517.
7665
7666 2004-01-21  Martin Baulig  <martin@ximian.com>
7667
7668         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7669         assinged in a 'try'; fixes exception4.cs.
7670
7671 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7672         * class.cs : Implemented parameter-less constructor for TypeContainer
7673
7674         * decl.cs: Attributes are now stored here. New property OptAttributes
7675
7676         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7677
7678         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7679
7680 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7681
7682         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7683           (CSharpSignature): New method for indexer and property signature.
7684
7685 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7686
7687         * pending.cs (IsVirtualFilter): Faster implementation.
7688
7689 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7690
7691         * typemanager.cs: Avoid inclusion of same assembly more than once.
7692
7693 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7694
7695         * cs-parser.jay: Fixed problem where the last assembly attribute
7696           has been applied also to following declaration (class, struct, etc.)
7697           
7698 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7699
7700         * class.cs: Added error CS0538, CS0539 reporting.
7701         Fixed crash on Microsoft runtime when field type is void.
7702
7703         * cs-parser.jay: Added error CS0537 reporting.
7704
7705         * pending.cs: Added error CS0535 reporting.
7706         Improved error report for errors CS0536, CS0534.
7707
7708 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7709
7710         Merge a few bits from the Anonymous Method MCS tree.
7711
7712         * statement.cs (ToplevelBlock): New class for toplevel methods,
7713         will hold anonymous methods, lifted variables.
7714
7715         * cs-parser.jay: Create toplevel blocks for delegates and for
7716         regular blocks of code. 
7717
7718 2004-01-20  Martin Baulig  <martin@ximian.com>
7719
7720         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7721         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7722         and `NeedExplicitReturn'; added `IsLastStatement'.
7723         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7724         have a `ReturnLabel' or we're not unreachable.
7725
7726         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7727         child's reachability; don't just override ours with it.  Fixes
7728         #58058 (lluis's example).
7729         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7730         InFinally(), InLoop(), InSwitch() and
7731         BreakCrossesTryCatchBoundary() methods.
7732
7733         * statement.cs (Return): Do all error checking in Resolve().
7734         Unless we are the last statement in a top-level block, always
7735         create a return label and jump to it.
7736         (Break, Continue): Do all error checking in Resolve(); also make
7737         sure we aren't leaving a `finally'.
7738         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7739         statement in a top-level block.
7740         (Block.Flags): Added `IsDestructor'.
7741         (Block.IsDestructor): New public property.
7742
7743 2004-01-20  Martin Baulig  <martin@ximian.com>
7744
7745         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7746
7747 2004-01-20  Martin Baulig  <martin@ximian.com>
7748
7749         * statement.cs (Statement.ResolveUnreachable): New public method.
7750         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7751         (Block.Resolve): Resolve unreachable statements.
7752
7753 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7754
7755         * expression.cs: We need to fix the case where we do
7756         not have a temp variable here.
7757
7758         * assign.cs: Only expression compound assignments need
7759         temporary variables.
7760
7761 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7762
7763         * flowanalysis.cs: Reduce memory allocation in a few ways:
7764           - A block with no variables should not allocate a bit
7765             vector for itself.
7766           - A method with no out parameters does not need any tracking
7767             for assignment of the parameters, so we need not allocate
7768             any data for it.
7769           - The arrays:
7770                 public readonly Type[] VariableTypes;
7771                 public readonly string[] VariableNames;
7772             Are redundant. The data is already stored in the variable
7773             map, so we need not allocate another array for it.
7774           - We need to add alot of checks for if (params | locals) == null
7775             due to the first two changes.
7776
7777 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7778
7779         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7780         implement IMemoryLocation, we store a copy on a local variable and
7781         take the address of it.  Patch from Benjamin Jemlich
7782
7783         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7784         to use a special "type_name_expression" rule which reduces the
7785         number of "QualifiedIdentifier" classes created, and instead
7786         directly creates MemberAccess expressions.
7787
7788 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7789
7790         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7791         that fixes #52853.  Null literal assignment to ValueType
7792
7793         * class.cs (MethodData.Emit): Instead of checking the name of the
7794         method to determine if its a destructor, create a new derived
7795         class from Method called Destructor, and test for that.  
7796
7797         * cs-parser.jay: Create a Destructor object instead of a Method.  
7798
7799         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7800
7801         Fixes: 52933
7802
7803 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7804
7805         * expression.cs (Binary.ResolveOperator): Perform an implicit
7806         conversion from MethodGroups to their delegate types on the
7807         Addition operation.
7808
7809         * delegate.cs: Introduce a new class DelegateCreation that is the
7810         base class for `NewDelegate' and `ImplicitDelegateCreation',
7811         factor some code in here.
7812
7813         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7814         conversion from MethodGroups to compatible delegate types. 
7815
7816         * ecore.cs (Expression.Resolve): Do not flag error 654
7817         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7818         we allow conversions from MethodGroups to delegate types now.
7819
7820         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7821         assignments in v2 either.
7822
7823 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7824
7825         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7826         static read-only fields in ctors.
7827
7828         Applied patch from Benjamin Jemlich 
7829
7830         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7831
7832 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7833
7834         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7835         here to return true, as they can be used like this:
7836
7837                 (XXX) int.MEMBER ()
7838
7839         Fixed 49836 and all the other dups
7840
7841 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7842
7843         * driver.cs: Implement /win32res and /win32icon.
7844
7845 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7846
7847         * cs-parser.jay: Add a rule to improve error handling for the
7848         common mistake of placing modifiers after the type.
7849
7850 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7851
7852         * cs-parser.jay (interface_event_declaration): Catch
7853         initialization of events on interfaces, and report cs0068
7854
7855         * cs-parser.jay (interface_event_declaration): Catch
7856         initialization of events. 
7857
7858         * ecore.cs: Better report missing constructors.
7859
7860         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7861         the error reporting done in the wrong place.  Fix.
7862
7863         * expression.cs (Binary.ResolveOperator): Catch the 
7864         operator + (E x, E y) error earlier, and later allow for implicit
7865         conversions in operator +/- (E e, U x) from U to the underlying
7866         type of E.
7867
7868         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7869         52596, if the container class is abstract, the default constructor
7870         is protected otherwise its public (before, we were always public).
7871
7872         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7873         fixed statement.
7874
7875         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7876         Jemlich that fixes bug #52597, MCS was generating invalid code for
7877         idisposable structs.   Thanks to Ben for following up with this
7878         bug as well.
7879
7880 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7881
7882         * driver.cs: Allow assemblies without code to be generated, fixes
7883         52230.
7884
7885 2004-01-07  Nick Drochak <ndrochak@gol.com>
7886
7887         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7888
7889 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7890
7891         * cs-parser.jay: Add rules to improve error reporting if fields or
7892         methods are declared at the namespace level (error 116)
7893
7894         * Add rules to catch event add/remove
7895
7896 2004-01-04  David Sheldon <dave-mono@earth.li>
7897
7898   * expression.cs: Added matching ")" to error message for 
7899   CS0077
7900
7901 2004-01-03 Todd Berman <tberman@gentoo.org>
7902
7903         * ecore.cs, attribute.cs:
7904         Applying fix from #52429.
7905
7906 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7907
7908         * ecore.cs, expression.cs, statement.cs:
7909         Total rewrite of how we handle branching. We
7910         now handle complex boolean expressions with fewer
7911         jumps. As well if (x == 0) no longer emits a ceq.
7912
7913         if (x is Foo) is much faster now, because we generate
7914         better code.
7915
7916         Overall, we get a pretty big improvement on our benchmark
7917         tests. The code we generate is smaller and more readable.
7918
7919         I did a full two-stage bootstrap. The patch was reviewed
7920         by Martin and Miguel.
7921
7922 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7923
7924         * cs-parser.jay: Make primary_expression not take a QI.
7925         we dont need this because the member_access rule covers
7926         us here. So we replace the rule with just IDENTIFIER.
7927
7928         This has two good effects. First, we remove a s/r conflict.
7929         Second, we allocate many fewer QualifiedIdentifier objects.
7930
7931 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7932
7933         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7934         set the correct information via SRE. This prevents
7935         hanging on the MS runtime. Fixes #29374.
7936
7937 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7938
7939         * convert.cs: correctly handle conversions to value types
7940         from Enum and ValueType as unboxing conversions.
7941
7942         Fixes bug #52569. Patch by Benjamin Jemlich.
7943
7944 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7945
7946         * expression.cs (BetterConversion): Prefer int -> uint
7947         over int -> ulong (csc's behaviour). This fixed bug #52046.
7948
7949 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7950
7951         * decl.cs (MemberCache.FindMembers): now returns a
7952         MemberInfo [].
7953
7954         * typemanager.cs: In general, go with with ^^.
7955         (CopyNewMethods): take an IList.
7956         (RealMemberLookup): Only allocate an arraylist
7957         if we copy from two sets of methods.
7958
7959         This change basically does two things:
7960         1) Fewer array lists allocated due to CopyNewMethods.
7961         2) the explicit cast in MemberList costed ALOT.
7962
7963 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7964
7965         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7966         a hashtable to avoid needless string allocations when an identifier is
7967         used more than once (the common case).
7968
7969 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7970
7971         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7972         is broken, it will not return anything. So, we
7973         have to use the information we have in mcs to
7974         do the task.
7975
7976         * typemanager.cs: Add a cache for GetInterfaces,
7977         since this will now be used more often (due to ^^)
7978
7979         (GetExplicitInterfaces) New method that gets the
7980         declared, not effective, interfaces on a type
7981         builder (eg, if you have interface IFoo, interface
7982         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
7983         { IBar }.
7984
7985         This patch makes MCS able to bootstrap itself on
7986         Windows again.
7987
7988 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7989
7990         * expression.cs: Remove the Nop's that Miguel put
7991         in by mistake.
7992
7993 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7994
7995         * report.cs, codegen.cs: Give the real stack trace to
7996         the error when an exception is thrown.
7997
7998 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7999
8000         * decl.cs: only allocate hashtables for ifaces if 
8001         it is an iface!
8002
8003 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8004
8005         * expression.cs: fix the error from cs0121-2.cs
8006         (a parent interface has two child interfaces that
8007         have a function with the same name and 0 params
8008         and the function is called through the parent).
8009
8010 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8011
8012         * class.cs, rootcontext.cs, typmanager.cs: do not
8013         leak pointers.
8014
8015 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8016
8017         * codegen.cs: remove stack for the ec flow branching.
8018         It is already a linked list, so no need.
8019
8020 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8021
8022         * Makefile: Allow custom profiler here.
8023
8024 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8025
8026         * typemanager.cs (LookupType):
8027           - Use a static char [], because split takes
8028             a param array for args, so it was allocating
8029             every time.
8030           - Do not store true in a hashtable, it boxes.
8031
8032 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8033
8034         * flowanalysis.cs: bytify common enums.
8035
8036 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8037
8038         * modifiers.cs: Add a new set of flags for the
8039         flags allowed on explicit interface impls.
8040         * cs-parser.jay: catch the use of modifiers in
8041         interfaces correctly.
8042         * class.cs: catch private void IFoo.Blah ().
8043
8044         All related to bug #50572.
8045
8046 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8047
8048         * decl.cs: Rewrite the consistant accessability checking.
8049         Accessability is not linear, it must be implemented in
8050         a tableish way. Fixes #49704.
8051
8052 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8053
8054         * expression.cs: Handle negation in a checked context.
8055         We must use subtraction from zero. Fixes #38674.
8056
8057 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8058
8059         * class.cs: Ignore static void main in DLLs.
8060         * rootcontext.cs: Handle the target type here,
8061         since we are have to access it from class.cs
8062         * driver.cs: account for the above.
8063
8064 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8065
8066         * report.cs: Give line numbers and files if available.
8067
8068 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8069
8070         * driver.cs: Implement /addmodule.
8071
8072         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8073         ModuleBuilders.
8074
8075 2003-12-20  Martin Baulig  <martin@ximian.com>
8076
8077         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8078         (FieldBase.IsAssigned): Removed this field.
8079         (FieldBase.SetAssigned): New public method.
8080         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8081
8082 2003-12-20  Martin Baulig  <martin@ximian.com>
8083
8084         * expression.cs (LocalVariableReference.DoResolve): Don't set
8085         `vi.Used' if we're called from DoResolveLValue().
8086
8087         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8088         returns the usage vector it just merged into the current one -
8089         pass this one to UsageWarning().
8090         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8091         of the `EmitContext', don't call this recursively on our children.
8092
8093 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8094
8095         * driver.cs: Implement /target:module.
8096
8097 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8098
8099         * support.cs (CharArrayHashtable): New helper class.
8100
8101         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8102         char arrays, not strings, so we can avoid creating a string in
8103         consume_identifier if the identifier is a keyword.
8104
8105 2003-12-16  Martin Baulig  <martin@ximian.com>
8106
8107         * statement.cs (LocalInfo.Assigned): Removed this property.
8108         (LocalInfo.Flags): Removed `Assigned'.
8109         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8110         and uses flow analysis.
8111         (Block.UsageWarning): Made this method private.
8112         (Block.Resolve): Call UsageWarning() if appropriate.
8113
8114         * expression.cs (LocalVariableReference.DoResolve): Always set
8115         LocalInfo.Used here.
8116
8117 2003-12-13  Martin Baulig  <martin@ximian.com>
8118
8119         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8120         any value here; we're now using flow analysis to figure out
8121         whether a statement/block returns a value.
8122
8123 2003-12-13  Martin Baulig  <martin@ximian.com>
8124
8125         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8126         working again.
8127         (FlowBranching.MergeFinally): Don't call
8128         `branching.CheckOutParameters()' here, this is called in
8129         MergeTopBlock().
8130         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8131         when adding the `finally' vector.       
8132
8133 2003-12-13  Martin Baulig  <martin@ximian.com>
8134
8135         * flowanalysis.cs
8136         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8137         actually work and also fix #48962.
8138
8139 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8140
8141         * decl.cs: Do not check System.Object for nested types,
8142         since we know it does not have any. Big bang for buck:
8143
8144         BEFORE:
8145            Run 1:   8.35 seconds
8146            Run 2:   8.32 seconds
8147            corlib:  17.99 seconds
8148         AFTER:
8149            Run 1:   8.17 seconds
8150            Run 2:   8.17 seconds
8151            corlib:  17.39 seconds
8152
8153 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8154
8155         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8156         time we are returning 0 members, so we save alot here.
8157
8158 2003-12-11  Martin Baulig  <martin@ximian.com>
8159
8160         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8161         `MergeChild()', also just take the `FlowBranching' as argument;
8162         call Merge() on it and return the result.
8163         (FlowBranching.Merge): We don't need to do anything if we just
8164         have one sibling.
8165
8166 2003-12-11  Martin Baulig  <martin@ximian.com>
8167
8168         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8169         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8170         Maurer for this idea.
8171
8172 2003-12-11  Martin Baulig  <martin@ximian.com>
8173
8174         * flowanalysis.cs (MergeResult): This class is now gone; we now
8175         use the `UsageVector' for this.  The reason for this is that if a
8176         branching just has one sibling, we don't need to "merge" them at
8177         all - that's the next step to do.
8178         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8179         `MergeResult'.
8180
8181 2003-12-11  Martin Baulig  <martin@ximian.com>
8182
8183         Reworked flow analyis and made it more precise and bug-free.  The
8184         most important change is that we're now using a special `Reachability'
8185         class instead of having "magic" meanings of `FlowReturns'.  I'll
8186         do some more cleanups and optimizations and also add some more
8187         documentation this week.
8188
8189         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8190         largely reworked this class.
8191         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8192         the new `Reachability' class instead of having "magic" values here.
8193         (FlowBranching): We're now using an instance of `Reachability'
8194         instead of having separate `Returns', `Breaks' etc. fields.
8195
8196         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8197         based on flow analysis; ignore the return value of block.Emit ().
8198
8199 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8200
8201         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8202         if they are private.
8203
8204 2003-12-09  Martin Baulig  <martin@ximian.com>
8205
8206         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8207         call them directly on the UsageVector.
8208
8209 2003-12-09  Martin Baulig  <martin@ximian.com>
8210
8211         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8212         Changed return type from `FlowReturns' to `Reachability'.
8213
8214 2003-12-09  Martin Baulig  <martin@ximian.com>
8215
8216         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8217         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8218         `Reachable' fields with a single `Reachability' one.
8219
8220 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8221
8222         * class.cs (FindMembers): Remove foreach's.
8223
8224         Bootstrap times:
8225
8226         BEFORE
8227                 Run 1:   8.74 seconds
8228                 Run 2:   8.71 seconds
8229
8230         AFTER
8231                 Run 1:   8.64 seconds
8232                 Run 2:   8.58 seconds
8233
8234
8235 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8236
8237         * cs-parser.jay:
8238         * gen-treedump.cs:
8239         * statement.cs:
8240         This patch does a few things:
8241                 1. EmptyStatement is now a singleton, so it is never reallocated.
8242                 2. All blah is EmptyStatement constructs have been changed to
8243                    blah == EmptyStatement.Value, which is much faster and valid
8244                    now that EmptyStatement is a singleton.
8245                 3. When resolving a block, rather than allocating a new array for
8246                    the non-empty statements, empty statements are replaced with
8247                    EmptyStatement.Value
8248                 4. Some recursive functions have been made non-recursive.
8249         Mainly the performance impact is from (3), however (1) and (2) are needed for
8250         this to work. (4) does not make a big difference in normal situations, however
8251         it makes the profile look saner.
8252
8253         Bootstrap times:
8254
8255         BEFORE
8256         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8257         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8258         Total memory allocated: 56397 KB
8259
8260         AFTER
8261         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8262         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8263         Total memory allocated: 55666 KB
8264
8265 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8266
8267         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8268         than the hashtable in a hashtable version
8269
8270         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8271         we always end up concating a string. This results in a huge perf
8272         loss, because many strings have to be tracked by the GC. In this
8273         patch, we first use a hashtable that works with two keys, so that
8274         the strings do not need to be concat'ed.
8275
8276         Bootstrap times:
8277         BEFORE
8278                 Run 1:   8.74 seconds
8279                 Run 2:   8.71 seconds
8280
8281         AFTER
8282                 Run 1:   8.65 seconds
8283                 Run 2:   8.56 seconds
8284
8285 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8286
8287         * Makefile: Add a new target `do-time' that does a quick and simple
8288         profile, leaving easy to parse output.
8289
8290 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8291
8292         * codegen.cs (Init): Create the dynamic assembly with 
8293         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8294
8295 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8296
8297         * support.cs: Make the PtrHashtable use only one
8298         instance of its comparer.
8299
8300 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8301
8302         * typemanager.cs: Fix lookup of GetNamespaces.
8303
8304 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8305
8306         * expression.cs: Removed redundant line.
8307
8308         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8309         ArrayLists, use for loops with bounds.  
8310
8311         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8312         arraylist.
8313
8314         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8315         arraylists, use for loop with bounds.
8316
8317         The above three changes give us a 0.071 second performance
8318         improvement out of 3.294 seconds down to 3.223.  On my machine
8319         the above changes reduced the memory usage by 1,387 KB during
8320         compiler bootstrap.
8321
8322         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8323         QualifiedIdentifiers.  Before we created a new string through
8324         concatenation, and mostly later on, the result would be
8325         manipulated by DecomposeQI through string manipulation.
8326
8327         This reduced the compiler memory usage for bootstrapping from
8328         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8329         compile times in 0.05 seconds.
8330
8331 2003-11-28  Dick Porter  <dick@ximian.com>
8332
8333         * support.cs: Do string compares with the Invariant culture.
8334
8335         * rootcontext.cs: 
8336         * gen-treedump.cs: 
8337         * expression.cs: 
8338         * driver.cs: 
8339         * decl.cs: 
8340         * codegen.cs: 
8341         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8342         the comparison is done with the Invariant culture.
8343
8344 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8345
8346         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8347         GetEnumerator method.
8348
8349         (ProbeCollectionType): Iterate starting at the most specific type
8350         upwards looking for a GetEnumerator
8351
8352         * expression.cs: Shift count can be up to 31 for int/uint and 63
8353         for long/ulong.
8354
8355 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8356
8357         * statement.cs (Block.LookupLabel): Also look for the label on the
8358         children blocks.  Use a hash table to keep track of visited
8359         nodes. 
8360
8361         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8362         we actually did transform the other operand, otherwise fall back
8363         to the common codepath that casts to long.
8364
8365         * cs-tokenizer.cs: Use the same code pattern as the int case.
8366         Maybe I should do the parsing myself, and avoid depending on the
8367         Parse routines to get this done.
8368
8369 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8370
8371         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8372         which fixes bug 51347.  This time test it.
8373
8374         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8375         attributes for example can not tell the difference between these.
8376         The difference was only a syntax feature of the language. 
8377
8378         * attribute.cs: Apply attributes to delegates.
8379
8380         * delegate.cs: Call the apply attributes method.
8381
8382 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8383
8384         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8385         comparing 0 vs Byte.MinValue, not the value
8386
8387         (ImplicitConversionRequired): When reporting a conversion error,
8388         use error 31 to print out the constant error instead of the
8389         simpler 29.
8390
8391         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8392         which fixes bug 51347.
8393
8394 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8395
8396         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8397         which fixes the -warnaserror command line option.
8398
8399 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8400
8401         * cfold.cs (DoNumericPromotions): During constant folding of
8402         additions on UIntConstant, special case intconstants with
8403         IntConstants like we do on the expression binary operator. 
8404
8405 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8406
8407         * convert.cs (ImplicitReferenceConversion): We were missing a case
8408         (System.Enum are not value types or class types, so we need to
8409         classify them separatedly).
8410
8411         * driver.cs: We do not support error 2007.
8412
8413 2003-11-12 Jackson Harper <jackson@ximian.com>
8414
8415         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8416         system directory. Also use the full file name so users can
8417         libraries names mscorlib-o-tron.dll in a non system dir.
8418
8419 2003-11-10  Martin Baulig  <martin@ximian.com>
8420
8421         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8422         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8423         calling `ResolveType()' on them, directly assign their `Type'.
8424
8425 2003-11-08  Martin Baulig  <martin@ximian.com>
8426
8427         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8428         return value and the `out parent' parameter.
8429         (TypeContainer.DefineType): Moved the CS0644 check into
8430         GetClassBases().  Don't pass the interface types to the
8431         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8432         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8433
8434         * ecore.cs (TypeExpr.IsAttribute): New property.
8435         (TypeExpr.GetInterfaces): New method.
8436
8437         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8438         TypeExpr instead of a Type.
8439         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8440         (Interface.DefineType): Don't pass the interface types to the
8441         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8442         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8443
8444         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8445         instead of a `Type[]'.
8446         (TypeManager.RegisterBuilder): Likewise.
8447         (TypeManager.AddUserInterface): Likewise.
8448         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8449         `Type[]' and also return a `TypeExpr[]'.
8450         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8451
8452 2003-11-08  Martin Baulig  <martin@ximian.com>
8453
8454         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8455         Expression.     
8456
8457 2003-11-08  Martin Baulig  <martin@ximian.com>
8458
8459         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8460         TypeManager.ResolveExpressionTypes().
8461
8462         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8463         instead of an Expression.
8464         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8465         (TypeExpression): New public class; formerly known as `TypeExpr'.
8466
8467         * expression.cs (ComposedCast): Derive from TypeExpr.
8468
8469         * typemanager.cs (TypeManager.system_*_expr): These are now
8470         TypExpr's instead of Expression's.
8471         (TypeManager.ResolveExpressionTypes): New public static function;
8472         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8473         of them.        
8474
8475 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8476
8477         * expression.cs (New.DoResolve): Do not dereference value that
8478         might be a null return.
8479
8480         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8481         sure that the constant value has the right type.  Fixes an
8482         unreported bug, similar to 50425.
8483
8484         * const.cs (Const.LookupConstantValue): Call
8485         ImplicitStandardConversionExists before doing a conversion to
8486         avoid havng the TypeManager.ChangeType do conversions.
8487
8488         Reduced the number of casts used
8489
8490         (Const.ChangeType): New routine to enable reuse of the constant
8491         type changing code from statement.
8492
8493         * typemanager.cs (ChangeType): Move common initialization to
8494         static global variables.
8495
8496         Fixes #50425.
8497
8498         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8499         every value type to go through, even if it was void.  Fix that. 
8500
8501         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8502         character of the define, and the is_identifier_part_character for
8503         the rest of the string.
8504
8505 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8506
8507         * expression.cs (UnaryMutator.EmitCode): When I updated
8508         LocalVariableReference.DoResolve, I overdid it, and dropped an
8509         optimization done on local variable references.
8510
8511 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8512
8513         * ecore.cs: Convert the return from Ldlen into an int.
8514
8515 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8516
8517         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8518         the accessibility, this is a special case for toplevel non-public
8519         classes (internal for instance).
8520
8521 2003-10-20  Nick Drochak <ndrochak@gol.com>
8522
8523         * ecore.cs: Fix typo and build.  Needed another right paren.
8524
8525 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8526
8527         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8528         `internal' case regular and protected, but not allowing protected
8529         to be evaluated later.  Bug 49840
8530
8531 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8532
8533         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8534         to kb.Nlast, and not the kb.nFirst to isolate the switch
8535         statement.
8536
8537         Extract the underlying type, so enumerations of long/ulong are
8538         treated like long/ulong.
8539
8540 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8541
8542         * expression.cs (New): Overload the meaning of RequestedType to
8543         track the possible creation of the NewDelegate type, since
8544         DoResolve is invoked more than once for new constructors on field
8545         initialization.
8546
8547         See bugs: #48800 and #37014
8548
8549         * cs-parser.jay (declare_local_constants): Take an arraylist
8550         instead of a single constant.
8551
8552         (local_constant_declaration): It should take a
8553         constant_declarators, not a constant_declarator.  Fixes 49487
8554
8555         * convert.cs: Fix error report.
8556
8557 2003-10-13 Jackson Harper <jackson@ximian.com>
8558
8559         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8560         bug #49611
8561
8562 2003-10-09  Martin Baulig  <martin@ximian.com>
8563
8564         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8565         to the .ctor.
8566         (MethodCore.DoDefineParameters): Removed the TypeContainer
8567         argument; use the DeclSpace which was passed to the .ctor instead.
8568         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8569         TypeContainer; we only need a DeclSpace here.
8570
8571 2003-10-09  Martin Baulig  <martin@ximian.com>
8572
8573         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8574         to the .ctor.
8575         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8576         EmitContext's .ctor.    
8577
8578 2003-10-09  Martin Baulig  <martin@ximian.com>
8579
8580         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8581         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8582         AsAccessible(), moved them as well.
8583
8584         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8585
8586 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8587
8588         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8589
8590 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8591
8592         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8593         generation for >=, as spotted by Paolo, bug 48679.  
8594         Patch from David Waite.
8595
8596         * cs-tokenizer.cs: Add handling for #pragma.
8597
8598         * cs-parser.jay: Allow for both yield and yield return in the
8599         syntax.  The anti-cobolization of C# fight will go on!
8600
8601         * class.cs (TypeBuilder.DefineType): Catch error condition here
8602         (Parent.DefineType erroring out and returning null).
8603
8604         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8605         coping with enumerations variables, we were mistakenly processing
8606         them as a regular value type instead of built-in types.  Fixes the
8607         bug #48063
8608
8609         * typemanager.cs (IsBuiltinOrEnum): New method.
8610
8611 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8612
8613         * cs-parser.jay: Upgrade: yield now needs the return clause.
8614
8615 2003-09-19  Martin Baulig  <martin@ximian.com>
8616
8617         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8618         `MemberCache parent' argument.  Normally, an interface doesn't
8619         have a parent type except System.Object, but we use this in gmcs
8620         for generic type parameters.
8621
8622 2003-09-18  Martin Baulig  <martin@ximian.com>
8623
8624         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8625         on `type.IsInterface'; don't check whether the type has a parent
8626         to determine whether it's an interface.
8627
8628 2003-09-15  Martin Baulig  <martin@ximian.com>
8629
8630         * class.cs (TypeContainer.DefineType): Added an error flag to
8631         avoid reporting duplicate CS0146's ("class definition is
8632         circular.").
8633
8634         * driver.cs (Driver.MainDriver): Abort if
8635         RootContext.ResolveTree() reported any errors.
8636
8637 2003-09-07  Martin Baulig  <martin@ximian.com>
8638
8639         * report.cs (Error, Warning): Added overloaded versions which take
8640         a `params object[] args' and call String.Format().
8641
8642 2003-09-07  Martin Baulig  <martin@ximian.com>
8643
8644         * decl.cs (DeclSpace..ctor): Don't call
8645         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8646         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8647         (DeclSpace.RecordDecl): New method.
8648
8649         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8650
8651 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8652
8653         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8654         value attributes to be applied to ParameterBuilders.
8655
8656         * class.cs (MethodCore.LabelParameters): Make static and more
8657         generic so that it can be used from other places - like interface
8658         methods, for instance.
8659
8660         * interface.cs (Interface.Emit): Call LabelParameters before
8661         emitting attributes on the InterfaceMethod.
8662
8663 2003-08-26  Martin Baulig  <martin@ximian.com>
8664
8665         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8666         resolving aliases; fixes #47927.
8667
8668 2003-08-26  Martin Baulig  <martin@ximian.com>
8669
8670         * statement.cs (Using.DoResolve): This is internally emitting a
8671         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8672         do not always return.  Fixes #47681.
8673
8674 2003-08-26  Martin Baulig  <martin@ximian.com>
8675
8676         * decl.cs (MemberCore): Moved WarningNotHiding(),
8677         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8678         into MemberBase.
8679         (AdditionResult): Make this nested in DeclSpace.
8680         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8681         argument; call NamespaceEntry.Define() unless we're nested in a
8682         class or struct.
8683
8684         * namespace.cs (Namespace.DefineName): New public function.  This
8685         is called from DeclSpace's .ctor to add 
8686         (Namespace.Lookup): Include DeclSpaces in the lookup.
8687
8688         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8689
8690         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8691
8692 2003-08-25  Martin Baulig  <martin@ximian.com>
8693
8694         * convert.cs (Convert.ExplicitReferenceConversion): When
8695         converting from an interface type to a class, unbox if the target
8696         type is a struct type.  Fixes #47822.
8697
8698 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8699
8700         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8701         #47854.
8702
8703 2003-08-22  Martin Baulig  <martin@ximian.com>
8704
8705         * class.cs (TypeManager.DefineType): When defining a nested type,
8706         call DefineType() on our parent; fixes #47801.
8707
8708 2003-08-22  Martin Baulig  <martin@ximian.com>
8709
8710         * class.cs (MethodData.Define): While checking if a method is an
8711         interface implementation, improve the test a bit more to fix #47654.
8712
8713 2003-08-22  Martin Baulig  <martin@ximian.com>
8714
8715         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8716         correctly; fixes #47722.
8717
8718 2003-08-22  Martin Baulig  <martin@ximian.com>
8719
8720         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8721         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8722
8723         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8724
8725 2003-08-22  Martin Baulig  <martin@ximian.com>
8726
8727         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8728         can only be assigned in static constructors.  Fixes #47161.
8729
8730 2003-08-22  Martin Baulig  <martin@ximian.com>
8731
8732         Rewrote and improved the flow analysis code.
8733
8734         * flowbranching.cs (FlowBranching): Make this class abstract.
8735         (FlowBranching.CreateBranching): New static function to create a
8736         new flow branching.
8737         (FlowBranchingBlock, FlowBranchingException): New classes.
8738         (FlowBranching.UsageVector.Type): New public readonly field.
8739         (FlowBranching.UsageVector.Breaks): Removed the setter.
8740         (FlowBranching.UsageVector.Returns): Removed the setter.
8741         (FlowBranching.UsageVector): Added Break(), Return(),
8742         NeverReachable() and Throw() methods to modify the reachability.
8743         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8744         done by FlowBranching.Merge().
8745         (FlowBranching.UsageVector.MergeChild): New method; merges the
8746         merge result into the current vector.
8747         (FlowBranching.Merge): New abstract method to merge a branching.
8748
8749 2003-08-12  Martin Baulig  <martin@ximian.com>
8750
8751         * expression.cs (Indirection.CacheTemporaries): Create the
8752         LocalTemporary with the pointer type, not its element type.
8753
8754 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8755
8756         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8757         token was a keyword or not.
8758
8759         Add `error' options where an IDENTIFIER was expected;  Provide
8760         CheckToken and CheckIdentifierToken convenience error reporting
8761         functions. 
8762
8763         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8764
8765         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8766         NameSpaceEntry NameSpaceEntry.
8767
8768         (LookupInterfaceOrClass): Avoid creating a full qualified name
8769         from namespace and name: avoid doing lookups when we know the
8770         namespace is non-existant.   Use new Tree.LookupByNamespace which
8771         looks up DeclSpaces based on their namespace, name pair.
8772
8773         * driver.cs: Provide a new `parser verbose' to display the
8774         exception thrown during parsing.  This is turned off by default
8775         now, so the output of a failure from mcs is more graceful.
8776
8777         * namespace.cs: Track all the namespaces defined in a hashtable
8778         for quick lookup.
8779
8780         (IsNamespace): New method
8781
8782 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8783
8784         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8785         we know that we need to concatenate (full typename can never be
8786         null). 
8787
8788         * class.cs: ditto.
8789
8790         * statement.cs: Use a bitfield;  Do not initialize to null things
8791         which are done by the constructor by default.
8792
8793         * cs-parser.jay: bug fix, parameter was 4, not 3.
8794
8795         * expression.cs: Just use the property;
8796
8797         * statement.cs: No need for GetVariableInfo method.
8798
8799 2003-08-08  Martin Baulig  <martin@ximian.com>
8800
8801         * flowanalysis.cs (FlowReturns): This is now nested in the
8802         `FlowBranching' class.
8803         (MyBitVector): Moved this here from statement.cs.
8804         (FlowBranching.SiblingType): New enum type.
8805         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8806
8807 2003-08-07  Martin Baulig  <martin@ximian.com>
8808
8809         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8810         `FlowBranching' class and called `BranchingType'.
8811
8812 2003-08-07  Martin Baulig  <martin@ximian.com>
8813
8814         * flowanalysis.cs: Moved all the control flow analysis code into
8815         its own file.
8816
8817 2003-08-07  Martin Baulig  <martin@ximian.com>
8818
8819         * assign.cs (Assign.DoResolve): `target' must either be an
8820         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8821         #37319.
8822
8823 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8824
8825         * expression.cs (BinaryMethod): This kind of expression is created by the
8826         Binary class if it determines that the operator has to be handled
8827         by a method.
8828
8829         (BinaryDelegate): This kind of expression is created if we are
8830         dealing with a + or - operator on delegates.
8831
8832         (Binary): remove method, argumetns, and DelegateOperator: when
8833         dealing with methods, 
8834
8835         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8836
8837         * statement.cs (Block): use bitfields for the three extra booleans
8838         we had in use.   Remove unused topblock parameter.
8839
8840         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8841
8842         * assign.cs: Drop extra unneeded tests.
8843
8844 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8845
8846         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8847
8848         * statement.cs (Foreach): Use VariableStorage instead of
8849         LocalBuilders.   
8850
8851         * codegen.cs (VariableStorage): New class used by clients that
8852         require a variable stored: locals or fields for variables that
8853         need to live across yield.
8854
8855         Maybe provide a convenience api for EmitThis+EmitLoad?
8856
8857         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8858         these bad boys.
8859
8860 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8861
8862         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8863         RemapParameterLValue): New methods that are used to turn a
8864         precomputed FieldInfo into an expression like this:
8865
8866                 instance.FieldInfo
8867
8868         The idea is to use this instead of making LocalVariableReference
8869         have more than one meaning.
8870
8871         * cs-parser.jay: Add error production to BASE.
8872
8873         * ecore.cs: Deal with TypeManager.GetField returning null, which
8874         is now a valid return value.
8875
8876         (FieldExprNoAddress): New expression for Fields whose address can
8877         not be taken.
8878
8879         * expression.cs (LocalVariableReference): During the resolve
8880         phases, create new expressions if we are in a remapping context.
8881         Remove code that dealt with remapping here.
8882
8883         (ParameterReference): same.
8884
8885         (ProxyInstance): New expression, like the `This' expression, but
8886         it is born fully resolved.  We know what we are doing, so remove
8887         the errors that are targeted to user-provided uses of `this'.
8888
8889         * statement.cs (Foreach): our variable is now stored as an
8890         Expression;  During resolution, follow the protocol, dont just
8891         assume it will return this.
8892
8893 2003-08-06  Martin Baulig  <martin@ximian.com>
8894
8895         * support.cs (SeekableStreamReader.cs): New public class.
8896
8897         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8898         SeekableStreamReader instead of the normal StreamReader.
8899
8900 2003-08-04  Martin Baulig  <martin@ximian.com>
8901
8902         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8903         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8904         deambiguate casts and delegate invocations.
8905         (parenthesized_expression): Use the new tokens to ensure this is
8906         not a cast of method invocation.
8907
8908         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8909         when reading a `)' and Deambiguate_CloseParens () was previously
8910         called.
8911
8912         * expression.cs (ParenthesizedExpression): New class.  This is
8913         just used for the CS0075 test.
8914         (Binary.DoResolve): Check for CS0075.   
8915
8916 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8917
8918         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8919         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8920         reference comparison.
8921
8922         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8923         examine the ReturnType for equality - this is necessary in the
8924         cases of implicit and explicit operators whose signature also
8925         includes the return type.
8926
8927 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8928
8929         * namespace.cs: Cache the result of the namespace computation,
8930         instead of computing it every time.
8931
8932 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8933
8934         * decl.cs: Use a global arraylist that we reuse over invocations
8935         to avoid excesive memory consumption.  Reduces memory usage on an
8936         mcs compile by one meg (45 average).
8937
8938         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8939         private, work around that.
8940
8941 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8942
8943         * literal.cs (IntLiteral): Define Zero and One static literals. 
8944
8945         * cs-parser.jay (integer_literal): use static literals to reduce
8946         memory usage for the most used literals (0, 1 and -1).  211kb
8947         reduced in memory usage.
8948
8949         Replace all calls to `new ArrayList' with `new
8950         ArrayList(4)' which is a good average number for most allocations,
8951         and also requires only 16 bytes of memory for its buffer by
8952         default. 
8953
8954         This reduced MCS memory usage in seven megabytes for the RSS after
8955         bootstrapping.
8956
8957 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8958
8959         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8960         handle params methods the correct way by forming only one
8961         applicable set with params and normal methods in them. Earlier we
8962         were looking at params methods only if we found no normal methods
8963         which was not the correct thing to do.
8964
8965         (Invocation.BetterFunction): Take separate arguments indicating
8966         when candidate and the best method are params methods in their
8967         expanded form.
8968
8969         This fixes bugs #43367 and #46199.
8970
8971         * attribute.cs: Documentation updates.
8972
8973         (CheckAttribute): Rename to CheckAttributeTarget.
8974         (GetValidPlaces): Rename to GetValidTargets.
8975
8976         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8977         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8978
8979         Fixes bug #44468.
8980
8981 2003-07-28  Martin Baulig  <martin@ximian.com>
8982
8983         * class.cs (TypeContainer.DefineMembers): Use the base type's full
8984         name when looking up the base class of a nested class.  Fixes #46977.
8985
8986 2003-07-26  Martin Baulig  <martin@ximian.com>
8987
8988         * expression.cs (Indexers.Indexer): New nested struct; contains
8989         getter, setter and the indexer's type.
8990         (Indexers.Properties): This is now an ArrayList of
8991         Indexers.Indexer's.
8992         (IndexerAccess.DoResolveLValue): Correctly set the type if the
8993         indexer doesn't have any getters.
8994
8995         * assign.cs (Assign.DoResolve): Also do the implicit conversions
8996         for embedded property and indexer assignments.
8997
8998 2003-07-26  Martin Baulig  <martin@ximian.com>
8999
9000         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9001         preprocessor directive is not the first non-whitespace character
9002         on a line.
9003
9004 2003-07-26  Martin Baulig  <martin@ximian.com>
9005
9006         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9007         namespace parsing, follow the spec more closely.
9008
9009         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9010         NamespaceEntry.Lookup().
9011
9012 2003-07-25  Martin Baulig  <martin@ximian.com>
9013
9014         * MethodCore.cs (OverridesSomething): New public field; it's set
9015         from TypeContainer.DefineMembers if this method overrides
9016         something (which doesn't need to be a method).  Fix #39462.
9017
9018 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9019
9020         * typemanager.cs (GetMembers): Ensure that the list of members is
9021         reversed. This keeps things in sync.
9022
9023         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9024         find an AttributeUsage attribute.
9025
9026         * expression.cs (Invocation.OverloadResolve): Perform the check
9027         which disallows Invoke to be directly called on a Delegate.
9028
9029         (Error_InvokeOnDelegate): Report error cs1533.
9030
9031 2003-07-25  Martin Baulig  <martin@ximian.com>
9032
9033         * expression.cs (Indexers.GetIndexersForType): Only look in the
9034         interface hierarchy if the requested type is already an
9035         interface.  Fixes #46788 while keeping #46502 fixed.
9036
9037 2003-07-25  Martin Baulig  <martin@ximian.com>
9038
9039         * class.cs (TypeContainer.DefineMembers): Check whether all
9040         readonly fields have been assigned and report warning CS0649 if
9041         not.
9042
9043         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9044         a valuetype.
9045
9046 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9047
9048         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9049         returned from GetMethods to make things consistent with the
9050         assumptions MCS makes about ordering of methods.
9051
9052         This should comprehensively fix bug #45127 and it does :-)
9053
9054         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9055         ordering is actually reverse.
9056
9057         * Clean up some debug messages I left lying around.
9058
9059         * interface.cs (Populate*): Get rid of code which emits attributes
9060         since the stage in which we emit attributes is the 'Emit' stage,
9061         not the define stage.
9062
9063         (Emit): Move attribute emission for interface members here.
9064
9065 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9066
9067         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9068         closely: we eliminate methods in base types when we have an
9069         applicable method in a top-level type.
9070
9071         Please see section 14.5.5.1 for an exact description of what goes
9072         on. 
9073
9074         This fixes bug #45127 and a host of other related to corlib compilation.
9075
9076         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9077         array is the method corresponding to the top-level type (this is
9078         because of the changes made to icall.c) so we change this
9079         accordingly.
9080
9081         (MethodGroupExpr.Name): This too.
9082
9083         * typemanager.cs (GetElementType): New method which does the right
9084         thing when compiling corlib. 
9085
9086         * everywhere: Make use of the above in the relevant places.
9087
9088 2003-07-22  Martin Baulig  <martin@ximian.com>
9089
9090         * cs-parser.jay (invocation_expression): Moved
9091         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9092         `cast_expression', but create a InvocationOrCast which later
9093         resolves to either an Invocation or a Cast.
9094
9095         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9096         method; call this before EmitStatement() to make sure that this
9097         expression can be used as a statement.
9098
9099         * expression.cs (InvocationOrCast): New class; resolves to either
9100         an Invocation or a Cast.
9101
9102         * statement.cs (StatementExpression): Call ResolveStatement() on
9103         the ExpressionStatement before emitting it.
9104
9105 2003-07-21  Martin Baulig  <martin@ximian.com>
9106
9107         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9108         `ref' and `out' attributes match; fixes #46220.
9109         (MemberAccess.ResolveMemberAccess): You can't reference a type
9110         through an expression; fixes #33180.
9111         (Indexers.GetIndexersForType): Don't return the indexers from
9112         interfaces the class implements; fixes #46502.
9113
9114 2003-07-21  Martin Baulig  <martin@ximian.com>
9115
9116         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9117         CS0661 checks; fixes bug #30442.
9118
9119 2003-07-21  Martin Baulig  <martin@ximian.com>
9120
9121         * decl.cs (AdditionResult): Added `Error'.
9122
9123         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9124
9125         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9126         makes cs0031.cs actually work.
9127
9128 2003-07-20  Martin Baulig  <martin@ximian.com>
9129
9130         * namespace.cs: Fixed that bug which caused a crash when compiling
9131         the debugger's GUI.
9132
9133 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9134
9135         * typemanager.cs (LookupTypeReflection): Never expose types which
9136         are NotPublic, NestedPrivate, NestedAssembly, or
9137         NestedFamANDAssem.  We used to return these, and later do a check
9138         that would report a meaningful error, but the problem is that we
9139         would not get the real match, if there was a name override.
9140
9141 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9142
9143         * namespace.cs (Namespace, Name): Do not compute the namespace
9144         name dynamically, compute it in the constructor.  This reduced
9145         memory usage by 1697 KB.
9146
9147         * driver.cs: Use --pause to pause at the end.
9148
9149 2003-07-17  Peter Williams  <peter@newton.cx>
9150
9151         * Makefile: Change the name of the test target so that it doesn't
9152         conflict with the recursive test target.
9153
9154 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9155
9156         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9157         AddressOf): Do not use EmitThis, that was wrong, use the actual
9158         this pointer.
9159
9160 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9161
9162         * class.cs (MethodData.Define): While checking if a method is an
9163         interface implementation, improve the test: If we are not public
9164         (use new test here: use the computed MethodAttributes directly,
9165         instead of the parsed modifier flags) check if the `implementing'
9166         method comes from an interface or not.
9167
9168         * pending.cs (VerifyPendingMethods): Slightly better error
9169         message.
9170
9171         * makefile: add test target that does the mcs bootstrap.
9172
9173 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9174
9175         * interface.cs (Define): Do nothing here since there are no
9176         members to populate etc. Move the attribute emission out of here
9177         since this was just totally the wrong place to put it. Attribute
9178         application happens during the 'Emit' phase, not in the 'Define'
9179         phase.
9180
9181         (Emit): Add this method and move the attribute emission here
9182
9183         * rootcontext.cs (EmitCode): Call the Emit method on interface
9184         types too.
9185
9186 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9187
9188         * expression.cs (OverloadResolve): Report error only if Location
9189         is not 'Null' which means that there was a probe going on.
9190
9191 2003-07-14  Martin Baulig  <martin@ximian.com>
9192
9193         * expression.cs (ConditionalLogicalOperator): New public class to
9194         implement user defined conditional logical operators.
9195         This is section 14.11.2 in the spec and bug #40505.
9196
9197 2003-07-14  Martin Baulig  <martin@ximian.com>
9198
9199         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9200
9201 2003-07-14  Martin Baulig  <martin@ximian.com>
9202
9203         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9204
9205         * ecore.cs (IVariable.VerifyFixed): New interface method.
9206
9207         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9208         operator, check whether the variable is actually fixed.  Fixes bug
9209         #36055.  Set a variable definitely assigned when taking its
9210         address as required by the spec.
9211
9212         * statement.cs (LocalInfo.IsFixed): New field.
9213         (LocalInfo.MakePinned): Set `IsFixed' to true.
9214
9215 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9216
9217         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9218         for .ctors, ensure that we only ask for members declared in the
9219         attribute type (BindingFlags.DeclaredOnly).
9220
9221         Fixes bug #43632.
9222
9223         * expression.cs (Error_WrongNumArguments): Report error 1501
9224         correctly the way CSC does.
9225
9226 2003-07-13  Martin Baulig  <martin@ximian.com>
9227
9228         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9229         lookup on the fully qualified name, to make things like "X.X" work
9230         where "X.X" is a fully qualified type name, but we also have a
9231         namespace "X" in the using list.  Fixes #41975.
9232
9233 2003-07-13  Martin Baulig  <martin@ximian.com>
9234
9235         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9236         function. If we're a CompoundAssign, we need to create an embedded
9237         CompoundAssign, not an embedded Assign.
9238         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9239         Fixes #45854.
9240
9241 2003-07-13  Martin Baulig  <martin@ximian.com>
9242
9243         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9244         work to fix bug #46088.
9245
9246 2003-07-13  Ravi Pratap <ravi@ximian.com>
9247
9248         * class.cs (Operator.Emit): Do not emit attributes here - it is
9249         taken care of by the Method class that we delegate too. This takes
9250         care of bug #45876.
9251
9252 2003-07-10  Martin Baulig  <martin@ximian.com>
9253
9254         * expression.cs (TypeOfVoid): New class.
9255         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9256
9257 2003-07-10  Martin Baulig  <martin@ximian.com>
9258
9259         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9260         bug #35957.
9261
9262 2003-07-10  Martin Baulig  <martin@ximian.com>
9263
9264         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9265         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9266
9267         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9268
9269         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9270
9271 2003-07-10  Martin Baulig  <martin@ximian.com>
9272
9273         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9274         of decimal.  Fixes #42850.
9275
9276         NOTE: I also fixed the created byte blob, but this doesn't work on
9277         the MS runtime and csc never produces any byte blobs for decimal
9278         arrays.
9279
9280 2003-07-10  Martin Baulig  <martin@ximian.com>
9281
9282         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9283         structs; fixes #32068.
9284         (Block.AddChildVariableNames): Fixed #44302.
9285
9286 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9287
9288         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9289
9290 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9291
9292         * attribute.cs: And this test is onger needed.
9293
9294 2003-07-08  Martin Baulig  <martin@ximian.com>
9295
9296         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9297         inaccessible types.  Fixes #36313.
9298
9299         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9300
9301         * namespace.cs (NamespaceEntry): Create implicit entries for all
9302         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9303         implicit entries for N1.N2 and N1.
9304
9305 2003-07-08  Martin Baulig  <martin@ximian.com>
9306
9307         Rewrote the handling of namespaces to fix a lot of the issues
9308         wrt. `using' aliases etc.
9309
9310         * namespace.cs (Namespace): Splitted this class into a
9311         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9312
9313         * typemanager.cs (TypeManager.IsNamespace): Removed.
9314         (TypeManager.ComputeNamespaces): Only compute namespaces from
9315         loaded assemblies here, not the namespaces from the assembly we're
9316         currently compiling.
9317
9318 2003-07-08  Martin Baulig  <martin@ximian.com>
9319
9320         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9321
9322 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9323
9324         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9325         already fixed it.  
9326
9327         I thought about the memory savings here, but LookupTypeReflection
9328         is used under already very constrained scenarios.  Compiling
9329         corlib or mcs only exposes one hit, so it would not really reduce
9330         any memory consumption.
9331
9332 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9333
9334         * typemanager.cs: fixes bug #45889 by only adding public types from
9335         other assemblies to the list of known types.
9336
9337 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9338
9339         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9340         on the type we resolved.
9341
9342 2003-07-05  Martin Baulig  <martin@ximian.com>
9343
9344         * pending.cs (PendingImplementation.ParentImplements): Don't
9345         create the proxy if the parent is abstract.
9346
9347         * class.cs (TypeContainer.DefineIndexers): Process explicit
9348         interface implementations first.  Fixes #37714.
9349
9350 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9351
9352         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9353         defined recursively;  but since we modify the input parameters
9354         (left is set to `this' temporarily), we reset this value if the
9355         left_is_explicit is false, which gives the original semantics to
9356         the code.  
9357
9358         * literal.cs (NullPointer): new class used to represent a null
9359         literal in a pointer context.
9360
9361         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9362         type is a pointer, use a NullPointer object instead of a
9363         NullLiteral.   Closes 43687
9364
9365         (ExplicitConversion): Convert pointer values using
9366         the conv opcode to the proper type.
9367
9368         * ecore.cs (New): change ValueTypeVariable property into a method,
9369         that returns whether the valuetype is suitable for being used.
9370
9371         * expression.cs (Binary.DoNumericPromotions): Only return if we
9372         the int constant was a valid uint, and we can return both left and
9373         right as uints.  If not, we continue processing, to trigger the
9374         type conversion.  This fixes 39018.
9375
9376         * statement.cs (Block.EmitMeta): During constant resolution, set
9377         the CurrentBlock property on the emitcontext, so that we resolve
9378         constants propertly.
9379
9380 2003-07-02  Martin Baulig  <martin@ximian.com>
9381
9382         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9383         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9384
9385         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9386         than emitting it here.
9387
9388         * statement.cs: Fixed some more flow analysis bugs.
9389
9390 2003-07-02  Martin Baulig  <martin@ximian.com>
9391
9392         * class.cs (MethodData.Define): When implementing interface
9393         methods, set Final unless we're Virtual.
9394
9395         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9396         check work for interface methods.
9397
9398 2003-07-01  Martin Baulig  <martin@ximian.com>
9399
9400         * ecore.cs (EmitContext.This): Replaced this property with a
9401         GetThis() method which takes a Location argument.  This ensures
9402         that we get the correct error location for a CS0188.
9403
9404 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9405
9406         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9407         ImplicitStandardConversion.
9408
9409         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9410
9411 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9412
9413         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9414         optimization.
9415
9416 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9417
9418         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9419         constructors.
9420
9421         (MethodData.Define): Turn off initlocals for unsafe methods.
9422
9423 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9424
9425         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9426         complete;  Fixes #37521.
9427
9428         * delegate.cs: Use Modifiers.TypeAttr to compute the
9429         TypeAttributes, instead of rolling our own.  This makes the flags
9430         correct for the delegates.
9431
9432 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9433
9434         * class.cs (Constructor.Define): Set the private flag for static
9435         constructors as well.
9436
9437         * cs-parser.jay (statement_expression): Set the return value to
9438         null, to avoid a crash when we catch an error.
9439
9440 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9441
9442         * cs-parser.jay: Applied patch from Jackson that adds support for
9443         extern and unsafe modifiers to destructor declarations.
9444
9445         * expression.cs: Report error 21 if the user is trying to index a
9446         System.Array.
9447
9448         * driver.cs: Add an error message, suggested by the bug report.
9449
9450         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9451         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9452
9453 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9454
9455         * namespace.cs: Add some information to reduce FAQs.
9456
9457 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9458
9459         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9460         underlying enumeration types.  Fixes #43915.
9461
9462         * expression.cs: Treat ushort/short as legal values to be used in
9463         bitwise operations.
9464
9465 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9466
9467         * delegate.cs: transfer custom attributes for paramenters from
9468         the delegate declaration to Invoke and BeginInvoke.
9469
9470 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9471
9472         * attribute.cs: handle custom marshalers and emit marshal info
9473         for fields, too.
9474
9475 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9476
9477         * makefile.gnu: Added anonymous.cs to the compiler sources.
9478
9479 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9480
9481         * iterators.cs: Change the name of the proxy class to include two
9482         underscores.
9483
9484         * cs-parser.jay: Update grammar to include anonymous methods.
9485
9486         * anonymous.cs: new file.
9487
9488 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9489
9490         * class.cs (Field.Define): Add missing test for pointers and
9491         safety. 
9492
9493 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9494
9495         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9496         we use the stobj opcode.
9497
9498         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9499         since it wasn't the correct fix. 
9500
9501         It still is puzzling that we are required to use stobj for IntPtr
9502         which seems to be a ValueType.
9503
9504 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9505
9506         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9507         during regular simple name resolution.   Now, the trick is that
9508         instead of returning for processing the simplename, we do a
9509         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9510         contextual lookup type).   If a match is found, return that, if
9511         not, return for further composition.
9512
9513         This fixes long-standing 30485.
9514
9515         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9516         using the address to initialize an object, do an Stobj instead of
9517         using the regular Stelem.
9518
9519         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9520         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9521         Because if we are a BaseIndexerAccess that value will be true.
9522         Fixes 43643.
9523
9524         * statement.cs (GotoCase.Resolve): Return after reporting an
9525         error, do not attempt to continue. 
9526
9527         * expression.cs (PointerArithmetic.Emit): If our operand is a
9528         long, convert our constants to match the operand before
9529         multiplying.  Convert to I type before adding.   Fixes 43670.
9530
9531 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9532
9533         * enum.cs (ImplicitConversionExists) : Rename to
9534         ImplicitEnumConversionExists to remove ambiguity. 
9535
9536         * ecore.cs (NullCast): New type of cast expression class which
9537         basically is very similar to EmptyCast with the difference being
9538         it still is a constant since it is used only to cast a null to
9539         something else
9540         (eg. (string) null)
9541
9542         * convert.cs (ImplicitReferenceConversion): When casting a null
9543         literal, we return a NullCast.
9544
9545         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9546         should be around anymore.
9547
9548         The renaming (reported was slightly wrong). Corrections:
9549
9550         ConvertImplicitStandard -> ImplicitConversionStandard
9551         ConvertExplicitStandard -> ExplicitConversionStandard
9552
9553         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9554         before passing them in !
9555
9556         * convert.cs (ImplicitConversionStandard): When comparing for
9557         equal expr and target types, ensure that expr is not a
9558         NullLiteral.
9559
9560         In general, we must not be checking (expr_type ==
9561         target_type) in the top level conversion methods
9562         (ImplicitConversion, ExplicitConversion etc). This checking is
9563         done in the methods that they delegate to.
9564
9565 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9566
9567         * convert.cs: Move Error_CannotConvertType,
9568         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9569         ImplicitNumericConversion, ImplicitConversionExists,
9570         ImplicitUserConversionExists, StandardConversionExists,
9571         FindMostEncompassedType, FindMostSpecificSource,
9572         FindMostSpecificTarget, ImplicitUserConversion,
9573         ExplicitUserConversion, GetConversionOperators,
9574         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9575         TryImplicitIntConversion, Error_CannotConvertImplicit,
9576         ConvertImplicitRequired, ConvertNumericExplicit,
9577         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9578         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9579         its own file.
9580
9581         Perform the following renames:
9582
9583         StandardConversionExists -> ImplicitStandardConversionExists
9584         ConvertImplicit -> ImplicitConversion
9585         ConvertImplicitStandard -> ImplicitStandardConversion
9586         TryImplicitIntConversion -> ImplicitIntConversion
9587         ConvertImplicitRequired -> ImplicitConversionRequired
9588         ConvertNumericExplicit -> ExplicitNumericConversion
9589         ConvertReferenceExplicit -> ExplicitReferenceConversion
9590         ConvertExplicit -> ExplicitConversion
9591         ConvertExplicitStandard -> ExplicitStandardConversion
9592
9593 2003-05-19  Martin Baulig  <martin@ximian.com>
9594
9595         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9596         (TypeInfo): Added support for structs having structs as fields.
9597
9598         * ecore.cs (FieldExpr): Implement IVariable.
9599         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9600         VariableInfo for the field.
9601
9602 2003-05-18  Martin Baulig  <martin@ximian.com>
9603
9604         * expression.cs (This.DoResolve): Report a CS0027 if we're
9605         emitting a field initializer.
9606
9607 2003-05-18  Martin Baulig  <martin@ximian.com>
9608
9609         * expression.cs (This.ResolveBase): New public function.
9610         (This.DoResolve): Check for CS0188.
9611
9612         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9613         This.Resolve().
9614
9615         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9616         `instance_expression' to null if we don't have any non-static
9617         methods.
9618
9619 2003-05-18  Martin Baulig  <martin@ximian.com>
9620
9621         Reworked the way how local variables and parameters are handled by
9622         the flow analysis code.
9623
9624         * statement.cs (TypeInfo, VariableMap): New public classes.
9625         (VariableInfo): New public class.  This is now responsible for
9626         checking whether a variable has been assigned.  It is used for
9627         parameters and local variables.
9628         (Block.EmitMeta): Take the InternalParameters as argument; compute
9629         the layout of the flow vectors here.
9630         (Block.LocalMap, Block.ParameterMap): New public properties.
9631         (FlowBranching): The .ctor doesn't get the InternalParameters
9632         anymore since Block.EmitMeta() now computes the layout of the flow
9633         vector.
9634         (MyStructInfo): This class is now known as `StructInfo' and nested
9635         in `TypeInfo'; we don't access this directly anymore.
9636
9637         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9638         property and removed IsAssigned(), IsFieldAssigned(),
9639         SetAssigned() and SetFieldAssigned(); we now call them on the
9640         VariableInfo so we don't need to duplicate this code everywhere.
9641
9642         * expression.cs (ParameterReference): Added `Block block' argument
9643         to the .ctor.
9644         (LocalVariableReference, ParameterReference, This): The new
9645         VariableInfo class is now responsible for all the definite
9646         assignment stuff.
9647
9648         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9649         IsParameterAssigned, SetParameterAssigned): Removed.
9650
9651 2003-05-18  Martin Baulig  <martin@ximian.com>
9652
9653         * typemanager.cs (InitCoreTypes): Try calling
9654         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9655         the 3-args-version.  Corlib now also needs our `void_type'.
9656         (GetMethod): Added overloaded version which takes an optional
9657         `bool report_errors' to allow lookups of optional methods.
9658
9659 2003-05-12  Martin Baulig  <martin@ximian.com>
9660
9661         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9662         only used for locals and not for parameters.
9663
9664 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9665
9666         * support.cs (InternalParameters.ParameterType): Return the
9667         ExternalType of the parameter.
9668
9669         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9670         they were unused.
9671
9672 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9673
9674         * class.cs (MethodData.Define): Do not set the `newslot' on
9675         interface members, if they are also flagged as "override".
9676
9677         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9678         better code for ++i and i++.  This only works for static fields
9679         and local variables.
9680
9681         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9682         want to pull the DeclSpace out of the builder_to_declspace instead
9683         of the TypeBuilder (like in TypeContainer.FindMembers).
9684
9685         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9686         instead of LookupTypeContainer.  Fixes the crash on .NET for
9687         looking up interface members.
9688
9689         * const.cs: Create our own emit context during the Definition
9690         stage, so that constants are evaluated in the proper context, when
9691         a recursive definition happens.
9692
9693 2003-05-11  Martin Baulig  <martin@ximian.com>
9694
9695         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9696         new block for a switch section.
9697         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9698         the adding/lookup in the switch block.  Fixes #39828.
9699
9700 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9701
9702         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9703         functionality: I needed to convert the data after I had performed
9704         the add/sub operation into the operands type size.
9705
9706         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9707         pass the type for the box operation, otherwise the resulting
9708         object would have been of type object.
9709
9710         (BoxedCast): Add constructor to specify the type to box as.
9711
9712 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9713
9714         * iterators.cs: I was reusing the `count' variable inadvertently,
9715         take steps to not allow this to happen.
9716
9717 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9718
9719         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9720         by creating an array at the point where the params starts and
9721         putting all those arguments there, then adjusting the size of the
9722         array.
9723
9724 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9725
9726         * expression.cs (New.AddressOf): Implement interface
9727         IMemoryLocation.  This is used when the `new' operator is used in
9728         the context of an invocation to a method on a value type.
9729
9730         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9731         example. 
9732
9733         * namespace.cs: Also check the using aliases here.
9734
9735         * driver.cs: Move the test for using validity after the types have
9736         been entered, so we do a single pass that also includes the using
9737         aliases. 
9738
9739         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9740         in the regular case.   CreateSiblingForFinally is doing extra
9741         error checking.
9742
9743         * attribute.cs (GetAttributeArgumentExpression): Store the result
9744         on an out value, and use the return value to indicate failure
9745         instead of using null (which is a valid return for Constant.GetValue).
9746
9747         * statement.cs: Perform the analysis flow for the increment
9748         portion after the statement, because this will be the real flow of
9749         execution.  Fixes #42385
9750
9751         * codegen.cs (EmitContext.EmitArgument,
9752         EmitContext.EmitStoreArgument): New helper functions when the
9753         RemapToProxy flag is set.
9754
9755         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9756         function.
9757
9758         Add support for remapping parameters. 
9759
9760         * iterators.cs: Propagate parameter values;  Store parameter
9761         values in the proxy classes.
9762
9763 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9764
9765         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9766         need a proxy reference;  I do not know what I was thinking
9767
9768         * cs-parser.jay (constructor_initializer): catch another error,
9769         and display nice message.
9770
9771         (field_declaration): catch void field declaration
9772         to flag a better error. 
9773
9774         * class.cs (MemberBase.CheckBase): Report an error instead of a
9775         warning if a new protected member is declared in a struct. 
9776         (Field.Define): catch the error of readonly/volatile.
9777
9778         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9779
9780         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9781         volatile variable is taken
9782
9783 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9784
9785         * statement.cs (Fixed.Resolve): Report an error if we are not in
9786         an unsafe context.
9787
9788 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9789
9790         * typemanager.cs: reuse the code that handles type clashes for
9791         delegates and enumerations.
9792
9793         * class.cs (Report28): Always report.
9794
9795         * expression.cs (EncodeAsAttribute): Allow nulls here.
9796
9797 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9798
9799         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9800         the functionality for testing whether an expression is valid for
9801         an attribute here.  Also handle the case of arrays of elements
9802         being stored. 
9803
9804         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9805         encoding a linear array into an array of objects that are suitable
9806         to be passed to an CustomAttributeBuilder.
9807
9808         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9809
9810         * ecore.cs: (FieldExpr): Handle field remapping here.
9811
9812         * iteratators.cs: Pass the instance variable (if the method is an
9813         instance method) to the constructors, so we can access the field
9814         variables on the class.
9815
9816         TODO: Test this with structs.  I think the THIS variable on
9817         structs might have to be a pointer, and not a refenrece
9818
9819 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9820
9821         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9822         local variables to fields in a proxy class.
9823
9824         * iterators.cs (PopulateProxy): Rename our internal fields to
9825         <XXX>.  
9826         Create a <THIS> field if we are an instance method, so we can
9827         reference our parent container variables.
9828         (MapVariable): Called back from the EmitContext code to enter a
9829         new variable to field mapping into the proxy class (we just create
9830         a FieldBuilder).
9831
9832         * expression.cs
9833         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9834         for using the remapped locals to fields.
9835
9836         I placed the code here, because that gives the same semantics to
9837         local variables, and only changes the Emit code.
9838
9839         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9840         statements inside iterators.
9841         (VariableInfo): Add a FieldBuilder for the cases when we are
9842         remapping local variables to fields in a proxy class
9843
9844         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9845         current_block != null.
9846
9847         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9848         not cope with strings, as it has been moved to the
9849         TableSwitchEmit.  Fixed bug in switch generation.
9850
9851         * expression.cs (New.DoResolve): Provide more context for the user
9852         when reporting an error.
9853
9854         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9855         pointers. 
9856
9857         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9858         check the permissions for it.  Note than in a type-resolution
9859         context the check was already present in DeclSpace.ResolveType,
9860         but was missing from the MemberAccess.
9861
9862         (ArrayCreation.CheckIndices): warn if the user has
9863         more nested levels of expressions, but there are no more
9864         dimensions specified.  Avoids crash on bug 41906.
9865
9866 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9867
9868         * statement.cs (Block): replace Implicit bool, for a generic
9869         flags.   
9870         New flag: `Unchecked'.  This is used during the EmitMeta phase
9871         (which is out-of-line with the regular Resolve/Emit process for a
9872         statement, as this is done ahead of time, but still gets a chance
9873         to call constant resolve).
9874
9875         (Block.Flags): new enum for adding a new flag.
9876
9877         (Block.EmitMeta): track the state of unchecked.
9878
9879         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9880         to enable constant resolution to work there as well.
9881
9882 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9883
9884         * typemanager.cs (ienumerable_type): Also look up
9885         System.Collections.IEnumerable. 
9886
9887 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9888
9889         TODO: Test more than one conditional per method.
9890
9891         * class.cs (Indexer.Define): Report the location where the user is
9892         referencing the unsupported feature.
9893
9894         (MethodData): Overload the use of `conditionals' to
9895         minimize the creation of needless ArrayLists.   This saves roughly
9896         212kb on my machine.
9897
9898         (Method): Implement the new IIteratorContainer interface.
9899         (Method.SetYields): Implement the method by setting the ModFlags
9900         to contain METHOD_YIELDS.
9901
9902         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9903         which just got set to null.
9904
9905         * iterators.cs: New file.
9906
9907         (Yield, YieldBreak): New statements.
9908
9909         * statement.cs (Return.Resolve): Flag an error if we are used in
9910         an iterator method.
9911
9912         * codegen.cs (InIterator): New flag set if the code is being
9913         compiled in an iterator method.
9914
9915         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9916         internal modifier, and we just use it to avoid adding extra
9917         fields, as this is seldom used.  
9918
9919         * cs-parser.jay: Add yield_statement (yield and yield break).
9920
9921         * driver.cs: New flag -v2 to turn on version 2 features. 
9922
9923         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9924         hashtable when v2 is enabled.
9925
9926 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9927
9928         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9929         there is already a namespace defined with this name.
9930
9931         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9932         people upgraded their corlibs.
9933
9934         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9935         always use fully qualified types, no need to use the compiler
9936         front end.
9937
9938         (TypeManager.IsNamespace): Use binarysearch.
9939
9940         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9941         AddDelegate): I did not quite use the new IsValid API properly: I
9942         have to pass the short-name and the fullname.  I was passing only
9943         the basename instead of the fullname sometimes. 
9944
9945         (TypeContainer.DefineType): call NamespaceClash.
9946
9947         * interface.cs (Interface.DefineType): use NamespaceClash before
9948         defining the type.
9949
9950         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9951         defining the type.
9952
9953         * enum.cs: (Enum.DefineType): use NamespaceClash before
9954         defining the type.
9955
9956         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9957         speed increase.  First, use the negative_hits cache when we get a
9958         negative.  Second, add the type with its full original name
9959         instead of the new . and + encoded name (reflection uses + to
9960         separate type from a nested type).  Use LookupTypeReflection
9961         directly which bypasses the type->name hashtable (that we already
9962         know does not contain the type.
9963
9964         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9965         location/container type. 
9966
9967         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9968
9969 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9970
9971         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9972
9973         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9974         method is being referenced in the method group from a static
9975         context, and report error 120 if so.
9976
9977         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9978         Error118. 
9979
9980         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9981         is created, we create the A namespace).
9982
9983         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9984         Fixes #41591
9985
9986 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9987
9988         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9989         invocation to ModuleBuilder.GetType with the same values will
9990         return a new type instance, so we need to cache its return
9991         values. 
9992
9993         * expression.cs (Binary.ResolveOperator): Only allow the compare
9994         operators on enums if they are of the same type.
9995
9996         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9997         types of ValueType on their own case.  Before we were giving them
9998         the same treatment as objects.
9999
10000         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10001         fullname.  Short name is used to compare against container name.
10002         Fullname is used to check against defined namespace names.
10003
10004         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10005         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10006
10007         (Method.CheckBase): Call parent.
10008         (MemberBase.CheckBase): Check for protected members on sealed
10009         classes.
10010         (PropertyBase.CheckBase): Call parent.
10011         (Field.Define): Call parent.
10012
10013         * report.cs: Negative error codes are now mapped to 8000 - code,
10014         so that the display is render more nicely.
10015
10016         * typemanager.cs: Do not use try/catch, instead report a regular
10017         error. 
10018
10019         (GetPointerType, GetReferenceType): These methods provide
10020         mechanisms to obtain the T* and T& from a T.  We had the code
10021         previously scattered around the code base, and it also used
10022         TypeManager.LookupType that would go through plenty of caches.
10023         This one goes directly to the type source.
10024
10025         In some places we did the Type.GetType followed by
10026         ModuleBuilder.GetType, but not in others, so this unifies the
10027         processing as well.
10028
10029         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10030         statements now that we have namespace information.
10031
10032         * typemanager.cs (IsNamespace): New method, returns whether the
10033         string presented is a namespace or not.
10034
10035         (ComputeNamespaces): New public entry point, computes the list of
10036         available namespaces, using the GetNamespaces API call in Mono, or
10037         the slower version in MS.NET.   
10038
10039         Now before we start the semantic analysis phase, we have a
10040         complete list of namespaces including everything that the user has
10041         provided.
10042
10043         Deleted old code to cache namespaces in .nsc files.
10044
10045 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10046
10047         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10048         class/struct location definition Location for the implicit
10049         constructor location.
10050
10051         (Operator.Define): Use the location of the operator for the
10052         implicit Method definition.
10053
10054         (Constructor.Emit): use the constructor location for the implicit
10055         base initializer constructor.
10056
10057         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10058         and the Expression class now contains two new methods:
10059
10060         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10061         isolate type lookup from the rest of the resolution process.
10062
10063         Since we use Expressions to hold type definitions due to the way
10064         we parse the input we have historically overloaded Resolve to
10065         perform the Type lookups if a special flag is passed.  Now this is
10066         eliminated and two methods take their place. 
10067
10068         The differences in the two methods between xStep and xTerminal is
10069         that xStep is involved in our current lookup system that uses
10070         SimpleNames to compose a name, while xTerminal is used just to
10071         catch the case where the simplename lookup failed.
10072
10073 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10074
10075         * expression.cs (ResolveMemberAccess): Remove redundant code.
10076         TypeExpr expressions are always born fully resolved.
10077
10078         * interface.cs (PopulateMethod): Do not lookup the types twice.
10079         We were doing it once during SemanticAnalysis and once during
10080         PopulateMethod.
10081
10082         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10083         in local variable type definitions, were being returned as a
10084         SimpleName (we decomposed everything into a string), that is
10085         because primary_expression was being used instead of a type in the
10086         grammar (reduce/reduce conflicts).
10087
10088         The part that was wrong is that we converted the expression into a
10089         string (an oversimplification in one hand, compounded with primary
10090         expressions doing string concatenation).
10091
10092         So things like:
10093
10094         A.B.C [] x;
10095
10096         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10097         using clauses from working on this particular context.  And a type
10098         was being matched directly against "A.B.C[]".
10099
10100         We now use the correct approach, and allow for ComposedCast to be
10101         part of the unary expression.  So the "A.B.C []" become a composed
10102         cast of "A.B.C" (as a nested group of MemberAccess with a
10103         SimpleName at the end) plus the rank composition "[]". 
10104
10105         Also fixes 35567
10106
10107 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10108
10109         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10110         for the access level checking.
10111
10112         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10113         `TypeContainer container', because I kept getting confused when I
10114         was debugging this code.
10115
10116         * expression.cs (Indexers): Instead of tracking getters/setters,
10117         we now track them in parallel.  We create one arraylist less, but
10118         most importantly it is possible now for the LValue code to find a
10119         matching get for a set.
10120
10121         (IndexerAccess.DoResolveLValue): Update the code.
10122         GetIndexersForType has been modified already to extract all the
10123         indexers from a type.  The code assumed it did not.
10124
10125         Also make the code set the correct return type for the indexer.
10126         This was fixed a long time ago for properties, but was missing for
10127         indexers.  It used to be void_type.
10128
10129         (Binary.Emit): Test first for doubles instead of
10130         floats, as they are more common.
10131
10132         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10133         when dealing with floats and the <=, >= operators.  This fixes bug
10134         #39314 
10135
10136         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10137         to load the array value by emitting a load on the foreach variable
10138         type.  This was incorrect.  
10139
10140         We now emit the code to load an element using the the array
10141         variable type, and then we emit the conversion operator.
10142
10143         Fixed #40176
10144
10145 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10146
10147         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10148
10149 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10150
10151         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10152         test for protection before we test for signatures. 
10153
10154         (MethodSignature.ToString): implement.
10155
10156         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10157         to the case where we reduced into a LongConstant.
10158
10159         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10160         depend on whether the information is acurrate, because the
10161         Microsoft runtime will always claim that the array type is public,
10162         regardless of the real state.
10163
10164         If the type is a pointer, another problem happens: the type is
10165         reported as non-public in Microsoft.  
10166
10167         In both cases we have to call CheckAccessLevel recursively with
10168         the underlying type as the argument to be tested.
10169
10170 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10171
10172         * assign.cs (Assign.Emit): If we are dealing with a compound
10173         assignment expression, we should use the code path that stores the
10174         intermediate result in a temporary value.  This fixes #40903.
10175
10176         *expression.cs (Indirection.ToString): Provide ToString method for
10177         debugging. 
10178
10179 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10180
10181         * class.cs: Null out fields holding references to Block objects so
10182         they can be garbage collected.
10183
10184         * expression.cs (OverloadResolve): Remove unused local.
10185
10186 2003-04-07  Martin Baulig  <martin@ximian.com>
10187
10188         * codegen.cs (EmitContext.CurrentFile): New public field.
10189         (EmitContext.Mark): Use the CurrentFile to check whether the
10190         location is in the correct file.
10191         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10192
10193 2003-04-07  Martin Baulig  <martin@ximian.com>
10194
10195         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10196
10197         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10198         location.  [FIXME: The location argument which gets passed to this
10199         method is sometimes wrong!]
10200
10201 2003-04-07  Nick Drochak <ndrochak@gol.com>
10202
10203         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10204
10205 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10206
10207         * expression.cs (Indirection.EmitAssign): We were using the
10208         temporary, but returning immediately instead of continuing the
10209         EmitAssing flow.
10210
10211 2003-04-06  Martin Baulig  <martin@ximian.com>
10212
10213         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10214         if it's a nested child, but also deriving from the outer class.
10215         See test 190.cs.
10216
10217         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10218         nested child, but also deriving from the outer class.  See
10219         test-190.cs.
10220         (FilterWithClosure): We may access private members of the outer
10221         class if we're a nested child and deriving from the outer class.
10222         (RealMemberLookup): Only set `closure_private_ok' if the
10223         `original_bf' contained BindingFlags.NonPublic.
10224
10225 2003-04-05  Martin Baulig  <martin@ximian.com>
10226
10227         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10228
10229 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10230
10231         * class.cs (Event.Define): Do not allow abstract events to have
10232         initializers. 
10233
10234 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10235
10236         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10237         block in event declarations.
10238
10239         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10240         value type, get its address.
10241
10242         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10243         leaving a class on the stack instead of a boolean value (int
10244         0/1).  Change the code so we compare against null, and then the
10245         result against zero.
10246
10247         * class.cs (TypeContainer.GetClassBases): We were checking for the
10248         parent class being sealed too late.
10249
10250         * expression.cs (Binary.Emit): For <= and >= when dealing with
10251         floating point values, use cgt.un and clt.un instead of cgt and
10252         clt alone.
10253
10254 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10255
10256         * statement.cs: Apply the same optimization as MS: skip the 
10257         GetEnumerator returning an IEnumerator, and use the one returning a 
10258         CharEnumerator instead. This allows us to avoid the try-finally block 
10259         and the boxing.
10260
10261 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10262
10263         * cs-parser.jay: Attributes cannot be applied to
10264                          namespaces. Fixes #40473
10265
10266 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10267
10268         * class.cs:
10269         (Add*): check if the name is valid using the full name for constants,
10270         fields, properties and events.
10271
10272 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10273
10274         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10275         char constants to be part of the enumeration.
10276
10277         * expression.cs (Conditional.DoResolve): Add support for operator
10278         true. Implements the missing functionality from 14.12
10279
10280         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10281         operator true/false as required by the spec.
10282
10283         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10284         implicit conversion to boolean.
10285
10286         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10287         also one where the type implements `operator true'. 
10288
10289         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10290         get an expression that will invoke operator true based on an
10291         expression.  
10292
10293         (GetConversionOperators): Removed the hack that called op_True
10294         here.  
10295
10296         (Expression.ResolveBoolean): Move this from Statement.
10297
10298 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10299
10300         * ecore.cs (FieldExpr): do not allow initialization of initonly
10301         fields on derived classes
10302
10303 2003-03-13  Martin Baulig  <martin@ximian.com>
10304
10305         * statement.cs (Block.Emit): Call ig.BeginScope() and
10306         ig.EndScope() when compiling with debugging info; call
10307         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10308
10309 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10310
10311         * expression.cs (Indexers): Do not construct immediately, allow
10312         for new members to be appended as we go.  Fixes 38143
10313
10314 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10315
10316         * expression.cs: save/restore context when resolving an unchecked
10317         expression.
10318
10319 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10320
10321         * cfold.cs: Catch division by zero in modulus operator during
10322         constant folding.
10323
10324 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10325
10326         * interface.cs (Interface.DefineMembers): Avoid defining members
10327         twice. 
10328
10329 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10330
10331         * driver.cs: handle the +/- options for -noconfig
10332
10333         * statement.cs (Unckeched.Resolve): Also track the state of
10334         unchecked in the Resolve phase.
10335
10336 2003-02-27  Martin Baulig  <martin@ximian.com>
10337
10338         * ecore.cs (Expression.MemberLookup): Don't create a
10339         MethodGroupExpr for something which is not a method.  Fixes #38291.
10340
10341 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10342
10343         * class.cs (MemberBase.CheckParameters): Also check that the type
10344         is unmanaged if it is a pointer.
10345
10346         * expression.cs (SizeOf.Resolve): Add location information.
10347
10348         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10349         a managed type is declared.
10350
10351         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10352         parameter modifiers as well.  Fixes bug 38606
10353
10354         * class.cs: Very sad.  Am backing out the speed up changes
10355         introduced by the ArrayList -> Array in the TypeContainer, as they
10356         were not actually that much faster, and introduced a bug (no error
10357         reports on duplicated methods).
10358
10359         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10360         source first, this will guarantee that we have a valid expression
10361         before calling in lower levels functions that will require a
10362         resolved object.  Then use this original_source in the
10363         target.ResolveLValue instead of the original source that was
10364         passed to us.
10365
10366         Another change.  Use target.Resolve instead of LValueResolve.
10367         Although we are resolving for LValues, we will let the Assign code
10368         take care of that (it will be called again from Resolve).  This
10369         basically allows code like this:
10370
10371         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10372         class Y { void A (X x) { x [0] += o; }
10373
10374         The problem was that the indexer was trying to resolve for
10375         set_Item (idx, object o) and never finding one.  The real set_Item
10376         was set_Item (idx, X).  By delaying the process we get the right
10377         semantics. 
10378
10379         Fixes bug 36505
10380
10381 2003-02-23  Martin Baulig  <martin@ximian.com>
10382
10383         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10384         while calling DoEmit ().
10385
10386         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10387         source files; if you use the #line directive inside a method, the
10388         compiler stops emitting line numbers for the debugger until it
10389         reaches the end of the method or another #line directive which
10390         restores the original file.
10391
10392 2003-02-23  Martin Baulig  <martin@ximian.com>
10393
10394         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10395
10396 2003-02-23  Martin Baulig  <martin@ximian.com>
10397
10398         * statement.cs (Block.AddChildVariableNames): We need to call this
10399         recursively, not just for our immediate children.
10400
10401 2003-02-23  Martin Baulig  <martin@ximian.com>
10402
10403         * class.cs (Event.Define): Always make the field private, like csc does.
10404
10405         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10406         actually work, fixes bug #37521.
10407
10408 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10409
10410         * delegate.cs: When creating the various temporary "Parameters"
10411         classes, make sure that we call the ComputeAndDefineParameterTypes
10412         on those new parameters (just like we do with the formal ones), to
10413         allow them to be resolved in the context of the DeclSpace.
10414
10415         This fixes the bug that Dick observed in Bugzilla #38530.
10416
10417 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10418
10419         * expression.cs (ResolveMemberAccess): When resolving a constant,
10420         do not attempt to pull a constant if the value was not able to
10421         generate a valid constant.
10422
10423         * const.cs (LookupConstantValue): Do not report more errors than required.
10424
10425 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10426
10427         * expression.cs: fixes bug #38328.
10428
10429 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10430
10431         * class.cs: Changed all the various members that can be part of a
10432         class from being an ArrayList to be an Array of the right type.
10433         During the DefineType type_list, interface_list, delegate_list and
10434         enum_list are turned into types, interfaces, delegates and enums
10435         arrays.  
10436
10437         And during the member population, indexer_list, event_list,
10438         constant_list, field_list, instance_constructor_list, method_list,
10439         operator_list and property_list are turned into their real arrays.
10440
10441         Although we could probably perform this operation earlier, for
10442         good error reporting we need to keep the lists and remove the
10443         lists for longer than required.
10444
10445         This optimization was triggered by Paolo profiling the compiler
10446         speed on the output of `gen-sample-program.pl' perl script. 
10447
10448         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10449         not crash in methods like MemberLookupFailed that use this field.  
10450
10451         This problem arises when the compiler fails to resolve a type
10452         during interface type definition for example.
10453
10454 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10455
10456         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10457         inherit from System.Object, so we have to stop at null, not only
10458         when reaching System.Object.
10459
10460 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10461
10462         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10463         DeclaredOnly because the parent indexer might have had a different
10464         name, but did not loop until the top of the hierarchy was reached.
10465
10466         The problem this one fixes is 35492: when a class implemented an
10467         indexer from an interface, we were getting the interface method
10468         (which was abstract) and we were flagging an error (can not invoke
10469         abstract method).
10470
10471         This also keeps bug 33089 functioning, and test-148 functioning.
10472
10473         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10474         out if a method is special is to see if it is declared in a
10475         property or event, or whether it is one of the predefined operator
10476         names.   This should fix correctly #36804.
10477
10478 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10479
10480         The goal here is to remove the dependency on EmptyCast.Peel ().
10481         Killing it completely.
10482
10483         The problem is that currently in a number of places where
10484         constants are expected, we have to "probe" for an EmptyCast, and
10485         Peel, which is not the correct thing to do, as this will be
10486         repetitive and will likely lead to errors. 
10487
10488         The idea is to remove any EmptyCasts that are used in casts that
10489         can be reduced to constants, so we only have to cope with
10490         constants. 
10491
10492         This bug hunt was triggered by Bug 37363 and the desire to remove
10493         the duplicate pattern where we were "peeling" emptycasts to check
10494         whether they were constants.  Now constants will always be
10495         constants.
10496
10497         * ecore.cs: Use an enumconstant here instead of wrapping with
10498         EmptyCast.  
10499
10500         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10501         throwing me off.  By handling this we can get rid of a few hacks.
10502
10503         * statement.cs (Switch): Removed Peel() code.
10504
10505 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10506
10507         * class.cs: Location information for error 508
10508
10509         * expression.cs (New.DoResolve): Add a guard against double
10510         resolution of an expression.  
10511
10512         The New DoResolve might be called twice when initializing field
10513         expressions (see EmitFieldInitializers, the call to
10514         GetInitializerExpression will perform a resolve on the expression,
10515         and later the assign will trigger another resolution
10516
10517         This leads to bugs (#37014)
10518
10519         * delegate.cs: The signature for EndInvoke should contain any ref
10520         or out parameters as well.  We were not doing this in the past. 
10521
10522         * class.cs (Field.Define): Do not overwrite the type definition
10523         inside the `volatile' group.  Turns out that volatile enumerations
10524         were changing the type here to perform a validity test, which
10525         broke conversions. 
10526
10527 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10530         and structs, we do not want to load the instance variable
10531
10532         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10533         enum_type has to be handled like an object reference (implicit
10534         conversions exists from this to object), but the regular IsClass
10535         and IsValueType tests will never return true for this one.
10536
10537         Also we use TypeManager.IsValueType instead of type.IsValueType,
10538         just for consistency with the rest of the code (this is only
10539         needed if we ever use the construct exposed by test-180.cs inside
10540         corlib, which we dont today).
10541
10542 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10543
10544         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10545         just InternalCall.
10546
10547 2003-02-09  Martin Baulig  <martin@ximian.com>
10548
10549         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10550         (Namespace.DefineNamespaces): New static public method; this is
10551         called when we're compiling with debugging to add all namespaces
10552         to the symbol file.
10553
10554         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10555         pass it to the Namespace's .ctor.
10556
10557         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10558         and MethodBase arguments; pass the namespace ID to the symwriter;
10559         pass the MethodBase instead of the token to the symwriter.
10560         (SymbolWriter.DefineNamespace): New method to add a namespace to
10561         the symbol file.
10562
10563 2003-02-09  Martin Baulig  <martin@ximian.com>
10564
10565         * symbolwriter.cs: New file.  This is a wrapper around
10566         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10567         methods here in near future.
10568
10569 2003-02-09  Martin Baulig  <martin@ximian.com>
10570
10571         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10572         ILGenerator.MarkSequencePoint() which are actually used by the
10573         symbol writer.
10574
10575 2003-02-09  Martin Baulig  <martin@ximian.com>
10576
10577         * location.cs (SourceFile): New public sealed class.  This
10578         contains the name and an index which is used in the location's token.
10579         (Location): Reserve an appropriate number of bits in the token for
10580         the source file instead of walking over that list, this gives us a
10581         really huge performance improvement when compiling with debugging.
10582
10583         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10584         `SourceFile' argument instead of a string.
10585         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10586         but don't parse/tokenize here, we need to generate the list of all
10587         source files before we do that.
10588         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10589         the files.
10590
10591         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10592         instead of a string.
10593
10594         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10595         of a string.
10596
10597 2003-02-09  Martin Baulig  <martin@ximian.com>
10598
10599         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10600         filename on `#line default'.
10601
10602 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10603
10604         * statement.cs: don't clear the pinned var when the fixed statement
10605         returns from the method (fixes bug#37752).
10606
10607 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10608
10609         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10610         to IsValueType.
10611
10612 2003-02-07  Martin Baulig  <martin@ximian.com>
10613
10614         * driver.cs: Removed the `--debug-args' command line argument.
10615
10616         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10617         automatically by the AsssemblyBuilder.
10618         (CodeGen.InitializeSymbolWriter): We don't need to call any
10619         initialization function on the symbol writer anymore.  This method
10620         doesn't take any arguments.
10621
10622 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10623
10624         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10625         from referenced assemblies as well.
10626
10627 2003-02-02  Martin Baulig  <martin@ximian.com>
10628
10629         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10630
10631 2003-02-02  Martin Baulig  <martin@ximian.com>
10632
10633         * class.cs (Constructor.Emit): Open the symbol writer before
10634         emitting the constructor initializer.
10635         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10636         single-stepping through constructor initializers.
10637
10638 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10639
10640         * class.cs: Handle error 549: do not allow virtual methods in
10641         sealed classes. 
10642
10643 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10644
10645         * decl.cs: Check access levels when resolving types
10646
10647 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10648
10649         * statement.cs: Add parameters and locals set in catch blocks that might 
10650         return to set vector
10651
10652 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10653
10654         * class.cs (Operator): Set the SpecialName flags for operators.
10655
10656         * expression.cs (Invocation.DoResolve): Only block calls to
10657         accessors and operators on SpecialName methods.
10658
10659         (Cast.TryReduce): Handle conversions from char constants.
10660
10661
10662 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10663
10664         * statement.cs: small memory and time optimization in FlowBranching.
10665
10666 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10667
10668         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10669         problem that the last fix but in the other sid (Set).
10670
10671         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10672         access when there is no indexer in the hierarchy.
10673
10674 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10675
10676         * class.cs: Combine some if statements.
10677
10678 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10679
10680         * driver.cs: fixed bug #37187.
10681
10682 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10683
10684         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10685         any indexer, it's needed to build a list with all the indexers in the
10686         hierarchy (AllGetters), else we have problems. Fixes #35653.
10687
10688 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10689
10690         * class.cs (MethodData.Define): It is wrong for an interface
10691         implementation to be static in both cases: explicit and implicit.
10692         We were only handling this in one case.
10693
10694         Improve the if situation there to not have negations.
10695
10696         * class.cs (Field.Define): Turns out that we do not need to check
10697         the unsafe bit on field definition, only on usage.  Remove the test.
10698
10699 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10700
10701         * driver.cs: use assembly.Location instead of Codebase (the latest
10702         patch made mcs fail when using MS assemblies).
10703
10704 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10705
10706         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10707         get the path to *corlib.dll.
10708
10709 2003-01-21  Nick Drochak <ndrochak@gol.com>
10710
10711         * cs-tokenizer.cs:
10712         * pending.cs:
10713         * typemanager.cs: Remove compiler warnings
10714
10715 2003-01-20  Duncan Mak  <duncan@ximian.com>
10716
10717         * AssemblyInfo.cs: Bump the version number to 0.19.
10718
10719 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10720
10721         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10722
10723 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10724
10725         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10726
10727 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10728
10729         * cs-parser.jay: Small fix: we were not comparing the constructor
10730         name correctly.   Thanks to Zoltan for the initial pointer.
10731
10732 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10733
10734         * cs-tokenizer.cs: Set file name when specified with #line
10735
10736 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10737
10738         * cs-parser.jay: Only perform the constructor checks here if we
10739         are named like the class;  This will help provider a better
10740         error.  The constructor path is taken when a type definition is
10741         not found, but most likely the user forgot to add the type, so
10742         report that rather than the constructor error.
10743
10744 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10745
10746         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10747         allocations.
10748
10749 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10750
10751         * cs-parser.jay: Add cleanup call.
10752
10753 2003-01-13  Duncan Mak  <duncan@ximian.com>
10754
10755         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10756         consistent with other methods.
10757
10758 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10759
10760         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10761
10762 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10763
10764         * attribute.cs: only set GuidAttr to true when we have a
10765         GuidAttribute.
10766
10767 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10768
10769         * ecore.cs:
10770         * expression.cs:
10771         * typemanager.cs: fixes to allow mcs compile corlib with the new
10772         Type.IsSubclassOf fix.
10773
10774 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * expression.cs (LocalVariableReference.DoResolve): Classify a
10777         constant as a value, not as a variable.   Also, set the type for
10778         the variable.
10779
10780         * cs-parser.jay (fixed_statement): take a type instead of a
10781         pointer_type, so we can produce a better error message later.
10782
10783         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10784         as an error.  
10785
10786         (For.DoEmit): Make inifinite loops have a
10787         non-conditional branch back.
10788
10789         (Fixed.DoEmit): First populate the pinned variables, then emit the
10790         statement, then clear the variables.  Before I was emitting the
10791         code once for each fixed piece.
10792
10793
10794 2003-01-08  Martin Baulig  <martin@ximian.com>
10795
10796         * statement.cs (FlowBranching.MergeChild): A break in a
10797         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10798
10799 2003-01-08  Martin Baulig  <martin@ximian.com>
10800
10801         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10802         lives in the same number space than `param_map'.  Fixes #36154.
10803
10804 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10805
10806         * cs-parser.jay (constructor_declaration): Set the
10807         Constructor.ModFlags before probing for it.  This makes the
10808         compiler report 514, 515 and 132 (the code was there, but got
10809         broken). 
10810
10811         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10812         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10813         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10814
10815 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10816
10817         * enum.cs: create the enum static fields using the enum type.
10818
10819 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10820
10821         * class.cs: don't try to create the ParamBuilder for the return
10822         type if it's not needed (and handle it breaking for the ms runtime
10823         anyway).
10824
10825 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10826
10827         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10828
10829 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10830
10831         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10832         the command.   This showed up while compiling the JANET source
10833         code, which used \r as its only newline separator.
10834
10835 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10836
10837         * class.cs (Method.Define): If we are an operator (because it
10838         reuses our code), then set the SpecialName and HideBySig.  #36128
10839
10840 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10841
10842         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10843         exception, report error 120 `object reference required'.
10844
10845         * driver.cs: Add --pause option, used during to measure the size
10846         of the process as it goes with --timestamp.
10847
10848         * expression.cs (Invocation.DoResolve): Do not allow methods with
10849         SpecialName to be invoked.
10850
10851 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10852
10853         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10854         number before adding it.
10855
10856 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10857
10858         * ecore.cs (StandardImplicitConversion): When in an unsafe
10859         context, we allow conversion between void * to any other pointer
10860         type. This fixes bug #35973.
10861
10862 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10863
10864         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10865         is not thrown when extensionless outputs are used 
10866
10867 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10868
10869         * rootcontext.cs: fixed compilation of corlib.
10870
10871 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10872
10873         * attribute.cs (Attributes.Contains): Add new method.
10874
10875         * class.cs (MethodCore.LabelParameters): if the parameter is an
10876         `out' parameter, check that no attribute `[In]' has been passed.
10877
10878         * enum.cs: Handle the `value__' name in an enumeration.
10879
10880 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10881
10882         * decl.cs: Added special case to allow overrides on "protected
10883         internal" methods
10884
10885 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10886
10887         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10888         since it makes much more sense.
10889
10890         (Attributes.ctor): Don't require a Location parameter.
10891
10892         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10893
10894         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10895         since we already have that information per attribute.
10896
10897         * everywhere : make appropriate changes.
10898
10899         * class.cs (LabelParameters): Write the code which actually
10900         applies attributes to the return type. We can't do this on the MS
10901         .NET runtime so we flag a warning in the case an exception is
10902         thrown.
10903
10904 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10905
10906         * const.cs: Handle implicit null conversions here too.
10907
10908 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10909
10910         * class.cs (MethodCore.LabelParameters): Remove the extra
10911         Type [] parameter since it is completely unnecessary. Instead
10912         pass in the method's attributes so that we can extract
10913         the "return" attribute.
10914
10915 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10916
10917         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10918         of ignoring it and letting the compile continue.
10919
10920         * typemanager.cs (ChangeType): use an extra argument to return an
10921         error condition instead of throwing an exception.
10922
10923 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10924
10925         * expression.cs (Unary.TryReduce): mimic the code for the regular
10926         code path.  Perform an implicit cast in the cases where we can
10927         implicitly convert to one of the integral types, and then reduce
10928         based on that constant.   This fixes bug #35483.
10929
10930 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10931
10932         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10933
10934 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10935
10936         * namespace.cs: fixed bug #35489.
10937
10938 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10939
10940         * class.cs: Remove some dead code.
10941
10942         * cs-parser.jay: Estimate the number of methods needed
10943         (RootContext.MethodCount);
10944
10945         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10946         numbers instead of StringBuilders.
10947
10948         * support.cs (PtrHashtable): Add constructor with initial size;
10949         We can now reduce reallocations of the method table.
10950
10951 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10952
10953         * attribute.cs (ApplyAttributes): Keep track of the emitted
10954         attributes on a per-target basis. This fixes bug #35413.
10955
10956 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10957
10958         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10959         default to the Windows 1252 encoding.
10960
10961         (UnixParseOption): Support version, thanks to Alp for the missing
10962         pointer. 
10963
10964         * AssemblyInfo.cs: Add nice assembly information.
10965
10966         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10967         (bug 35169).
10968
10969         * cs-parser.jay: Allow a trailing comma before the close bracked
10970         in the attribute_section production.
10971
10972         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10973         address of the instance was being taken, I will take this out,
10974         because we take the address of the object immediately here.
10975
10976 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10977
10978         * typemanager.cs (AreMultipleAllowed): Take care of the most
10979         obvious case where attribute type is not in the current assembly -
10980         stupid me ;-)
10981
10982 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10983
10984         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10985         definitions, instead of doing that afterwards.  
10986
10987         Also we use a nice little hack, depending on the constructor, we
10988         know if we are a "composed" name or a simple name.  Hence, we
10989         avoid the IndexOf test, and we avoid 
10990
10991         * codegen.cs: Add code to assist in a bug reporter to track down
10992         the source of a compiler crash. 
10993
10994 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10995
10996         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10997         types have been emitted for a given element and flag an error
10998         if something which does not have AllowMultiple set is used more
10999         than once.
11000
11001         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11002         attribute types and their corresponding AllowMultiple properties
11003
11004         (AreMultipleAllowed): Check the property for a given type.
11005
11006         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11007         property in the case we have a TypeContainer.
11008
11009         (Attributes.AddAttribute): Detect duplicates and just skip on
11010         adding them. This trivial fix catches a pretty gross error in our
11011         attribute emission - global attributes were being emitted twice!
11012
11013         Bugzilla bug #33187 is now fixed.
11014
11015 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11016
11017         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11018         instead of pp_and).
11019
11020         * expression.cs (Binary.ResolveOperator): I can only use the
11021         Concat (string, string, string) and Concat (string, string,
11022         string, string) if the child is actually a concatenation of
11023         strings. 
11024
11025 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11026
11027         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11028         context where we need a 2-character lookahead.
11029
11030         * pending.cs (PendingImplementation): Rework so we can keep track
11031         of interface types all the time, and flag those which were
11032         implemented by parents as optional.
11033
11034 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11035
11036         * expression.cs (Binary.ResolveOperator): Use
11037         String.Concat(string,string,string) or
11038         String.Concat(string,string,string,string) when possible. 
11039
11040         * typemanager: More helper methods.
11041
11042
11043 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11044
11045         * pending.cs: remove the bogus return from GetMissingInterfaces()
11046         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11047
11048 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11049
11050         * namespace.cs: avoid duplicated 'using xxx' being added to
11051         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11052         when we get more than one 'using' statement for the same namespace.
11053         Report a CS0105 warning for it.
11054
11055 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11056
11057         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11058         of calling getChar/putback, uses internal knowledge of it.    
11059
11060         (xtoken): Reorder tokenizer so most common patterns are checked
11061         first.  This reduces the compilation time in another 5% (from 8.11s
11062         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11063
11064         The parsing time is 22% of the compilation in mcs, and from that
11065         64% is spent on the tokenization process.  
11066
11067         I tried using a binary search for keywords, but this is slower
11068         than the hashtable.  Another option would be to do a couple of
11069         things:
11070
11071                 * Not use a StringBuilder, instead use an array of chars,
11072                   with a set value.  Notice that this way we could catch
11073                   the 645 error without having to do it *afterwards*.
11074
11075                 * We could write a hand-parser to avoid the hashtable
11076                   compares altogether.
11077
11078         The identifier consumption process takes 37% of the tokenization
11079         time.  Another 15% is spent on is_number.  56% of the time spent
11080         on is_number is spent on Int64.Parse:
11081
11082                 * We could probably choose based on the string length to
11083                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11084                   computations. 
11085
11086         Another 3% is spend on wrapping `xtoken' in the `token' function.
11087
11088         Handle 0xa0 as whitespace (#34752)
11089
11090 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11091
11092         * typemanager.cs (IsCLRType): New routine to tell whether a type
11093         is one of the builtin types.  
11094
11095         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11096         typecode in more places instead of doing pointer comparissions.
11097         We could leverage some knowledge about the way the typecodes are
11098         laid out.
11099
11100         New code to cache namespaces in assemblies, it is currently not
11101         invoked, to be used soon.
11102
11103         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11104
11105         * expression.cs (Binary.ResolveOperator): specially handle
11106         strings, and do not perform user-defined operator overloading for
11107         built-in types.
11108
11109 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11110
11111         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11112         internalcall as it is a pretty simple operation;  Avoid whenever
11113         possible to call Char.IsLetter.
11114
11115         (consume_identifier): Cut by half the number of
11116         hashtable calls by merging the is_keyword and GetKeyword behavior.
11117
11118         Do not short-circuit, because if we do, we
11119         report errors (ie, #if false && true would produce an invalid
11120         directive error);
11121
11122
11123 2002-11-24  Martin Baulig  <martin@ximian.com>
11124
11125         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11126         check constant ranges and report a CS0221.  Fixes #33186.
11127
11128 2002-11-24  Martin Baulig  <martin@ximian.com>
11129
11130         * cs-parser.jay: Make this work for uninitialized variable
11131         declarations in the `for' initializer.  Fixes #32416.
11132
11133 2002-11-24  Martin Baulig  <martin@ximian.com>
11134
11135         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11136         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11137
11138 2002-11-24  Martin Baulig  <martin@ximian.com>
11139
11140         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11141         argument; if true, we also check for user-defined conversions.
11142         This is only needed if both arguments are of a user-defined type.
11143         Fixes #30443, added test-175.cs.
11144         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11145
11146         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11147
11148 2002-11-24  Martin Baulig  <martin@ximian.com>
11149
11150         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11151         function to get the store opcode.
11152         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11153         only emit the Ldelema if the store opcode is Stobj.  You must run
11154         both test-34 and test-167 to test this.  Fixes #34529.
11155
11156 2002-11-23  Martin Baulig  <martin@ximian.com>
11157
11158         * ecore.cs (Expression.MemberLookup): Added additional
11159         `qualifier_type' argument which is used when we're being called
11160         from MemberAccess.DoResolve() and null if we're called from a
11161         SimpleName lookup.
11162         (Expression.MemberLookupFailed): New method to report errors; this
11163         does the CS1540 check and reports the correct error message.
11164
11165         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11166         argument for the CS1540 check and redone the way how we're dealing
11167         with private members.  See the comment in the source code for details.
11168         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11169         `closure_start_type' to `closure_qualifier_type' and check whether
11170         it's not null.  It was not this filter being broken, it was just
11171         being called with the wrong arguments.
11172
11173         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11174         and pass it the correct `qualifier_type'; this also does the error
11175         handling for us.
11176
11177 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11178
11179         * expression.cs (Invocation.EmitParams): If the we are dealing
11180         with a non-built-in value type, load its address as well.
11181
11182         (ArrayCreation): Use a a pretty constant instead
11183         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11184         static initializers.  
11185
11186         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11187         because they are not really value types, just glorified integers. 
11188
11189         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11190
11191         * ecore.cs: Remove redundant code for enumerations, make them use
11192         the same code path as everything else, fixes the casting issue
11193         with enumerations in Windows.Forms.
11194
11195         * attribute.cs: Do only cast to string if it is a string, the
11196         validation happens later.
11197
11198         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11199         people upgrade their corlibs.
11200
11201         * ecore.cs: Oops, enumerations were not following the entire code path
11202
11203 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11204
11205         * typemanager.cs (FilterWithClosure): Commented out the test for
11206         1540 in typemanager.cs, as it has problems when accessing
11207         protected methods from a parent class (see test-174.cs). 
11208
11209         * attribute.cs (Attribute.ValidateGuid): new method.
11210         (Attribute.Resolve): Use above.
11211
11212 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11213
11214         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11215
11216         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11217         handling for enumerations, as we only needed the TypeContainer
11218         functionality to begin with (this is required for the fix below to
11219         work for enums that reference constants in a container class for
11220         example). 
11221
11222         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11223
11224         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11225         a valid TypeBuilder to perform lookups on.o
11226
11227         * class.cs (InheritableMemberSignatureCompare): Use true in the
11228         call to GetGetMethod and GetSetMethod, because we are comparing
11229         the signature, and we need to get the methods *even* if they are
11230         private. 
11231
11232         (PropertyBase.CheckBase): ditto.
11233
11234         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11235         GotoCase.Resolve): Use Peel on EmpytCasts.
11236
11237         * ecore.cs (EmptyCast): drop child, add Peel method.
11238
11239 2002-11-17  Martin Baulig  <martin@ximian.com>
11240
11241         * ecore.cs (EmptyCast.Child): New public property.
11242
11243         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11244         label resolved to an EmptyCast.  Fixes #34162.
11245         (GotoCase.Resolve): Likewise.
11246         (Block.EmitMeta): Likewise.
11247
11248 2002-11-17  Martin Baulig  <martin@ximian.com>
11249
11250         * expression.cs (Invocation.BetterConversion): Prefer int over
11251         uint; short over ushort; long over ulong for integer literals.
11252         Use ImplicitConversionExists instead of StandardConversionExists
11253         since we also need to check for user-defined implicit conversions.
11254         Fixes #34165.  Added test-173.cs.
11255
11256 2002-11-16  Martin Baulig  <martin@ximian.com>
11257
11258         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11259         with the `true' and `false' literals.  Fixes #33151.
11260
11261 2002-11-16  Martin Baulig  <martin@ximian.com>
11262
11263         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11264         October 22nd; don't do the cs1540 check for static members.
11265
11266         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11267         now using our own filter here and doing the cs1540 check again.
11268
11269 2002-11-16  Martin Baulig  <martin@ximian.com>
11270
11271         * support.cs (InternalParameters): Don't crash if we don't have
11272         any fixed parameters.  Fixes #33532.
11273
11274 2002-11-16  Martin Baulig  <martin@ximian.com>
11275
11276         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11277         when looking up static methods to make this work on Windows.
11278         Fixes #33773.
11279
11280 2002-11-16  Martin Baulig  <martin@ximian.com>
11281
11282         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11283         a setter rather than using PropertyInfo.CanWrite.
11284
11285 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11286
11287         * class.cs: Allow acces to block member by subclasses. Fixes build
11288         breaker.
11289
11290 2002-11-14  Martin Baulig  <martin@ximian.com>
11291
11292         * class.cs (Constructor.Emit): Added the extern/block check.
11293         Fixes bug #33678.
11294
11295 2002-11-14  Martin Baulig  <martin@ximian.com>
11296
11297         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11298         iteration while looking for indexers, this is needed because the
11299         indexer may have a different name in our base classes.  Fixed the
11300         error reporting (no indexers at all, not get accessor, no
11301         overloaded match).  Fixes bug #33089.
11302         (IndexerAccess.DoResolveLValue): Likewise.
11303
11304 2002-11-14  Martin Baulig  <martin@ximian.com>
11305
11306         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11307         indexers.  Fixes the first part of bug #33089.
11308         (MethodSignature.InheritableMemberSignatureCompare): Added support
11309         for properties.
11310
11311 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11312
11313         * attribute.cs (Attribute.Resolve): Catch the
11314         NullReferenceException and report it since it isn't supposed to
11315         happen. 
11316
11317 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11318
11319         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11320         LogicalOr and LogicalAnd that can benefit from recursively
11321         handling EmitBranchable.  The code now should be nice for Paolo.
11322
11323 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11324
11325         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11326         the Type lookups, as we perform quite a number of lookups on
11327         non-Types.  This can be removed once we can deterministically tell
11328         whether we have a type or a namespace in advance.
11329
11330         But this might require special hacks from our corlib.
11331
11332         * TODO: updated.
11333
11334         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11335         and double which avoids a conversion from an integer to a double.
11336
11337         * expression.cs: tiny optimization, avoid calling IsConstant,
11338         because it effectively performs the lookup twice.
11339
11340 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11341
11342         But a bogus return here to keep the semantics of the old code
11343         until the Mono runtime is fixed.
11344
11345         * pending.cs (GetMissingInterfaces): New method used to remove all
11346         the interfaces that are already implemented by our parent
11347         classes from the list of pending methods. 
11348
11349         * interface.cs: Add checks for calls after ResolveTypeExpr.
11350
11351 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11352
11353         * class.cs (Class.Emit): Report warning 67: event not used if the
11354         warning level is beyond 3.
11355
11356         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11357         being a NullLiteral.
11358
11359         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11360         specifiers. 
11361
11362         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11363         path that might fail if a type can not be resolved.
11364
11365         * expression.cs (Binary.Emit): Emit unsigned versions of the
11366         operators. 
11367
11368         * driver.cs: use error 5.
11369
11370 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11371
11372         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11373
11374 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11375
11376         * cs-parser.jay (switch_section): A beautiful patch from Martin
11377         Baulig that fixed 33094.
11378
11379 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11380
11381         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11382         Check whether the base is abstract and report an error if so.
11383
11384         * expression.cs (IndexerAccess.DoResolveLValue,
11385         IndexerAccess.DoResolve): ditto. 
11386
11387         (Invocation.DoResolve): ditto.
11388
11389         (Invocation.FullMethodDesc): Improve the report string.
11390
11391         * statement.cs (Block): Eliminate IsVariableDefined as it is
11392         basically just a wrapper for GetVariableInfo.
11393
11394         * ecore.cs (SimpleName): Use new 
11395
11396         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11397         type, as we return the actual parameter ref/unref state on a
11398         different call.
11399
11400 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11401
11402         * support.cs: Return proper flags REF/OUT fixing the previous
11403         commit.  
11404
11405         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11406         not used to mean `ref' but `ref or out' in ParameterReference
11407
11408         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11409         full type signature instead of calling TypeManger.CSharpName
11410         ourselves. 
11411
11412         * support.cs (InternalParameters.ParameterDesc): Do not compare
11413         directly to the modflags, because REF/OUT will actually be bitsets
11414         if set. 
11415
11416         * delegate.cs (VerifyMethod): Check also the modifiers.
11417
11418         * cs-tokenizer.cs: Fix bug where floating point values with an
11419         exponent where a sign was missing was ignored.
11420
11421         * driver.cs: Allow multiple assemblies to be specified in a single
11422         /r: argument
11423
11424 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11425
11426         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11427         because identifiers after a parenthesis would end up in this kind
11428         of production, and we needed to desamiguate it for having casts
11429         like:
11430
11431                 (UserDefinedType *) xxx
11432
11433 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11434
11435         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11436         we should set on the Bindingflags.NonPublic, but not turn on
11437         private_ok.  private_ok controls whether a Private member is
11438         returned (this is chekced on the filter routine), while the
11439         BindingFlags.NonPublic just controls whether private/protected
11440         will be allowed.   This fixes the problem part of the problem of
11441         private properties being allowed to be used in derived classes.
11442
11443         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11444         so we can call the children DoResolveLValue method (this will
11445         properly signal errors on lvalue assignments to base properties)
11446
11447         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11448         getter are null, and we have a property info, we know that this
11449         happened because the lookup failed, so we report an error 122 for
11450         protection level violation.
11451
11452         We also silently return if setter and getter are null in the
11453         resolve functions, this condition only happens if we have flagged
11454         the error before.  This is the other half of the problem. 
11455
11456         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11457         not have accessibility information, that is why we were returning
11458         true in the filter function in typemanager.cs.
11459
11460         To properly report 122 (property is inaccessible because of its
11461         protection level) correctly, we report this error in ResolveAccess
11462         by failing if both the setter and the getter are lacking (ie, the
11463         lookup failed). 
11464
11465         DoResolve and DoLResolve have been modified to check for both
11466         setter/getter being null and returning silently, the reason being
11467         that I did not want to put the knowledge about this error in upper
11468         layers, like:
11469
11470         int old = Report.Errors;
11471         x = new PropertyExpr (...);
11472         if (old != Report.Errors)
11473                 return null;
11474         else
11475                 return x;
11476
11477         So the property expr is returned, but it is invalid, so the error
11478         will be flagged during the resolve process. 
11479
11480         * class.cs: Remove InheritablePropertySignatureCompare from the
11481         class, as we no longer depend on the property signature to compute
11482         whether it is possible to implement a method or not.
11483
11484         The reason is that calling PropertyInfo.GetGetMethod will return
11485         null (in .NET, in Mono it works, and we should change this), in
11486         cases where the Get Method does not exist in that particular
11487         class.
11488
11489         So this code:
11490
11491         class X { public virtual int A { get { return 1; } } }
11492         class Y : X { }
11493         class Z : Y { public override int A { get { return 2; } } }
11494
11495         Would fail in Z because the parent (Y) would not have the property
11496         defined.  So we avoid this completely now (because the alternative
11497         fix was ugly and slow), and we now depend exclusively on the
11498         method names.
11499
11500         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11501         reference method, instead of using the property.
11502
11503         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11504         routines are gone now.
11505
11506         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11507         names, they were incorrectly named.
11508
11509         * cs-tokenizer.cs: Return are more gentle token on failure. 
11510
11511         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11512         had an out-of-sync index variable, which caused it to remove from
11513         the list of pending methods the wrong method sometimes.
11514
11515 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11516
11517         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11518         CanWrite, because those refer to this particular instance of the
11519         property, and do not take into account the fact that we can
11520         override single members of a property.
11521
11522         Constructor requires an EmitContext.  The resolution process does
11523         not happen here, but we need to compute the accessors before,
11524         because the resolution does not always happen for properties.
11525
11526         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11527         subclass, before we did not update this flag, but we did update
11528         bindingflags. 
11529
11530         (GetAccessors): Drop this routine, as it did not work in the
11531         presence of partially overwritten set/get methods. 
11532
11533         Notice that this broke the cs1540 detection, but that will require
11534         more thinking. 
11535
11536 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11537
11538         * class.cs:
11539         * codegen.cs:
11540         * driver.cs: issue a warning instead of an error if we don't support
11541         debugging for the platform. Also ignore a couple of errors that may
11542         arise when trying to write the symbols. Undo my previous patch.
11543
11544 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11545
11546         * driver.cs: ignore /debug switch except for Unix platforms.
11547
11548 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11549
11550         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11551
11552 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11553
11554         * driver.cs: Do not make mcs-debug conditional, so we do not break
11555         builds that use it.
11556
11557         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11558         review this patch.  But basically after all the children variables
11559         have been merged, the value of "Breaks" was not being set to
11560         new_breaks for Switch blocks.  I think that it should be set after
11561         it has executed.  Currently I set this to the value of new_breaks,
11562         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11563         conservative, but I do not understand this code very well.
11564
11565         I did not break anything in the build, so that is good ;-)
11566
11567         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11568
11569 2002-10-20  Mark Crichton  <crichton@gimp.org>
11570
11571         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11572
11573 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11574
11575         * cfold.cs: Fixed compile blocker.
11576
11577 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11578
11579         * driver.cs: I was chekcing the key, not the file.
11580
11581 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11582
11583         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11584         message that we were generating - we just need to silently return
11585         a null.
11586
11587 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11588
11589         * class.cs (Event.Define): Change my previous commit, as this
11590         breaks the debugger.  This is a temporary hack, as it seems like
11591         the compiler is generating events incorrectly to begin with.
11592
11593         * expression.cs (Binary.ResolveOperator): Added support for 
11594         "U operator - (E x, E y)"
11595
11596         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11597         y)".
11598
11599         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11600         init-only variables, but this path did not take into account that
11601         there might be also instance readonly variables.  Correct this
11602         problem. 
11603
11604         This fixes bug 32253
11605
11606         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11607         delegates as well.
11608
11609         * driver.cs: Change the extension for modules to `netmodule'
11610
11611         * cs-parser.jay: Improved slightly the location tracking for
11612         the debugger symbols.
11613
11614         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11615         modifiers that were specified instead of the hardcoded value
11616         (FamAndAssem).  This was basically ignoring the static modifier,
11617         and others.  Fixes 32429.
11618
11619         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11620         fixed a bug in the process (32476)
11621
11622         * expression.cs (ArrayAccess.EmitAssign): Patch from
11623         hwang_rob@yahoo.ca that fixes bug 31834.3
11624
11625 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11626
11627         * driver.cs: Make the module extension .netmodule.
11628
11629 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11630
11631         * driver.cs: Report an error if the resource file is not found
11632         instead of crashing.
11633
11634         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11635         false, like Emit does.
11636
11637 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11638
11639         * typemanager.cs: Remove unused private member.  Also reported mcs
11640         bug to report this as a warning like csc.
11641
11642 2002-10-15  Martin Baulig  <martin@gnome.org>
11643
11644         * statement.cs (Statement.Emit): Made this a virtual method; emits
11645         the line number info and calls DoEmit().
11646         (Statement.DoEmit): New protected abstract method, formerly knows
11647         as Statement.Emit().
11648
11649         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11650
11651 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11652
11653         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11654         have fixed a remaining problem: not every AddXXXX was adding a
11655         fully qualified name.  
11656
11657         Now everyone registers a fully qualified name in the DeclSpace as
11658         being defined instead of the partial name.  
11659
11660         Downsides: we are slower than we need to be due to the excess
11661         copies and the names being registered this way.  
11662
11663         The reason for this is that we currently depend (on the corlib
11664         bootstrap for instance) that types are fully qualified, because
11665         we dump all the types in the namespace, and we should really have
11666         types inserted into the proper namespace, so we can only store the
11667         basenames in the defined_names array.
11668
11669 2002-10-10  Martin Baulig  <martin@gnome.org>
11670
11671         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11672         from bug #31834, see the bug report for a testcase which is
11673         miscompiled.
11674
11675 2002-10-10  Martin Baulig  <martin@gnome.org>
11676
11677         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11678         flow analysis code for this.
11679
11680         * statement.cs (Do, While, For): Tell the flow analysis code about
11681         infinite loops.
11682         (FlowBranching.UsageVector): Added support for infinite loops.
11683         (Block.Resolve): Moved the dead code elimination here and use flow
11684         analysis to do it.
11685
11686 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11687
11688         * class.cs (Field.Define): Catch cycles on struct type
11689         definitions. 
11690
11691         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11692         fields if the fields are static.  We only need to check instance
11693         fields. 
11694
11695         * expression.cs (As.DoResolve): Test for reference type.
11696
11697         * statement.cs (Using.ResolveExpression): Use
11698         ConvertImplicitRequired, not ConvertImplicit which reports an
11699         error on failture
11700         (Using.ResolveLocalVariableDecls): ditto.
11701
11702         * expression.cs (Binary.ResolveOperator): Report errors in a few
11703         places where we had to.
11704
11705         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11706
11707 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11708
11709         * expression.cs: Use StoreFromPtr instead of extracting the type
11710         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11711
11712         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11713         an enumeration value to a System.Enum, but System.Enum is not a
11714         value type, but an class type, so we need to box.
11715
11716         (Expression.ConvertExplicit): One codepath could return
11717         errors but not flag them.  Fix this.  Fixes #31853
11718
11719         * parameter.cs (Resolve): Do not allow void as a parameter type.
11720
11721 2002-10-06  Martin Baulig  <martin@gnome.org>
11722
11723         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11724         if it's a class type and not a struct.  Fixes #31815.
11725
11726 2002-10-06  Martin Baulig  <martin@gnome.org>
11727
11728         * statement.cs: Reworked the flow analysis code a bit to make it
11729         usable for dead code elimination.
11730
11731 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11732
11733         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11734
11735 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11736
11737         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11738         to fix the test 165, will investigate deeper.
11739
11740 2002-10-04  Martin Baulig  <martin@gnome.org>
11741
11742         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11743         finally blocks actually work.
11744         (Try.Resolve): We don't need to create a sibling for `finally' if
11745         there is no finally block.
11746
11747 2002-10-04  Martin Baulig  <martin@gnome.org>
11748
11749         * class.cs (Constructor.Define): The default accessibility for a
11750         non-default constructor is private, not public.
11751
11752 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * class.cs (Constructor): Make AllowedModifiers public, add
11755         EXTERN.
11756
11757         * cs-parser.jay: Perform the modifiers test here, as the
11758         constructor for the Constructor class usually receives a zero
11759         because of the way we create it (first we create, later we
11760         customize, and we were never checking the modifiers).
11761
11762         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11763         is a version of LookupTypeReflection that includes the type-name
11764         cache.  This can be used as a fast path for functions that know
11765         the fully qualified name and are only calling into *.GetType() to
11766         obtain a composed type.
11767
11768         This is also used by TypeManager.LookupType during its type
11769         composition.
11770
11771         (LookupType): We now also track the real type name, as sometimes
11772         we can get a quey for the real type name from things like
11773         ComposedCast.  This fixes bug 31422.
11774
11775         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11776         complete type fullname, it does not have to go through the type
11777         resolution system to obtain the composed version of the type (for
11778         obtaining arrays or pointers).
11779
11780         (Conditional.Emit): Use the EmitBoolExpression to
11781         generate nicer code, as requested by Paolo.
11782
11783         (ArrayCreation.CheckIndices): Use the patch from
11784         hwang_rob@yahoo.ca to validate the array initializers. 
11785
11786 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11787
11788         * class.cs (ConstructorInitializer.Emit): simplify code by using
11789         Invocation.EmitCall, and at the same time, fix the bugs in calling
11790         parent constructors that took variable arguments. 
11791
11792         * ecore.cs (Expression.ConvertNumericExplicit,
11793         Expression.ImplicitNumericConversion): Remove the code that
11794         manually wrapped decimal (InternalTypeConstructor call is now gone
11795         as well).
11796
11797         * expression.cs (Cast.TryReduce): Also handle decimal types when
11798         trying to perform a constant fold on the type.
11799
11800         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11801
11802         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11803         that only turned off an error report, and did nothing else. 
11804
11805 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11806
11807         * driver.cs: Handle and ignore /fullpaths
11808
11809 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11810
11811         * expression.cs (Binary.ResolveOperator): Catch the case where
11812         DoNumericPromotions returns true, 
11813
11814         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11815
11816 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11817
11818         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11819         report error 70.
11820
11821 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11822
11823         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11824         conversion exists, but it is also required that the conversion be
11825         performed.  This manifested in "(Type64Enum) 2".  
11826
11827         * class.cs (TypeManager.AddMethod): The fix is not to change
11828         AddEnum, because that one was using a fully qualified name (every
11829         DeclSpace derivative does), but to change the AddMethod routine
11830         that was using an un-namespaced name.  This now correctly reports
11831         the duplicated name.
11832
11833         Revert patch until I can properly fix it.  The issue
11834         is that we have a shared Type space across all namespaces
11835         currently, which is wrong.
11836
11837         Options include making the Namespace a DeclSpace, and merge
11838         current_namespace/current_container in the parser.
11839
11840 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11841
11842         * cs-parser.jay: Improve error reporting when we get a different
11843         kind of expression in local_variable_type and
11844         local_variable_pointer_type. 
11845
11846         Propagate this to avoid missleading errors being reported.
11847
11848         * ecore.cs (ImplicitReferenceConversion): treat
11849         TypeManager.value_type as a target just like object_type.   As
11850         code like this:
11851
11852         ValueType v = 1;
11853
11854         Is valid, and needs to result in the int 1 being boxed before it
11855         is assigned to the value type v.
11856
11857         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11858         to validate the enumeration name.
11859
11860         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11861         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11862         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11863
11864         * ecore.cs (TryImplicitIntConversion): When doing an
11865         implicit-enumeration-conversion, check if the type is 64-bits and
11866         perform a conversion before passing to EnumConstant.
11867
11868 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11869
11870         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11871         report ambiguous type references.  Unlike the MS version, we
11872         report what the ambiguity is.   Innovation at work ;-)
11873
11874         (DeclSpace.FindType): Require a location argument to
11875         display when we display an ambiguous error.
11876
11877         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11878
11879         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11880
11881         * expression.cs (EmitDynamicInitializers): Apply patch from
11882         hwang_rob@yahoo.ca that fixes the order in which we emit our
11883         initializers. 
11884
11885 2002-09-21  Martin Baulig  <martin@gnome.org>
11886
11887         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11888         delegate takes no arguments.
11889
11890 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11891
11892         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11893         from integers.
11894
11895         * expression.cs: Extract the underlying type.
11896
11897         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11898
11899         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11900
11901 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11902
11903         * class.cs (TypeContainer.DefineType): We can not use the nice
11904         PackingSize with the size set to 1 DefineType method, because it
11905         will not allow us to define the interfaces that the struct
11906         implements.
11907
11908         This completes the fixing of bug 27287
11909
11910         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11911         means also structs.  This fixes part of the problem. 
11912         (Expresion.ImplicitReferenceConversionExists): ditto.
11913
11914         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11915         error if there were no errors reported during the type lookup
11916         process, to avoid duplicates or redundant errors.  Without this
11917         you would get an ambiguous errors plus a type not found.  We have
11918         beaten the user enough with the first error.  
11919
11920         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11921         reference. 
11922
11923         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11924         during the resolution process, stop the lookup, this avoids
11925         repeated error reports (same error twice).
11926
11927         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11928
11929         * typemanager.cs (LookupType): Redo the type lookup code to match
11930         the needs of System.Reflection.  
11931
11932         The issue is that System.Reflection requires references to nested
11933         types to begin with a "+" sign instead of a dot.  So toplevel
11934         types look like: "NameSpace.TopLevelClass", and nested ones look
11935         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11936         levels. 
11937
11938 2002-09-19  Martin Baulig  <martin@gnome.org>
11939
11940         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11941         says that a method always returns or always throws an exception,
11942         don't report the CS0161.
11943
11944         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11945         set `Returns = new_returns'.
11946
11947 2002-09-19  Martin Baulig  <martin@gnome.org>
11948
11949         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11950         to an enum constant, check for a CS0176.
11951
11952 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11953
11954         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11955         for operators that must be in pairs and report errors.
11956
11957         * ecore.cs (SimpleName.DoResolveType): During the initial type
11958         resolution process, when we define types recursively, we must
11959         check first for types in our current scope before we perform
11960         lookups in the enclosing scopes.
11961
11962         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11963
11964         (Invocation.VerifyArgumentsCompat): Call
11965         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11966         I thought we were supposed to always call this, but there are a
11967         few places in the code where we dont do it.
11968
11969 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11970
11971         * driver.cs: Add support in -linkres and -resource to specify the
11972         name of the identifier.
11973
11974 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11975
11976         * ecore.cs (StandardConversionExists): Sync with the conversion
11977         code: allow anything-* to void* conversions.
11978
11979         (FindMostSpecificSource): Use an Expression argument
11980         instead of a Type, because we might be handed over a Literal which
11981         gets a few more implicit conversions that plain types do not.  So
11982         this information was being lost.
11983
11984         Also, we drop the temporary type-holder expression when not
11985         required.
11986
11987 2002-09-17  Martin Baulig  <martin@gnome.org>
11988
11989         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11990         this is an explicit interface implementation.
11991
11992 2002-09-17  Martin Baulig  <martin@gnome.org>
11993
11994         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11995         different `IndexerName' attributes.
11996
11997         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11998         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11999         virtual CommonResolve().
12000
12001 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12002
12003         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12004         and convert that to the UnderlyingType.
12005
12006         * statement.cs (Foreach.Resolve): Indexers are just like variables
12007         or PropertyAccesses.
12008
12009         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12010         inside quoted strings, we were not doing this before.
12011
12012 2002-09-16  Martin Baulig  <martin@gnome.org>
12013
12014         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12015         resolve it.  This is needed for the definite assignment check of the
12016         instance expression, fixes bug #29846.
12017         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12018
12019 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12020
12021         * parameter.cs: Fix compile error.  Cannot reference static member
12022         from an instance object.  Is this an mcs bug?
12023
12024 2002-09-14  Martin Baulig  <martin@gnome.org>
12025
12026         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12027         multiple times.  Fixes bug #30295, added test-166.cs.
12028
12029 2002-09-14  Martin Baulig  <martin@gnome.org>
12030
12031         * statement.cs (Block.Emit): Don't emit unreachable code.
12032         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12033         `break' statements.
12034         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12035
12036 2002-09-14  Martin Baulig  <martin@gnome.org>
12037
12038         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12039         is set.
12040
12041 2002-09-14  Martin Baulig  <martin@gnome.org>
12042
12043         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12044         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12045         be false on the ms runtime.
12046
12047 2002-09-13  Martin Baulig  <martin@gnome.org>
12048
12049         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12050         the CS0038 error message.
12051
12052 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12053
12054         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12055         constant inside, return it.
12056
12057 2002-09-12  Martin Baulig  <martin@gnome.org>
12058
12059         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12060         implicit conversion can be done between enum types.
12061
12062         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12063         check whether an implicit conversion to the current enum's UnderlyingType
12064         exists and report an error if not.
12065
12066         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12067         without debugging support.
12068
12069         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12070         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12071
12072 2002-09-12  Martin Baulig  <martin@gnome.org>
12073
12074         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12075
12076         * ecore.cs (IMemberExpr.DeclaringType): New property.
12077         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12078         nonstatic member of an outer type (CS0038).
12079
12080 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12081
12082         * driver.cs: Activate the using-error detector at warning level
12083         4 (at least for MS-compatible APIs).
12084
12085         * namespace.cs (VerifyUsing): Small buglett fix.
12086
12087         * pending.cs (PendingImplementation): pass the container pointer. 
12088
12089         * interface.cs (GetMethods): Allow for recursive definition.  Long
12090         term, I would like to move every type to support recursive
12091         definitions, not the current ordering mechanism that we have right
12092         now.
12093
12094         The situation is this: Attributes are handled before interfaces,
12095         so we can apply attributes to interfaces.  But some attributes
12096         implement interfaces, we will now handle the simple cases
12097         (recursive definitions will just get an error).  
12098
12099         * parameter.cs: Only invalidate types at the end if we fail to
12100         lookup all types.  
12101
12102 2002-09-09  Martin Baulig  <martin@gnome.org>
12103
12104         * ecore.cs (PropertyExpr.Emit): Also check for
12105         TypeManager.system_int_array_get_length so this'll also work when
12106         compiling corlib.  Fixes #30003.
12107
12108 2002-09-09  Martin Baulig  <martin@gnome.org>
12109
12110         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12111         and throw an exception if we can't get the type's size.  Fixed #30040,
12112         added test-165.cs.
12113
12114 2002-09-09  Martin Baulig  <martin@gnome.org>
12115
12116         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12117
12118         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12119         context.  Fixes bug #30027.
12120
12121         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12122         virtual functions.  Fixes bug #30043, added test-164.cs.
12123
12124 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12125
12126         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12127
12128 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12129
12130         * driver.cs: Use an object to get the windows codepage since it's not a
12131         static property.
12132
12133 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12134
12135         * statement.cs (For.Emit): for infinite loops (test == null)
12136         return whether there is a break inside, not always "true".
12137
12138         * namespace.cs (UsingEntry): New struct to hold the name of the
12139         using definition, the location where it is defined, and whether it
12140         has been used in a successful type lookup.
12141
12142         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12143         strings.
12144
12145         * decl.cs: ditto.
12146
12147 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12148
12149         * attribute.cs : Fix incorrect code which relied on catching
12150         a NullReferenceException to detect a null being passed in
12151         where an object was expected.
12152
12153 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12154
12155         * statement.cs (Try): flag the catch variable as assigned
12156
12157         * expression.cs (Cast): Simplified by using ResolveType instead of
12158         manually resolving.
12159
12160         * statement.cs (Catch): Fix bug by using ResolveType.
12161
12162 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12163
12164         * expression.cs (BetterConversion): Special case for when we have
12165         a NullLiteral as the argument and we have to choose between string
12166         and object types - we choose string the way csc does.
12167
12168         * attribute.cs (Attribute.Resolve): Catch the
12169         NullReferenceException and report error #182 since the Mono
12170         runtime no more has the bug and having this exception raised means
12171         we tried to select a constructor which takes an object and is
12172         passed a null.
12173
12174 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12175
12176         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12177         message (1502, 1503) when we can't locate a method after overload
12178         resolution. This is much more informative and closes the bug
12179         Miguel reported.
12180
12181         * interface.cs (PopulateMethod): Return if there are no argument
12182         types. Fixes a NullReferenceException bug.
12183
12184         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12185         expressions too. Previously we were checking only in one place for
12186         positional arguments leaving out named arguments.
12187
12188         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12189         type to the enum type is not allowed. Remove code corresponding to
12190         that.
12191
12192         (ConvertNumericExplicit): Allow explicit conversions from
12193         the underlying type to enum type. This precisely follows the spec
12194         and closes a bug filed by Gonzalo.
12195
12196 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12197
12198         * compiler.csproj:
12199         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12200
12201 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12202
12203         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12204         it was important that we stored the right value after the
12205         reduction in `converted'.
12206
12207 2002-09-04  Martin Baulig  <martin@gnome.org>
12208
12209         * location.cs (Location.SymbolDocument): Use full pathnames for the
12210         source files.
12211
12212 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12213
12214         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12215         of the expression resolve mechanism, because that will catch the
12216         SimpleName error failures.
12217
12218         (Conditional): If we can not resolve the
12219         expression, return, do not crash.
12220
12221 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12222
12223         * cs-tokenizer.cs:
12224         (location): display token name instead of its number.
12225
12226 2002-08-28  Martin Baulig  <martin@gnome.org>
12227
12228         * expression.cs (Binary.ResolveOperator): Don't silently return
12229         but return an error if an operator cannot be applied between two
12230         enum types.
12231
12232 2002-08-28  Martin Baulig  <martin@gnome.org>
12233
12234         * class.cs (Constructor.Define): Set the permission attributes
12235         correctly instead of making all constructors public.
12236
12237 2002-08-28  Martin Baulig  <martin@gnome.org>
12238
12239         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12240         for private members before reporting a CS0103; if we find anything,
12241         it's a CS0122.
12242
12243 2002-08-28  Martin Baulig  <martin@gnome.org>
12244
12245         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12246         to check whether `closure_start_type == closure_invocation_type',
12247         we also need to check whether `m.DeclaringType == closure_invocation_type'
12248         before bypassing the permission checks.  We might be accessing
12249         protected/private members from the base class.
12250         (TypeManager.RealMemberLookup): Only set private_ok if private
12251         members were requested via BindingFlags.NonPublic.
12252
12253         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12254
12255         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12256         MethodGroupExpr.IsExplicitImpl if appropriate.
12257         (Invocation.DoResolve): Don't report the CS0120 for explicit
12258         interface implementations.
12259
12260 2002-08-27  Martin Baulig  <martin@gnome.org>
12261
12262         * expression.cs (Invocation.DoResolve): If this is a static
12263         method and we don't have an InstanceExpression, we must report
12264         a CS0120.
12265
12266 2002-08-25  Martin Baulig  <martin@gnome.org>
12267
12268         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12269         `==' between a valuetype and an object.
12270
12271 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12272
12273         * ecore.cs (TypeExpr): Provide a ToString method.
12274
12275 2002-08-24  Martin Baulig  <martin@gnome.org>
12276
12277         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12278         now called proggie.dbg and it's a binary file.
12279
12280 2002-08-23  Martin Baulig  <martin@gnome.org>
12281
12282         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12283
12284 2002-08-23  Martin Baulig  <martin@gnome.org>
12285
12286         * struct.cs (MyStructInfo.ctor): Make this work with empty
12287         structs; it's not allowed to use foreach() on null.
12288
12289 2002-08-23  Martin Baulig  <martin@gnome.org>
12290
12291         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12292         writer the full pathname of the generated assembly.
12293
12294 2002-08-23  Martin Baulig  <martin@gnome.org>
12295
12296         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12297         A `finally' block never returns or breaks; improved handling of
12298         unreachable code.
12299
12300 2002-08-23  Martin Baulig  <martin@gnome.org>
12301
12302         * statement.cs (Throw.Resolve): Allow `throw null'.
12303
12304 2002-08-23  Martin Baulig  <martin@gnome.org>
12305
12306         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12307         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12308         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12309         MemberLookup would return a wrong event if this is an explicit
12310         interface implementation and the class has an event with the same
12311         name.
12312
12313 2002-08-23  Martin Baulig  <martin@gnome.org>
12314
12315         * statement.cs (Block.AddChildVariableNames): New public method.
12316         (Block.AddChildVariableName): Likewise.
12317         (Block.IsVariableNameUsedInChildBlock): Likewise.
12318         (Block.AddVariable): Check whether a variable name has already
12319         been used in a child block.
12320
12321         * cs-parser.jay (declare_local_variables): Mark all variable names
12322         from the current block as being used in a child block in the
12323         implicit block.
12324
12325 2002-08-23  Martin Baulig  <martin@gnome.org>
12326
12327         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12328         find the symbol writer.
12329
12330         * driver.cs: csc also allows the arguments to /define being
12331         separated by commas, not only by semicolons.
12332
12333 2002-08-23  Martin Baulig  <martin@gnome.org>
12334
12335         * interface.cs (Interface.GetMembers): Added static check for events.
12336
12337 2002-08-15  Martin Baulig  <martin@gnome.org>
12338
12339         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12340         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12341
12342         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12343         why the MethodData.EmitDestructor() change was necessary.
12344
12345 2002-08-20  Martin Baulig  <martin@gnome.org>
12346
12347         * class.cs (TypeContainer.FindMembers): Added static check for events.
12348
12349         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12350
12351         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12352         use Type.GetEvents(), not Type.FindMembers().
12353
12354 2002-08-20  Martin Baulig  <martin@gnome.org>
12355
12356         * decl.cs (MemberCache): Added a special method cache which will
12357         be used for method-only searched.  This ensures that a method
12358         search will return a MethodInfo with the correct ReflectedType for
12359         inherited methods.      
12360
12361 2002-08-20  Martin Baulig  <martin@gnome.org>
12362
12363         * decl.cs (DeclSpace.FindMembers): Made this public.
12364
12365 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12366
12367         * delegate.cs: fixed build on windows.
12368         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12369
12370 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12371
12372         * ecore.cs (StandardConversionExists): Return a false
12373         if we are trying to convert the void type to anything else
12374         since that is not allowed.
12375
12376         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12377         we flag error 70 in the event an event is trying to be accessed
12378         directly from outside the declaring type.
12379
12380 2002-08-20  Martin Baulig  <martin@gnome.org>
12381
12382         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12383         MemberCache from typemanager.cs to decl.cs.
12384
12385 2002-08-19  Martin Baulig  <martin@gnome.org>
12386
12387         * class.cs (TypeContainer): Implement IMemberContainer.
12388         (TypeContainer.DefineMembers): Create the MemberCache.
12389         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12390         return public members if BindingFlags.Public was given, check
12391         whether members are static.
12392
12393 2002-08-16  Martin Baulig  <martin@gnome.org>
12394
12395         * decl.cs (DeclSpace.Define): Splitted this in Define and
12396         DefineMembers.  DefineMembers is called first and initializes the
12397         MemberCache.
12398
12399         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12400         DefineMembers() on all our DeclSpaces.
12401
12402         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12403         but call DefineMembers() on all nested interfaces.  We call their
12404         Define() in our new Define() function.
12405
12406         * interface.cs (Interface): Implement IMemberContainer.
12407         (Interface.Define): Moved all code except the attribute stuf to
12408         DefineMembers().
12409         (Interface.DefineMembers): Initialize the member cache.
12410
12411         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12412         need this anymore since we can use MemberCache.FindMembers directly.
12413
12414 2002-08-19  Martin Baulig  <martin@gnome.org>
12415
12416         * typemanager.cs (MemberCache): When creating the cache for an
12417         interface type, add all inherited members.
12418         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12419         to `out bool used_cache' and documented it.
12420         (TypeManager.MemberLookup): If we already used the cache in the first
12421         iteration, we don't need to do the interfaces check.
12422
12423 2002-08-19  Martin Baulig  <martin@gnome.org>
12424
12425         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12426         here from IMemberFinder and don't implement this interface anymore.
12427         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12428
12429         * typemanager.cs (IMemberFinder): This interface is now only used by
12430         classes which actually support the member cache.
12431         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12432         since we only put DeclSpaces into this Hashtable.
12433         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12434         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12435
12436 2002-08-16  Martin Baulig  <martin@gnome.org>
12437
12438         * typemanager.cs (ICachingMemberFinder): Removed.
12439         (IMemberFinder.MemberCache): New property.
12440         (TypeManager.FindMembers): Merged this with RealFindMembers().
12441         This function will never be called from TypeManager.MemberLookup()
12442         so we can't use the cache here, just the IMemberFinder.
12443         (TypeManager.MemberLookup_FindMembers): Check whether the
12444         IMemberFinder has a MemberCache and call the cache's FindMembers
12445         function.
12446         (MemberCache): Rewrote larger parts of this yet another time and
12447         cleaned it up a bit.
12448
12449 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12450
12451         * driver.cs (LoadArgs): Support quoting.
12452
12453         (Usage): Show the CSC-like command line arguments.
12454
12455         Improved a few error messages.
12456
12457 2002-08-15  Martin Baulig  <martin@gnome.org>
12458
12459         * typemanager.cs (IMemberContainer.Type): New property.
12460         (IMemberContainer.IsInterface): New property.
12461
12462         The following changes are conditional to BROKEN_RUNTIME, which is
12463         defined at the top of the file.
12464
12465         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12466         class'es members, but add all members from TypeHandle.ObjectType
12467         if we're an interface.
12468         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12469         is the current type.
12470         (MemberCache.CacheEntry.Container): Removed this field.
12471         (TypeHandle.GetMembers): Include inherited members.
12472
12473 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12474
12475         * typemanager.cs: fixed compilation and added a comment on a field that
12476         is never used.
12477
12478 2002-08-15  Martin Baulig  <martin@gnome.org>
12479
12480         * class.cs (ConstructorInitializer.Resolve): In the
12481         Expression.MemberLookup call, use the queried_type as
12482         invocation_type.
12483
12484         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12485         declared' attribute, it's always true.
12486         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12487         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12488         temporary wrapper for FindMembers which tells MemberLookup whether
12489         members from the base classes are included in the return value.
12490         This will go away soon.
12491         (TypeManager.MemberLookup): Use this temporary hack here; once the
12492         new MemberCache is completed, we don't need to do the DeclaredOnly
12493         looping here anymore since the MemberCache will take care of this.
12494         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12495         (MemberCache): When creating the MemberCache for a class, get
12496         members from the current class and all its base classes.
12497         (MemberCache.CacheEntry.Container): New field.  This is a
12498         temporary hack until the Mono runtime is fixed to distinguish
12499         between ReflectedType and DeclaringType.  It allows us to use MCS
12500         with both the MS runtime and the unfixed Mono runtime without
12501         problems and without accecting performance.
12502         (MemberCache.SearchMembers): The DeclaredOnly looping from
12503         TypeManager.MemberLookup is now done here.      
12504
12505 2002-08-14  Martin Baulig  <martin@gnome.org>
12506
12507         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12508         Type.GetFields on dynamic types but get the fields from the
12509         corresponding TypeContainer.
12510         (MyStructInfo.GetStructInfo): Added check for enum types.
12511
12512         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12513         (MemberList.SyncRoot): Implemented.
12514         (TypeManager.FilterWithClosure): No need to check permissions if
12515         closure_start_type == closure_invocation_type, don't crash if
12516         closure_invocation_type is null.
12517
12518 2002-08-13  Martin Baulig  <martin@gnome.org>
12519
12520         Rewrote TypeContainer.FindMembers to use a member cache.  This
12521         gives us a speed increase of about 35% for the self-hosting MCS
12522         build and of about 15-20% for the class libs (both on GNU/Linux).
12523
12524         * report.cs (Timer): New class to get enhanced profiling.  This
12525         whole class is "TIMER" conditional since it remarkably slows down
12526         compilation speed.
12527
12528         * class.cs (MemberList): New class.  This is an IList wrapper
12529         which we're now using instead of passing MemberInfo[]'s around to
12530         avoid copying this array unnecessarily.
12531         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12532         (ICachingMemberFinder, IMemberContainer): New interface.
12533         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12534         has already been checked, otherwise use it for the name comparision.
12535         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12536         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12537         if possible.  Returns a MemberList, not a MemberInfo [].
12538         (TypeHandle): New class, implements IMemberContainer.  We create
12539         one instance of this class per type, it contains a MemberCache
12540         which is used to do the member lookups.
12541         (MemberCache): New class.  Each instance of this class contains
12542         all members of a type and a name-based hash table.
12543         (MemberCache.FindMembers): This is our new member lookup
12544         function.  First, it looks up all members of the requested name in
12545         the hash table.  Then, it walks this list and sorts out all
12546         applicable members and returns them.
12547
12548 2002-08-13  Martin Baulig  <martin@gnome.org>
12549
12550         In addition to a nice code cleanup, this gives us a performance
12551         increase of about 1.4% on GNU/Linux - not much, but it's already
12552         half a second for the self-hosting MCS compilation.
12553
12554         * typemanager.cs (IMemberFinder): New interface.  It is used by
12555         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12556         Enum, Delegate or Interface.
12557         (TypeManager.finder_to_member_finder): New PtrHashtable.
12558         (TypeManager.finder_to_container): Removed.
12559         (TypeManager.finder_to_delegate): Removed.
12560         (TypeManager.finder_to_interface): Removed.
12561         (TypeManager.finder_to_enum): Removed.
12562
12563         * interface.cs (Interface): Implement IMemberFinder.
12564
12565         * delegate.cs (Delegate): Implement IMemberFinder.
12566
12567         * enum.cs (Enum): Implement IMemberFinder.
12568
12569         * class.cs (TypeContainer): Implement IMemberFinder.
12570
12571 2002-08-12  Martin Baulig  <martin@gnome.org>
12572
12573         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12574
12575 2002-08-12  Martin Baulig  <martin@gnome.org>
12576
12577         * ecore.cs (ITypeExpression): New interface for expressions which
12578         resolve to a type.
12579         (TypeExpression): Renamed to TypeLookupExpression.
12580         (Expression.DoResolve): If we're doing a types-only lookup, the
12581         expression must implement the ITypeExpression interface and we
12582         call DoResolveType() on it.
12583         (SimpleName): Implement the new ITypeExpression interface.
12584         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12585         hack, the situation that we're only looking up types can't happen
12586         anymore when this method is called.  Moved the type lookup code to
12587         DoResolveType() and call it.
12588         (SimpleName.DoResolveType): This ITypeExpression interface method
12589         is now doing the types-only lookup.
12590         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12591         (ResolveFlags): Added MaskExprClass.
12592
12593         * expression.cs (MemberAccess): Implement the ITypeExpression
12594         interface.
12595         (MemberAccess.DoResolve): Added support for a types-only lookup
12596         when we're called via ITypeExpression.DoResolveType().
12597         (ComposedCast): Implement the ITypeExpression interface.
12598
12599         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12600         Expression.Resolve() with ResolveFlags.Type instead.
12601
12602 2002-08-12  Martin Baulig  <martin@gnome.org>
12603
12604         * interface.cs (Interface.Define): Apply attributes.
12605
12606         * attribute.cs (Attribute.ApplyAttributes): Added support for
12607         interface attributes.
12608
12609 2002-08-11  Martin Baulig  <martin@gnome.org>
12610
12611         * statement.cs (Block.Emit): Only check the "this" variable if we
12612         do not always throw an exception.
12613
12614         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12615         whether the property has a set accessor.
12616
12617 2002-08-11  Martin Baulig  <martin@gnome.org>
12618
12619         Added control flow analysis support for structs.
12620
12621         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12622         with control flow analysis turned off.
12623         (IVariable): New interface.
12624         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12625         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12626         (FieldExpr.DoResolve): Resolve the instance expression with flow
12627         analysis turned off and do the definite assignment check after the
12628         resolving when we know what the expression will resolve to.
12629
12630         * expression.cs (LocalVariableReference, ParameterReference):
12631         Implement the new IVariable interface, only call the flow analysis
12632         code if ec.DoFlowAnalysis is true.
12633         (This): Added constructor which takes a Block argument.  Implement
12634         the new IVariable interface.
12635         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12636         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12637         This does the definite assignment checks for struct members.
12638
12639         * class.cs (Constructor.Emit): If this is a non-static `struct'
12640         constructor which doesn't have any initializer, call
12641         Block.AddThisVariable() to tell the flow analysis code that all
12642         struct elements must be initialized before control returns from
12643         the constructor.
12644
12645         * statement.cs (MyStructInfo): New public class.
12646         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12647         argument to this indexer.  If non-zero, check an individual struct
12648         member, not the whole struct.
12649         (FlowBranching.CheckOutParameters): Check struct members.
12650         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12651         overloaded versions of these methods which take an additional
12652         `int field_idx' argument to check struct members.
12653         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12654         overloaded versions of these methods which take an additional
12655         `string field_name' argument to check struct member.s
12656         (VariableInfo): Implement the IVariable interface.
12657         (VariableInfo.StructInfo): New public property.  Returns the
12658         MyStructInfo instance of the variable if it's a struct or null.
12659         (Block.AddThisVariable): New public method.  This is called from
12660         Constructor.Emit() for non-static `struct' constructor which do
12661         not have any initializer.  It creates a special variable for the
12662         "this" instance variable which will be checked by the flow
12663         analysis code to ensure that all of the struct's fields are
12664         initialized before control returns from the constructor.
12665         (UsageVector): Added support for struct members.  If a
12666         variable/parameter is a struct with N members, we reserve a slot
12667         in the usage vector for each member.  A struct is considered fully
12668         initialized if either the struct itself (slot 0) or all its
12669         members are initialized.
12670
12671 2002-08-08  Martin Baulig  <martin@gnome.org>
12672
12673         * driver.cs (Driver.MainDriver): Only report an error CS5001
12674         if there were no compilation errors.
12675
12676         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12677         `UnsafeContext' property to determine whether the parent is in
12678         unsafe context rather than checking the parent's ModFlags:
12679         classes nested in an unsafe class are unsafe as well.
12680
12681 2002-08-08  Martin Baulig  <martin@gnome.org>
12682
12683         * statement.cs (UsageVector.MergeChildren): Distinguish between
12684         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12685         we return.  Added test17() and test18() to test-154.cs.
12686
12687 2002-08-08  Martin Baulig  <martin@gnome.org>
12688
12689         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12690         Family access, make sure the invoking type isn't a subclass of the
12691         queried type (that'd be a CS1540).
12692
12693         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12694         this method which takes an additional `Type invocation_type'.
12695
12696         * expression.cs (BaseAccess.DoResolve): Use the base type as
12697         invocation and query type.
12698         (MemberAccess.DoResolve): If the lookup failed and we're about to
12699         report a CS0122, try a lookup with the ec.ContainerType - if this
12700         succeeds, we must report a CS1540.
12701
12702 2002-08-08  Martin Baulig  <martin@gnome.org>
12703
12704         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12705         (MethodGroupExpr): Implement the IMemberExpr interface.
12706
12707         * expression (MemberAccess.ResolveMemberAccess): No need to have
12708         any special code for MethodGroupExprs anymore, they're now
12709         IMemberExprs.   
12710
12711 2002-08-08  Martin Baulig  <martin@gnome.org>
12712
12713         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12714         Family, FamANDAssem and FamORAssem permissions.
12715         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12716
12717 2002-08-08  Martin Baulig  <martin@gnome.org>
12718
12719         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12720         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12721         or loop block.
12722
12723 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12724
12725         * driver.cs: implemented /resource option to embed managed resources.
12726
12727 2002-08-07  Martin Baulig  <martin@gnome.org>
12728
12729         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12730         (FieldBase.HasFieldInitializer): New public property.
12731         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12732         returns the field initializer and makes sure it is only resolved once.
12733         (TypeContainer.EmitFieldInitializers): Call
12734         FieldBase.GetInitializerExpression to get the initializer, this ensures
12735         that it isn't resolved multiple times.
12736
12737         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12738         the resolving process (SimpleName/MemberLookup) that we're currently
12739         emitting a field initializer (which must not access any instance members,
12740         this is an error CS0236).
12741
12742         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12743         argument, if the `IsFieldInitializer' flag is set, we must report and
12744         error CS0236 and not an error CS0120.   
12745
12746 2002-08-07  Martin Baulig  <martin@gnome.org>
12747
12748         * ecore.cs (IMemberExpr): New public interface.
12749         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12750         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12751         if the expression is an IMemberExpr.
12752
12753         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12754         to be null, implicitly default to `this' if we're non-static in
12755         this case.  Simplified the code a lot by using the new IMemberExpr
12756         interface.  Also fixed bug #28176 here.
12757
12758 2002-08-06  Martin Baulig  <martin@gnome.org>
12759
12760         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12761         ParameterReferences during semantic analysis so that we can do a
12762         type-only search when resolving Cast, TypeOf and SizeOf.
12763         (block): Pass the `current_local_parameters' to the Block's
12764         constructor.
12765
12766         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12767         argument to the constructor.
12768         (ConstructorInitializer.Resolve): Create a temporary implicit
12769         block with the parameters.
12770
12771         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12772         references here if we aren't doing a type-only search.
12773
12774         * statement.cs (Block): Added constructor which takes a
12775         `Parameters parameters' argument.
12776         (Block.Parameters): New public property.
12777
12778         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12779         to `Parameters' and made it public readonly.
12780
12781 2002-08-06  Martin Baulig  <martin@gnome.org>
12782
12783         * ecore.cs (Expression.Warning): Made this public as well.
12784
12785         * report.cs (Report.Debug): Print the contents of collections.
12786
12787 2002-08-06  Martin Baulig  <martin@gnome.org>
12788
12789         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12790         used to tell Resolve() which kinds of expressions it may return.
12791         (Expression.Resolve): Added overloaded version of this method which
12792         takes a `ResolveFlags flags' argument.  This can be used to tell
12793         Resolve() which kinds of expressions it may return.  Reports a
12794         CS0118 on error.
12795         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12796         ResolveFlags.SimpleName.
12797         (Expression.Error118): Added overloaded version of this method which
12798         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12799         which kinds of expressions are allowed.
12800
12801         * expression.cs (Argument.ResolveMethodGroup): New public method.
12802         Resolves an argument, but allows a MethodGroup to be returned.
12803         This is used when invoking a delegate.
12804
12805         * TODO: Updated a bit.
12806
12807 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12808
12809         Fixed compilation with csc.
12810
12811         * ecore.cs: Expression.Error made public. Is this correct? Should
12812         Warning be made public too?
12813
12814         * expression.cs: use ea.Location instead of ea.loc.
12815         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12816
12817 2002-08-06  Martin Baulig  <martin@gnome.org>
12818
12819         * ecore.cs (Expression.loc): Moved the location here instead of
12820         duplicating it in all derived classes.
12821         (Expression.Location): New public property.
12822         (Expression.Error, Expression.Warning): Made them non-static and
12823         removed the location argument.
12824         (Expression.Warning): Added overloaded version which takes an
12825         `int level' argument.
12826         (Expression.Error118): Make this non-static and removed the
12827         expression and location arguments.
12828         (TypeExpr): Added location argument to the constructor.
12829
12830         * expression.cs (StaticCallExpr): Added location argument to
12831         the constructor.
12832         (Indirection, PointerArithmetic): Likewise.
12833         (CheckedExpr, UnCheckedExpr): Likewise.
12834         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12835         (StringPtr): Likewise.
12836
12837
12838 2002-08-05  Martin Baulig  <martin@gnome.org>
12839
12840         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12841
12842         * assign.cs (Assign.DoResolve): Check whether the source
12843         expression is a value or variable.
12844
12845         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12846         while resolving the corresponding blocks.
12847
12848         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12849         an error, don't silently return null.
12850
12851         * statement.cs (Block.AddVariable): Do the error reporting here
12852         and distinguish between CS0128 and CS0136.
12853         (Block.DoResolve): Report all unused labels (warning CS0164).
12854         (LabeledStatement): Pass the location to the constructor.
12855         (LabeledStatement.HasBeenReferenced): New property.
12856         (LabeledStatement.Resolve): Set it to true here.
12857
12858         * statement.cs (Return.Emit): Return success even after reporting
12859         a type mismatch error (CS0126 or CS0127), this is what csc does and
12860         it avoids confusing the users with any consecutive errors.
12861
12862 2002-08-05  Martin Baulig  <martin@gnome.org>
12863
12864         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12865
12866         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12867
12868         * expression.cs (MemberAccess.DoResolve): Silently return if an
12869         error has already been reported.
12870
12871         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12872         error has already been reported.
12873
12874 2002-08-05  Martin Baulig  <martin@gnome.org>
12875
12876         * statement.cs (UsageVector): Only initialize the `parameters'
12877         vector if we actually have any "out" parameters.
12878
12879 2002-08-05  Martin Baulig  <martin@gnome.org>
12880
12881         * expression.cs (Binary.ResolveOperator): When combining delegates,
12882         they must have the same type.
12883
12884 2002-08-05  Martin Baulig  <martin@gnome.org>
12885
12886         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12887         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12888         work with the ms runtime and we also don't need it: if we're a
12889         PropertyBuilder and not in the `indexer_arguments' hash, then we
12890         are a property and not an indexer.
12891
12892         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12893         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12894         since the latter one doesn't work with the ms runtime.
12895
12896 2002-08-03  Martin Baulig  <martin@gnome.org>
12897
12898         Fixed bugs #27998 and #22735.
12899
12900         * class.cs (Method.IsOperator): New public field.
12901         (Method.CheckBase): Report CS0111 if there's already a method
12902         with the same parameters in the current class.  Report CS0508 when
12903         attempting to change the return type of an inherited method.
12904         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12905         and it's not marked abstract or extern.
12906         (PropertyBase): New abstract base class for Property and Indexer.
12907         (PropertyBase.CheckBase): Moved here from Property and made it work
12908         for indexers.
12909         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12910         the same so we can reuse it there.
12911         (Property, Indexer): Derive from PropertyBase.
12912         (MethodSignature.inheritable_property_signature_filter): New delegate
12913         to find properties and indexers.
12914
12915         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12916         argument and improved error reporting.
12917
12918         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12919         EmptyReadOnlyParameters and made it a property.
12920
12921         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12922         version of this method which takes a `PropertyInfo indexer'.
12923         (TypeManager.RegisterIndexer): New method.
12924
12925         * class.cs: Added myself as author of this file :-)
12926
12927 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12928
12929         * class.cs: fixed compilation on windoze.
12930
12931 2002-08-03  Martin Baulig  <martin@gnome.org>
12932
12933         * interface.cs (Interface.GetInterfaceBases): Check whether all
12934         base interfaces are at least as accessible than the current one.
12935
12936         * class.cs (TypeContainer.GetClassBases): Check whether base types
12937         are at least as accessible than the current type.
12938         (TypeContainer.AsAccessible): Implemented and made non-static.
12939         (MemberBase.CheckParameters): Report errors if the accessibility
12940         checks fail.
12941
12942         * delegate.cs (Delegate.Delegate): The default visibility is
12943         internal for top-level types and private for nested types.
12944         (Delegate.Define): Report errors if the accessibility checks fail.
12945
12946         * enum.cs (Enum.Enum): The default visibility is internal for
12947         top-level types and private for nested types.
12948         (Enum.DefineType): Compute the correct visibility.
12949
12950         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12951         function which takes a `bool is_toplevel' instead of a TypeContainer.
12952
12953         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12954         builtin type.
12955
12956 2002-08-02  Martin Baulig  <martin@gnome.org>
12957
12958         * expression.cs (LocalVariableReferenc): Added constructor which
12959         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12960         (LocalVariableReference.IsReadOnly): New property.
12961         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12962         variable is readonly, use our own readonly flag to do this; you can
12963         use the new constructor to get a writable reference to a read-only
12964         variable.
12965
12966         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12967         reference to the local variable.
12968
12969 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12970
12971         * rootcontext.cs (ResolveCore): Also include System.Exception
12972
12973         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12974         we reach an EmptyStatement.
12975
12976         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12977         is also fine.
12978
12979         * expression.cs (Binary.ResolveOperator): Check error result in
12980         two places.
12981
12982         use brtrue/brfalse directly and avoid compares to null.
12983
12984 2002-08-02  Martin Baulig  <martin@gnome.org>
12985
12986         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12987         Fixes bug #28407, added test-155.cs.
12988
12989 2002-08-01  Martin Baulig  <martin@gnome.org>
12990
12991         * class.cs (Event.EmitDefaultMethod): Make this work with static
12992         events.  Fixes #28311, added verify-3.cs.
12993
12994 2002-08-01  Martin Baulig  <martin@gnome.org>
12995
12996         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12997         `is_disposable' fields.
12998         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12999         `hm.is_disposable' if we're using the collection pattern.
13000         (Foreach.EmitCollectionForeach): Use the correct type for the
13001         enumerator's local variable, only emit the try/finally block if
13002         necessary (fixes #27713).
13003
13004 2002-08-01  Martin Baulig  <martin@gnome.org>
13005
13006         * ecore.cs (Expression.report118): Renamed to Error118 and made
13007         it public static.
13008
13009         * statement.cs (Throw.Resolve): Check whether the expression is of
13010         the correct type (CS0118) and whether the type derives from
13011         System.Exception (CS0155).
13012         (Catch.Resolve): New method.  Do the type lookup here and check
13013         whether it derives from System.Exception (CS0155).
13014         (Catch.CatchType, Catch.IsGeneral): New public properties.
13015
13016         * typemanager.cs (TypeManager.exception_type): Added.
13017
13018 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13019
13020         * driver.cs: Updated About function.
13021
13022 2002-07-31  Martin Baulig  <martin@gnome.org>
13023
13024         Implemented Control Flow Analysis.
13025
13026         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13027         (EmitContext.CurrentBranching): Added.
13028         (EmitContext.StartFlowBranching): Added.
13029         (EmitContext.EndFlowBranching): Added.
13030         (EmitContext.KillFlowBranching): Added.
13031         (EmitContext.IsVariableAssigned): Added.
13032         (EmitContext.SetVariableAssigned): Added.
13033         (EmitContext.IsParameterAssigned): Added.
13034         (EmitContext.SetParameterAssigned): Added.
13035         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13036         Added control flow analysis stuff here.
13037
13038         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13039         resolve the expression as lvalue.
13040         (LocalVariableReference.DoResolve): Check whether the variable has
13041         already been assigned.
13042         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13043         the parameter as assigned here.
13044         (ParameterReference.DoResolve): Check whether the parameter has already
13045         been assigned.
13046         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13047         expression as lvalue.
13048
13049         * statement.cs (FlowBranching): New class for the flow analysis code.
13050         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13051         (LabeledStatement.IsDefined): New public property.
13052         (LabeledStatement.AddUsageVector): New public method to tell flow
13053         analyis that the label may be reached via a forward jump.
13054         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13055         flow analysis.
13056         (VariableInfo.Number): New public field.  This is used by flow analysis
13057         to number all locals of a block.
13058         (Block.CountVariables): New public property.  This is the number of
13059         local variables in this block (including the locals from all parent
13060         blocks).
13061         (Block.EmitMeta): Number all the variables.
13062
13063         * statement.cs: Added flow analysis support to all classes.
13064
13065 2002-07-31  Martin Baulig  <martin@gnome.org>
13066
13067         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13068         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13069         then use this argument.
13070
13071         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13072
13073         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13074         use this to specify /define options.
13075
13076 2002-07-29  Martin Baulig  <martin@gnome.org>
13077
13078         * statement.cs (Fixed): Moved all code that does variable lookups
13079         and resolvings from Emit to Resolve.
13080
13081         * statement.cs (For): Moved all code that does variable lookups
13082         and resolvings from Emit to Resolve.
13083
13084         * statement.cs (Using): Moved all code that does variable lookups
13085         and resolvings from Emit to Resolve.
13086
13087 2002-07-29  Martin Baulig  <martin@gnome.org>
13088
13089         * attribute.cs (Attribute.Resolve): Explicitly catch a
13090         System.NullReferenceException when creating the
13091         CustromAttributeBuilder and report a different warning message.
13092
13093 2002-07-29  Martin Baulig  <martin@gnome.org>
13094
13095         * support.cs (ParameterData.ParameterName): Added method to
13096         get the name of a parameter.
13097
13098         * typemanager.cs (TypeManager.IsValueType): New public method.
13099
13100 2002-07-29  Martin Baulig  <martin@gnome.org>
13101
13102         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13103         is a flag which specifies that it's either ref or out.
13104         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13105         the out parameter to `out Parameter.Modifier mod', also set the
13106         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13107
13108         * support.cs (InternalParameters.ParameterModifier): Distinguish
13109         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13110         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13111
13112         * expression.cs (Argument.GetParameterModifier): Distinguish
13113         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13114         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13115
13116 2002-07-29  Martin Baulig  <martin@gnome.org>
13117
13118         * expression.cs (ParameterReference.ParameterReference): Added
13119         `Location loc' argument to the constructor.
13120
13121         * cs-parser.jay: Pass location to ParameterReference.
13122
13123 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13124
13125         * statement.cs (Try): Initialize the location.
13126
13127         * cs-parser.jay: pass location to Try.
13128
13129         * expression.cs (Unary.Reduce): Change the prototype to return
13130         whether a constant fold could be performed or not.  The result is
13131         returned in an out parameters.  In the case of Indirection and
13132         AddressOf, we want to perform the full tests.
13133
13134 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13135
13136         * statement.cs (Statement.Emit): Flag dead code.
13137
13138 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13139
13140         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13141
13142 2002-07-27  Martin Baulig  <martin@gnome.org>
13143
13144         * class.cs (MethodData.Define): Put back call to
13145         TypeManager.AddMethod(), accidentally commented this out.
13146
13147         * report.cs (Debug): New public method to print debugging information,
13148         this is `[Conditional ("DEBUG")]'.
13149
13150 2002-07-26  Martin Baulig  <martin@gnome.org>
13151
13152         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13153         (switch_statement): Push the current_block to the switch_stack and
13154         pop it again when we're done with the switch.
13155         (switch_section): The new block is a child of the current_block.
13156         Fixes bug #24007, added test-152.cs.
13157
13158 2002-07-27  Martin Baulig  <martin@gnome.org>
13159
13160         * expression.cs (Invocation.EmitArguments): When calling a varargs
13161         function with only its fixed arguments, we need to pass an empty
13162         array.
13163
13164 2002-07-27  Martin Baulig  <martin@gnome.org>
13165
13166         Mono 0.13 has been released.
13167
13168 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13169
13170         * driver.cs: Rename --resource to --linkres, because that is what
13171         we do currently, we dont support --resource yet.
13172
13173         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13174
13175 2002-07-25  Martin Baulig  <martin@gnome.org>
13176
13177         * class.cs (MethodData): New public class.  This is a `method builder'
13178         class for a method or one accessor of a Property/Indexer/Event.
13179         (MethodData.GetMethodFlags): Moved here from MemberBase.
13180         (MethodData.ApplyAttributes): Likewise.
13181         (MethodData.ApplyObsoleteAttribute): Likewise.
13182         (MethodData.ApplyConditionalAttribute): Likewise.
13183         (MethodData.ApplyDllImportAttribute): Likewise.
13184         (MethodData.CheckAbstractAndExternal): Likewise.
13185         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13186         (MethodData.Emit): Formerly known as Method.Emit().
13187         (MemberBase): Moved everything which was specific to a single
13188         accessor/method to MethodData.
13189         (Method): Create a new MethodData and call Define() and Emit() on it.
13190         (Property, Indexer, Event): Create a new MethodData objects for each
13191         accessor and call Define() and Emit() on them.
13192
13193 2002-07-25  Martin Baulig  <martin@gnome.org>
13194
13195         Made MethodCore derive from MemberBase to reuse the code from there.
13196         MemberBase now also checks for attributes.
13197
13198         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13199         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13200         as virtual.
13201         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13202         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13203         (MemberBase.ApplyAttributes): New virtual method; applies the
13204         attributes to a method or accessor.
13205         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13206         (MemberBase.ApplyConditionalAttribute): Likewise.
13207         (MemberBase.ApplyDllImportAttribute): Likewise.
13208         (MemberBase.CheckAbstractAndExternal): Likewise.
13209         (MethodCore.ParameterTypes): This is now a property instead of a
13210         method, it's initialized from DoDefineParameters().
13211         (MethodCore.ParameterInfo): Removed the set accessor.
13212         (MethodCore.DoDefineParameters): New protected virtual method to
13213         initialize ParameterTypes and ParameterInfo.
13214         (Method.GetReturnType): We can now simply return the MemberType.
13215         (Method.GetMethodFlags): Override the MemberBase version and add
13216         the conditional flags.
13217         (Method.CheckBase): Moved some code from Define() here, call
13218         DoDefineParameters() here.
13219         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13220         here to avoid some larger code duplication.
13221         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13222         ensure that abstract and external accessors don't declare a body.
13223
13224         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13225         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13226         lookup in the attribute's parent classes, so we need to abort as soon
13227         as we found the first match.
13228         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13229         the attribute has no arguments.
13230
13231         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13232         of a Method.
13233
13234 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13235
13236         * cs-parser.jay: reverted previous patch.
13237
13238 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13239
13240         * cs-parser.jay: fixed bug #22119.
13241
13242 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13243
13244         * attribute.cs: fixed compilation. The error was:
13245         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13246         be assigned to before control leaves the current method."
13247         [FIXME:  Filed as bug #28186: MCS must report this error.]
13248
13249 2002-07-25  Martin Baulig  <martin@gnome.org>
13250
13251         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13252         method to pull the condition name ouf of a Conditional attribute.
13253         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13254         the obsolete message and error flag out of an Obsolete attribute.
13255
13256         * class.cs (Method.GetMethodFlags): New public method to get the
13257         TypeManager.MethodFlags for this method.
13258         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13259         private methods.
13260         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13261         if we're overriding a virtual function, set the new private variable
13262         `parent_method'; call the new TypeManager.AddMethod().
13263
13264         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13265         the MethodBuilder and the Method in a PtrHashtable.
13266         (TypeManager.builder_to_method): Added for this purpose.
13267         (TypeManager.MethodFlags): Added IsObsoleteError.
13268         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13269         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13270         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13271         the message from the attribute.
13272
13273 2002-07-24  Martin Baulig  <martin@gnome.org>
13274
13275         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13276         preprocessor directives, ensure that the argument to #define/#undef is
13277         exactly one identifier and that it's actually an identifier.
13278
13279         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13280         did not work ....
13281
13282 2002-07-24  Martin Baulig  <martin@gnome.org>
13283
13284         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13285         initialize it to TypeManager.object_type in the constructor.
13286         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13287         of the `hm.get_current' method if we're using the collection pattern.
13288         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13289         for the explicit conversion to make it work when we're using the collection
13290         pattern and the `Current' property has a different return type than `object'.
13291         Fixes #27713.
13292
13293 2002-07-24  Martin Baulig  <martin@gnome.org>
13294
13295         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13296         does not match, but don't report any errors.  This method is called in
13297         order for all methods in a MethodGroupExpr until a matching method is
13298         found, so we don't want to bail out if the first method doesn't match.
13299         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13300         matches, report the 123.  Fixes #28070.
13301
13302 2002-07-24  Martin Baulig  <martin@gnome.org>
13303
13304         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13305         TypeManager.TypeToCoreType() to the top of the method so the
13306         following equality checks will work.  Fixes #28107.
13307
13308 2002-07-24  Martin Baulig  <martin@gnome.org>
13309
13310         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13311         operand is of type uint, and the other operand is of type sbyte,
13312         short or int, the operands are converted to type long." -
13313         Actually do what this comment already told us.  Fixes bug #28106,
13314         added test-150.cs.
13315
13316 2002-07-24  Martin Baulig  <martin@gnome.org>
13317
13318         * class.cs (MethodBase): New abstract class.  This is now a base
13319         class for Property, Indexer and Event to avoid some code duplication
13320         in their Define() and DefineMethods() methods.
13321         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13322         generic methods for Define() and DefineMethods().
13323         (FieldBase): Derive from MemberBase, not MemberCore.
13324         (Property): Derive from MemberBase, not MemberCore.
13325         (Property.DefineMethod): Moved all the code from this method to the
13326         new MethodBase.DefineAccessor(), just call it with appropriate
13327         argumetnts.
13328         (Property.Define): Call the new Property.DoDefine(), this does some
13329         sanity checks and we don't need to duplicate the code everywhere.
13330         (Event): Derive from MemberBase, not MemberCore.
13331         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13332         accessors, this will also make them work with interface events.
13333         (Indexer): Derive from MemberBase, not MemberCore.
13334         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13335         (Indexer.Define): Use the new MethodBase functions.
13336
13337         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13338         argument to the constructor.
13339         (Interface.FindMembers): Added support for interface events.
13340         (Interface.PopluateEvent): Implemented.
13341
13342         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13343
13344 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13345
13346         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13347         but this is required to check for a method name being the same as
13348         the containing class.  
13349
13350         Handle this now.
13351
13352 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13353
13354         * interface.cs: initialize variable.
13355
13356 2002-07-23  Martin Baulig  <martin@gnome.org>
13357
13358         Implemented the IndexerName attribute in interfaces.
13359
13360         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13361         name if this is an explicit interface implementation.
13362         (Indexer.InterfaceIndexerName): New public variable.  If we're
13363         implementing an interface indexer, this is the IndexerName in that
13364         interface.  Otherwise, it's the IndexerName.
13365         (Indexer.DefineMethod): If we're implementing interface indexer,
13366         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13367         and Pending.ImplementIndexer methods.
13368         (Indexer.Define): Also define the PropertyBuilder if we're
13369         implementing an interface indexer and this is neither an explicit
13370         interface implementation nor do the IndexerName match the one in
13371         the interface.
13372
13373         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13374         If a method is defined here, then we always need to create a proxy
13375         for it.  This is used when implementing interface indexers.
13376         (Pending.IsInterfaceIndexer): New public method.
13377         (Pending.ImplementIndexer): New public method.
13378         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13379         This is used when implementing interface indexers to define a proxy
13380         if necessary.
13381         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13382         define a proxy if necessary.
13383
13384         * interface.cs (Interface.IndexerName): New public variable.
13385         (Interface.PopulateIndexer): Set the IndexerName.
13386         (Interface.DefineIndexers): New private method.  Populate all the
13387         indexers and make sure their IndexerNames match.
13388
13389         * typemanager.cs (IndexerPropertyName): Added support for interface
13390         indexers.
13391
13392 2002-07-22  Martin Baulig  <martin@gnome.org>
13393
13394         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13395         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13396         ret if HasReturnLabel.
13397         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13398         variables.
13399
13400         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13401         and set the ec.LoopBeginTryCatchLevel.
13402         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13403         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13404         the current ec.TryCatchLevel, the branch goes out of an exception
13405         block.  In this case, we need to use Leave and not Br.
13406
13407 2002-07-22  Martin Baulig  <martin@gnome.org>
13408
13409         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13410         block unless the block does not always return or it is contained in
13411         another try { ... } catch { ... } block.  Fixes bug #26506.
13412         Added verify-1.cs to the test suite.
13413
13414 2002-07-22  Martin Baulig  <martin@gnome.org>
13415
13416         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13417         then we do not always return.  Fixes bug #24985.
13418
13419 2002-07-22  Martin Baulig  <martin@gnome.org>
13420
13421         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13422         lookup on a per-class level; ie. walk up the class hierarchy until we
13423         found at least one applicable method, then choose the best among them.
13424         Fixes bug #24463 and test-29.cs.
13425
13426 2002-07-22  Martin Baulig  <martin@gnome.org>
13427
13428         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13429         return types of the methods.  The return type is not part of the
13430         signature and we must not check it to make the `new' modifier work.
13431         Fixes bug #27999, also added test-147.cs.
13432         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13433
13434         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13435         on the method's return type.
13436
13437 2002-07-21  Martin Baulig  <martin@gnome.org>
13438
13439         * assign.cs: Make this work if the rightmost source is a constant and
13440         we need to do an implicit type conversion.  Also adding a few more tests
13441         to test-38.cs which should have caught this.
13442
13443         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13444         target in the makefile for this.  The makefile.gnu is primarily intended
13445         for end-users who don't want to debug the compiler.
13446
13447 2002-07-21  Martin Baulig  <martin@gnome.org>
13448
13449         * assign.cs: Improved the Assign class so it can now handle embedded
13450         assignments (X = Y = Z = something).  As a side-effect this'll now also
13451         consume less local variables.  test-38.cs now passes with MCS, added
13452         a few new test cases to that test.
13453
13454 2002-07-20  Martin Baulig  <martin@gnome.org>
13455
13456         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13457         instructions.  Fixes bug #27977, also added test-146.cs.
13458
13459 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13460
13461         * cs-tokenizer.cs: fixed getHex ().
13462
13463 2002-07-19  Martin Baulig  <martin@gnome.org>
13464
13465         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13466         not Type.GetType() to lookup the array type.  This is needed when
13467         we're constructing an array of a user-defined type.
13468         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13469         single-dimensional arrays, but also for single-dimensial arrays of
13470         type decimal.
13471
13472 2002-07-19  Martin Baulig  <martin@gnome.org>
13473
13474         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13475         this function is called, it's not allowed to share LocalBuilders
13476         among ILGenerators.
13477
13478 2002-07-19  Martin Baulig  <martin@gnome.org>
13479
13480         * expression.cs (Argument.Resolve): Report an error 118 when trying
13481         to pass a type as argument.
13482
13483 2002-07-18  Martin Baulig  <martin@gnome.org>
13484
13485         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13486         Conv_R_Un for the signed `long' type.
13487
13488 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13489
13490         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13491         `expr' for the temporary result, as that will fail if we do
13492         multiple resolves on the same expression.
13493
13494 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13495
13496         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13497         ec.TypeContainer for looking up aliases. 
13498
13499         * class.cs (TypeContainer): Remove LookupAlias from here.
13500
13501         * decl.cs (DeclSpace); Move here.
13502
13503 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13504
13505         * class.cs (FindMembers): Only call filter if the constructor
13506         bulider is not null.
13507
13508         Also handle delegates in `NestedTypes' now.  Now we will perform
13509         type lookups using the standard resolution process.  This also
13510         fixes a bug.
13511
13512         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13513         This uses Expressions (the limited kind that can be parsed by the
13514         tree) instead of strings.
13515
13516         * expression.cs (ComposedCast.ToString): Implement, used to flag
13517         errors since now we have to render expressions.
13518
13519         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13520         FormArrayType. 
13521
13522         * ecore.cs (SimpleName.ToString): ditto.
13523
13524         * cs-parser.jay: Instead of using strings to assemble types, use
13525         Expressions to assemble the type (using SimpleName, ComposedCast,
13526         MemberAccess).  This should fix the type lookups in declarations,
13527         because we were using a different code path for this.
13528
13529         * statement.cs (Block.Resolve): Continue processing statements
13530         even when there is an error.
13531
13532 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13533
13534         * class.cs (Event.Define): Also remove the `remove' method from
13535         the list of pending items.
13536
13537         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13538         generate more compact code. 
13539
13540 2002-07-17  Martin Baulig  <martin@gnome.org>
13541
13542         * const.cs (Const.LookupConstantValue): Add support for constant
13543         `unchecked' and `checked' expressions.
13544         Also adding test case test-140.cs for this.
13545
13546 2002-07-17  Martin Baulig  <martin@gnome.org>
13547
13548         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13549         check whether mi.ReturnType implements the IEnumerator interface; the
13550         `==' and the IsAssignableFrom() will fail in this situation.
13551
13552 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13553
13554         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13555         here too.
13556
13557 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13558
13559         * expression.cs: fixed bug #27811.
13560
13561 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13562
13563         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13564         Molaro: when we are a ref, the value already contains a pointer
13565         value, do not take the address of it.
13566
13567 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13568         * removed mb-parser.jay and mb-tokenizer.cs
13569
13570 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13571
13572         * expression.cs: check against the building corlib void type.
13573
13574 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13575
13576         * ecore.cs: fix for valuetype static readonly fields: when 
13577         initializing them, we need their address, not the address of a copy.
13578
13579 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13580
13581         * typemanager.cs: register also enum_type in corlib.
13582
13583 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13584
13585         * class.cs: allow calling this (but not base) initializers in structs.
13586
13587 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13588
13589         * ecore.cs: make sure we compare against the building base types
13590         in GetTypeSize ().
13591
13592 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13593
13594         * typemanager.cs: fix TypeToCoreType() to handle void and object
13595         (corlib gets no more typerefs after this change).
13596
13597 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13598
13599         * expression.cs (ArrayCreation.EmitArrayArguments): use
13600         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13601
13602         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13603         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13604         array indexes, the runtime actually forbids them.
13605
13606         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13607         for array arguments here.
13608
13609         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13610         instead of the default for ValueTypes.
13611
13612         (New.DoEmit): Use IsValueType instead of
13613         IsSubclassOf (value_type)
13614         (New.DoResolve): ditto.
13615         (Invocation.EmitCall): ditto.
13616
13617         * assign.cs (Assign): ditto.
13618
13619         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13620         Statements *are* currently doing part of their resolution during
13621         Emit.  
13622
13623         Expressions do always resolve during resolve, but statements are
13624         only required to propagate resolution to their children.
13625
13626 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13627
13628         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13629
13630         (LoadAssembly): Do not add the dll if it is already specified
13631
13632         (MainDriver): Add the System directory to the link path at the end,
13633         after all the other -L arguments. 
13634
13635         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13636         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13637         ldelem.u1) and using the opposite for sbytes.
13638
13639         This fixes Digger, and we can finally run it.
13640
13641         * driver.cs (UnixParseOption): Move the option parsing here.  
13642         (CSCParseOption): Implement CSC-like parsing of options.
13643
13644         We now support both modes of operation, the old Unix way, and the
13645         new CSC-like way.  This should help those who wanted to make cross
13646         platform makefiles.
13647
13648         The only thing broken is that /r:, /reference: and /lib: are not
13649         implemented, because I want to make those have the same semantics
13650         as the CSC compiler has, and kill once and for all the confussion
13651         around this.   Will be doing this tomorrow.
13652
13653         * statement.cs (Unsafe.Resolve): The state is checked during
13654         resolve, not emit, so we have to set the flags for IsUnsfe here.
13655
13656 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13657
13658         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13659         not catch the Error_ObjectRefRequired in SimpleName (as it is
13660         possible to have a class/instance variable name that later gets
13661         deambiguated), we have to check this here.      
13662
13663 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13664
13665         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13666         make static and put into Expression.
13667
13668         (Event.Define): Register the private field of the event with the 
13669         TypeManager so that GetFieldFromEvent can get at it.
13670
13671         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13672         keep track of the private field associated with an event which
13673         has no accessors.
13674
13675         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13676         private field.
13677
13678         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13679
13680 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13681
13682         * expression.cs (Binary.EmitBranchable): this routine emits the
13683         Binary expression in a branchable context.  This basically means:
13684         we need to branch somewhere, not just get the value on the stack.
13685
13686         This works together with Statement.EmitBoolExpression.
13687
13688         * statement.cs (Statement.EmitBoolExpression): Use
13689         EmitBranchable. 
13690
13691 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13692
13693         * statement.cs (For): Reduce the number of jumps in loops.
13694
13695         (For): Implement loop inversion for the For statement.
13696
13697         (Break): We can be breaking out of a Try/Catch controlled section
13698         (foreach might have an implicit try/catch clause), so we need to
13699         use Leave instead of Br.
13700
13701         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13702         now).  If the instace expression supports IMemoryLocation, we use
13703         the AddressOf method from the IMemoryLocation to extract the
13704         address instead of emitting the instance.
13705
13706         This showed up with `This', as we were emitting the instance
13707         always (Emit) instead of the Address of This.  Particularly
13708         interesting when This is a value type, as we dont want the Emit
13709         effect (which was to load the object).
13710
13711 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13712
13713         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13714
13715         * statement.cs (Checked): Set the CheckedState during the resolve
13716         process too, as the ConvCast operations track the checked state on
13717         the resolve process, and not emit.
13718
13719         * cs-parser.jay (namespace_member_declaration): Flag that we have
13720         found a declaration when we do.  This is used to flag error 1529
13721
13722         * driver.cs: Report ok when we display the help only.
13723
13724 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13725
13726         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13727
13728 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13729
13730         * cs-tokenizer.cs (define): We also have to track locally the
13731         defines.  AllDefines is just used for the Conditional Attribute,
13732         but we also need the local defines for the current source code. 
13733
13734 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13735
13736         * statement.cs (While, For, Do): These loops can exit through a
13737         Break statement, use this information to tell whether the
13738         statement is the last piece of code.
13739
13740         (Break): Flag that we break.
13741
13742         * codegen.cs (EmitContexts): New `Breaks' state variable.
13743
13744 2002-07-03  Martin Baulig  <martin@gnome.org>
13745
13746         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13747         modifiers in method declarations in structs.  Otherwise, you won't
13748         be able to override things like Object.Equals().
13749
13750 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13751
13752         * class.cs (Method, Property, Indexer): Do not allow the public
13753         modifier to be used in explicit interface implementations.
13754
13755         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13756         override modifiers in method declarations in structs
13757
13758 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13759
13760         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13761         integer or real overflow, report an error
13762
13763 2002-07-02  Martin Baulig  <martin@gnome.org>
13764
13765         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13766         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13767         to tell the runtime about our newly created System.Object and
13768         System.ValueType types.
13769
13770 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13771
13772         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13773         struct instead of Ldarg/Starg.
13774
13775 2002-07-02  Martin Baulig  <martin@gnome.org>
13776
13777         * expression.cs (Indirection.Indirection): Call
13778         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13779
13780 2002-07-02  Martin Baulig  <martin@gnome.org>
13781
13782         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13783         ValueType, call TypeManager.TypeToCoreType() on it.
13784         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13785         the OpCodes.Newarr argument.
13786
13787 2002-07-02  Martin Baulig  <martin@gnome.org>
13788
13789         * expression.cs (Invocation.EmitCall): When compiling corlib,
13790         replace all calls to the system's System.Array type to calls to
13791         the newly created one.
13792
13793         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13794         System.Array methods.
13795         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13796         from the system's System.Array type which must be replaced.
13797
13798 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13799
13800         * typemanager.cs: load unverifiable_code_ctor so we can build
13801         corlib using the correct type. Avoid using GetTypeCode() with
13802         TypeBuilders.
13803         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13804         TypeManager.object_type to allow building corlib.
13805
13806 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13807
13808         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13809
13810 2002-07-01  Martin Baulig  <martin@gnome.org>
13811
13812         * class.cs: Make the last change actually work, we need to check
13813         whether `ifaces != null' to avoid a crash.
13814
13815 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13816
13817         * class.cs: when we build structs without fields that implement
13818         interfaces, we need to add the interfaces separately, since there is
13819         no API to both set the size and add the interfaces at type creation
13820         time.
13821
13822 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13823
13824         * expression.cs: the dimension arguments to the array constructors
13825         need to be converted if they are a long.
13826
13827 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13828
13829         * class.cs: don't emit ldarg.0 if there is no parent constructor
13830         (fixes showstopper for corlib).
13831
13832 2002-06-29  Martin Baulig  <martin@gnome.org>
13833
13834         MCS now compiles corlib on GNU/Linux :-)
13835
13836         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13837         ie. check for MethodImplOptions.InternalCall.
13838
13839         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13840         and TypeManager.attribute_type are null, so we must explicitly check
13841         whether parent is not null to find out whether it's an attribute type.
13842         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13843         and SetBuilder, not only if the property is neither abstract nor external.
13844         This is necessary to set the MethodImplOptions on the accessor methods.
13845         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13846         SetBuilder, see Property.Emit().
13847
13848         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13849         populate "System.Object", "System.ValueType" and "System.Attribute" since
13850         they've already been populated from BootCorlib_PopulateCoreTypes().
13851
13852 2002-06-29  Martin Baulig  <martin@gnome.org>
13853
13854         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13855         is the NullLiteral, we also need to make sure that target_type is not
13856         an enum type.   
13857
13858 2002-06-29  Martin Baulig  <martin@gnome.org>
13859
13860         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13861         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13862         before calling BootstrapCorlib_ResolveDelegate ().
13863
13864 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13865
13866         * statement.cs: fixed build-breaker. All tests passed ok.
13867
13868 2002-06-27  Martin Baulig  <martin@gnome.org>
13869
13870         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13871         for System.Decimal when compiling corlib.
13872
13873 2002-06-27  Martin Baulig  <martin@gnome.org>
13874
13875         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13876         switch blocks which contain nothing but a default clause.
13877
13878 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13879
13880        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13881
13882 2002-06-27  Martin Baulig  <martin@gnome.org>
13883
13884         * ecore.cs (PropertyExpr.PropertyExpr): Call
13885         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13886
13887         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13888         is already a TypeBuilder.
13889
13890 2002-06-27  Martin Baulig  <martin@gnome.org>
13891
13892         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13893         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13894         the "from an array-type to System.Array" case.  This makes it work
13895         when compiling corlib.
13896
13897 2002-06-27  Martin Baulig  <martin@gnome.org>
13898
13899         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13900         non-static PropertyExpr, set its InstanceExpression.  This makes
13901         the `ICollection.Count' property work in System/Array.cs.
13902
13903 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13904
13905         * driver.cs: Made error handling more consistent.  Errors now
13906         tracked by Report class, so many methods which used to return int
13907         now return void.  Main() now prints success/failure and 
13908         errors/warnings message.
13909
13910         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13911         the magic number return values (123 and 124).  Now, if the
13912         expected error occurs, the compiler exits with success (exit value
13913         0).  If the compilation completes without seeing that particular
13914         error, the compiler exits with failure (exit value 1).  The
13915         makefile in mcs/errors has been changed to handle the new behaviour.
13916
13917         * report.cs: Made 'expected error' number a property and renamed
13918         it from 'Probe' to 'ExpectedError'.
13919
13920         * genericparser.cs: Removed error handling support, since it is
13921         now all done by Report class.
13922
13923         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13924         class, so parse() no longer returns an int.
13925
13926         * namespace.cs: Use Report.Error instead of GenericParser.error
13927
13928 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13929
13930         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13931         TypeContainer.AddOperator): At the front of the list put the
13932         explicit implementations, so they get resolved/defined first. 
13933
13934 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13935
13936         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13937         interface type is implemented by this TypeContainer.  Used during
13938         explicit interface implementation.
13939
13940         (Property.Define, Indexer.Define, Method.Define): Validate that
13941         the given interface in the explicit implementation is one of the
13942         base classes for the containing type.
13943
13944         Also if we are explicitly implementing an interface, but there is
13945         no match in the pending implementation table, report an error.
13946
13947         (Property.Define): Only define the property if we are
13948         not explicitly implementing a property from an interface.  Use the
13949         correct name also for those properties (the same CSC uses,
13950         although that is really not needed).
13951
13952         (Property.Emit): Do not emit attributes for explicitly implemented
13953         properties, as there is no TypeBuilder.
13954
13955         (Indexer.Emit): ditto.
13956
13957         Hiding then means that we do not really *implement* a pending
13958         implementation, which makes code fail.
13959
13960 2002-06-22  Martin Baulig  <martin@gnome.org>
13961
13962         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13963         the return value of Object.GetType().  [FIXME: we need to do this whenever
13964         we get a type back from the reflection library].
13965
13966 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13967
13968         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13969
13970 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13971
13972         * attribute.cs: Return null if we can not look up the type.
13973
13974         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13975         the interface types found.
13976
13977         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13978         interface types found.
13979
13980         * typemanager.cs (GetInterfaces): Make this routine returns alll
13981         the interfaces and work around the lame differences between
13982         System.Type and System.Reflection.Emit.TypeBuilder in the results
13983         result for GetInterfaces.
13984
13985         (ExpandInterfaces): Given an array of interface types, expand and
13986         eliminate repeated ocurrences of an interface.  This expands in
13987         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13988         be IA, IB, IC.
13989
13990 2002-06-21  Martin Baulig  <martin@gnome.org>
13991
13992         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13993         on System.Enum.
13994
13995 2002-06-21  Martin Baulig  <martin@gnome.org>
13996
13997         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13998         and called with one of the core types, return the corresponding typebuilder for
13999         that type.
14000
14001         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14002         element type.
14003
14004 2002-06-21  Martin Baulig  <martin@gnome.org>
14005
14006         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14007         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14008         (Expression.ConvertReferenceExplicit): Likewise.
14009
14010         * expression.cs (ElementAccess.DoResolve): Likewise.
14011         (ElementAccess.DoResolveLValue): Likewise.
14012
14013 2002-06-10  Martin Baulig  <martin@gnome.org>
14014
14015         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14016         add the "value" parameter to the parameter list.
14017
14018         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14019         to our caller.
14020
14021 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14022
14023         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14024         the argument to an int, uint, long or ulong, per the spec.  Also
14025         catch negative constants in array creation.
14026
14027 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14028
14029         * class.cs: do not allow the same interface to appear twice in
14030         the definition list.
14031
14032 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14033
14034         * ecore.cs: don't use ldlen with System.Array.
14035
14036 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14037
14038         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14039
14040 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14041
14042         * modifiers.cs: produce correct field attributes for protected
14043         internal. Easy fix so miguel can work on ther harder stuff:-)
14044
14045 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14046
14047         * pending.cs: New file.  Move the code from class.cs here.
14048         Support clearning the pending flag for all methods (when not doing
14049         explicit interface implementation).
14050
14051 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14052
14053         * rootcontext.cs: added a couple more types needed to bootstrap.
14054
14055 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14056
14057         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14058         constructor in the type, instead of any constructor in the type
14059         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14060         a bug in the Mono runtime when applying the params attribute). 
14061
14062 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14063         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14064
14065 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14066
14067         * expression.cs (Unary.ResolveOperator): Use TypeManager
14068         to resolve the type.
14069
14070 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14071
14072         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14073         attached.
14074
14075         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14076         with each member too.
14077
14078         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14079         field builders too - this takes care of the enum member case.
14080
14081 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14082
14083         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14084         address-of operator on both value types and pointers.
14085
14086 2002-06-10  Martin Baulig  <martin@gnome.org>
14087
14088         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14089         PropertyBuilder to the `property_builders' list.
14090
14091         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14092         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14093         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14094         find any indexers which are inherited from an interface.
14095
14096 2002-06-09  Martin Baulig  <martin@gnome.org>
14097
14098         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14099         the same type as the constant if necessary.  There's also a test-130.cs
14100         for this.
14101
14102         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14103
14104         * typemanager.cs (TypeManager.ChangeType): Previously known as
14105         Enum.ChangeEnumType().
14106
14107 2002-06-09  Martin Baulig  <martin@gnome.org>
14108
14109         * expression.cs (Cast.TryReduce): Added support for consts.
14110
14111 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14112
14113         * class.cs (Accessor): Hold attributes information so we can pass
14114         it along.
14115
14116         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14117         Modify to pass in attributes attached to the methods.
14118
14119         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14120
14121         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14122         to handle the Accessor kind :-)
14123
14124         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14125
14126 2002-06-08  Martin Baulig  <martin@gnome.org>
14127
14128         * expression.cs (Unary.TryReduceNegative): Added support for
14129         ULongConstants.
14130
14131 2002-06-08  Martin Baulig  <martin@gnome.org>
14132
14133         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14134         name can't be found in the `defined_names' - the caller will do a
14135         MemberLookup in this case and thus find methods in System.Enum
14136         such as Enum.IsDefined().
14137
14138 2002-06-08  Martin Baulig  <martin@gnome.org>
14139
14140         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14141         Convert.ChangeType() which works with TypeBuilder created types.
14142         (Enum.LookupEnumValue, Enum.Define): Use it here.
14143
14144         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14145         `TypeBuilder.BaseType != null' check.
14146         (TypeContainer.FindMembers): Only lookup parent members if we
14147         actually have a parent.
14148         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14149         (ConstructorInitializer.Resolve): Likewise.
14150
14151         * interface.cs (Interface.FindMembers): Added
14152         `TypeBuilder.BaseType != null' check.
14153
14154         * rootcontext.cs (RootContext.ResolveCore): Added
14155         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14156         classes_second_stage.
14157
14158         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14159         debug_type and trace_type when compiling with --nostdlib.       
14160
14161 2002-06-07  Martin Baulig  <martin@gnome.org>
14162
14163         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14164         (AddField): Set it to true when adding a non-static field.
14165         (DefineType): Use `have_nonstatic_fields' to find out whether we
14166         have non-static fields, not `Fields != null'.
14167
14168 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14169
14170         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14171         dereferencing a null on the static-field code path)
14172
14173 2002-05-30  Martin Baulig  <martin@gnome.org>
14174
14175         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14176         to take command line arguments.  Use reflection to call the new
14177         custom `Initialize' function on the symbol writer and pass it the
14178         command line arguments.
14179
14180         * driver.cs (--debug-args): New command line argument to pass command
14181         line arguments to the symbol writer.
14182
14183 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14184
14185         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14186         the target type for indexers and properties.  Thanks to Joe for
14187         catching this.
14188
14189 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14190
14191         * typemanager.cs (MethodFlags): returns the method flags
14192         (Obsolete/ShouldIgnore) that control warning emission and whether
14193         the invocation should be made, or ignored. 
14194
14195         * expression.cs (Invocation.Emit): Remove previous hack, we should
14196         not do this on matching a base type, we should do this based on an attribute
14197
14198         Only emit calls to System.Diagnostics.Debug and
14199         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14200         on the command line.
14201
14202         * rootcontext.cs: Global settings for tracing and debugging.
14203
14204         * cs-tokenizer.cs (define): New utility function to track
14205         defines.   Set the global settings for TRACE and DEBUG if found.
14206
14207 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14208
14209         * interface.cs (Populate*): Pass in the TypeContainer as well as
14210         the DeclSpace as parameters so that we can create EmitContexts and
14211         then use that to apply attributes etc.
14212
14213         (PopulateMethod, PopulateEvent, PopulateProperty)
14214         (PopulateIndexer): Apply attributes everywhere.
14215
14216         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14217         etc.
14218
14219         (ApplyAttributes): Update accordingly.
14220
14221         We now apply interface attributes for all members too.
14222
14223 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14224
14225         * class.cs (Indexer.Define); Correctly check if we are explicit
14226         implementation (instead of checking the Name for a ".", we
14227         directly look up if the InterfaceType was specified).
14228
14229         Delay the creation of the PropertyBuilder.
14230
14231         Only create the PropertyBuilder if we are not an explicit
14232         interface implementation.   This means that explicit interface
14233         implementation members do not participate in regular function
14234         lookups, and hence fixes another major ambiguity problem in
14235         overload resolution (that was the visible effect).
14236
14237         (DefineMethod): Return whether we are doing an interface
14238         implementation. 
14239
14240         * typemanager.cs: Temporary hack until we get attributes in
14241         interfaces (Ravi is working on that) and we get IndexerName
14242         support in interfaces.
14243
14244         * interface.cs: Register the indexers as properties.
14245
14246         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14247         warning, I have verified that this is a bug in the .NET runtime
14248         (JavaScript suffers of the same problem).
14249
14250         * typemanager.cs (MemberLookup): When looking up members for
14251         interfaces, the parent of an interface is the implicit
14252         System.Object (so we succeed in searches of Object methods in an
14253         interface method invocation.  Example:  IEnumerable x;  x.ToString
14254         ()) 
14255
14256 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14257
14258         * class.cs (Event): Events should also register if they do
14259         implement the methods that an interface requires.
14260
14261         * typemanager.cs (MemberLookup); use the new GetInterfaces
14262         method. 
14263
14264         (GetInterfaces): The code used to lookup interfaces for a type is
14265         used in more than one place, factor it here. 
14266
14267         * driver.cs: Track the errors at the bottom of the file, we kept
14268         on going.
14269
14270         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14271         instance if the method we are calling is static!
14272
14273 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14274
14275         * attribute.cs (ApplyAttributes): Make this function filter out
14276         the IndexerName attribute (as that attribute in reality is never
14277         applied) and return the string constant for the IndexerName
14278         attribute. 
14279
14280         * class.cs (TypeContainer.Emit): Validate that all the indexers
14281         have the same IndexerName attribute, and if so, set the
14282         DefaultName attribute on the class. 
14283
14284         * typemanager.cs: The return value might contain other stuff (not
14285         only methods).  For instance, consider a method with an "Item"
14286         property and an Item method.
14287
14288         * class.cs: If there is a problem with the parameter types,
14289         return. 
14290
14291 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14292
14293         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14294         looks at user defined conversion after making a call to 
14295         StandardConversionExists - we need this for overload resolution.
14296
14297         * expression.cs : Update accordingly the various method calls.
14298
14299         This fixes 2 bugs filed against implicit user defined conversions 
14300
14301 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14302
14303         * statement.cs: Track the result of the assignment.
14304
14305 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14306
14307         * expression.cs (MemberAccess): Improved error reporting for
14308         inaccessible members.
14309
14310 2002-05-22  Martin Baulig  <martin@gnome.org>
14311
14312         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14313         itself with debugging support.
14314
14315 2002-05-22  Martin Baulig  <martin@gnome.org>
14316
14317         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14318         Removed, this isn't needed anymore.
14319
14320 2002-05-20  Martin Baulig  <martin@gnome.org>
14321
14322         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14323         be underlying type for an enum.
14324
14325 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14326
14327         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14328         that splits out the loading of just the core types.
14329
14330         * rootcontext.cs (ResolveCore): Split the struct resolution in
14331         two, so we can load the enumeration underlying types before any
14332         enums are used.
14333
14334         * expression.cs (Is): Bandaid until we fix properly Switch (see
14335         bug #24985 for details).
14336
14337         * typemanager.cs (ImplementsInterface): The hashtable will contain
14338         a null if there are no interfaces implemented.
14339
14340 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14341
14342         * cs-parser.jay (indexer_declarator): It is fine to have array
14343         parameters
14344
14345 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * typemanager.cs: (RegisterBuilder): New function used to register
14348         TypeBuilders that implement interfaces.  Since
14349         TypeBuilder.GetInterfaces (as usual) does not work with lame
14350         Reflection.Emit. 
14351         (AddUserType): register interfaces.
14352
14353         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14354         dealing with TypeBuilder.  Also, arrays are showing up as
14355         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14356         methods can not be invoked on them!
14357
14358         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14359         (ImplicitReferenceConversionExists): Split out from
14360         StandardConversionExists. 
14361
14362         * expression.cs (As): We were only implementing one of the three
14363         cases for the as operator.  We now implement them all.
14364         (Is): Implement the various other cases for Is as well.
14365
14366         * typemanager.cs (CACHE): New define used to control if we want or
14367         not the FindMembers cache.  Seems to have a negative impact on
14368         performance currently
14369
14370         (MemberLookup): Nested types have full acess to
14371         enclosing type members
14372
14373         Remove code that coped with instance/static returns for events, we
14374         now catch this in RealFindMembers.
14375
14376         (RealFindMembers): only perform static lookup if the instance
14377         lookup did not return a type or an event.  
14378
14379 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14380
14381         * assign.cs (CompoundAssign): We pass more semantic information
14382         now to Compound Assignments than we did before: now we have all
14383         the information at hand, and now we resolve the target *before* we
14384         do the expression expansion, which allows the "CacheValue" method
14385         to have the effect we intended (before, a [x] += 1 would generate
14386         two differen ArrayAccess expressions from the ElementAccess,
14387         during the resolution process).
14388
14389         (CompoundAssign.DoResolve): Resolve target and original_source here.
14390
14391 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * expression.cs (ArrayAccess): dropped debugging information. 
14394
14395         * typemanager.cs: Small bug fix: I was always returning i_members,
14396         instead of one of i_members or s_members (depending on which had
14397         the content).
14398
14399         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14400         method is invoked before any code generation takes place, and it
14401         is a mechanism to inform that the expression will be invoked more
14402         than once, and that the method should use temporary values to
14403         avoid having side effects
14404
14405         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14406
14407         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14408         implementation.
14409
14410         * expression.cs (Indirection, ArrayAccess): Add support for
14411         CacheTemporaries in these two bad boys. 
14412
14413         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14414         ldobj or ldind_ref.  
14415         (StoreFromPtr): Handle stobj as well.
14416
14417         * expression.cs (UnaryMutator): Share more code.
14418
14419         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14420         down: I was not tracking the Filter function as well, which
14421         was affecting the results of the cache.
14422
14423 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14424
14425         * attribute.cs: Remove the hack to handle the CharSet property on
14426         StructLayouts. 
14427
14428 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14429
14430         * attribute.cs (DoResolve): More uglyness, we now only try to
14431         resolve the attribute partially, to extract the CharSet
14432         information (only if we are a StructLayout attribute).  Otherwise 
14433
14434         (GetExtraTypeInfo): Add some code to conditionally kill in the
14435         future this.   I am more and more convinced that the .NET
14436         framework has special code to handle the attribute setting on
14437         certain elements.
14438
14439         * expression.cs (IsParamsMethodApplicable): Revert my previous
14440         foreach change here, it was wrong.
14441
14442 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14443
14444         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14445         (pp_expr): do not abort on unknown input, just return.
14446         (eval): abort if there are pending chars.
14447
14448         * attribute.cs (Attribute.Resolve): Positional parameters are
14449         optional.  Deal with that case.
14450
14451         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14452         the Ansi/Unicode/Auto information for the type.
14453
14454         (TypeContainer.DefineType): instantiate the EmitContext here, as
14455         we will be using it during the type definition (to resolve
14456         attributes) and during the emit phase.
14457
14458         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14459         to pull type information out of the attributes
14460
14461         (Attribute.Resolve): track the constructor builder, and allow for
14462         multiple invocations (structs and classes will use this).
14463
14464         * ecore.cs (MemberLookupFinal): new version with all the
14465         parameters customizable.
14466
14467         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14468         constructors.  Return if the result value is null (as the error
14469         would have been flagged already by MemberLookupFinal)
14470
14471         Do not allow instances of abstract classes or interfaces to be
14472         created.
14473
14474         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14475         We have to compare the assembly property here when dealing with
14476         FamANDAssem and Assembly access modifiers, because we might be
14477         creating an assembly from *modules* (that means that we are not
14478         getting TypeBuilders for types defined in other modules that are
14479         part of this assembly).
14480
14481         (Method.Emit): If the method is marked abstract and has a body,
14482         emit an error. 
14483
14484         (TypeContainer.DefineMembers): If both the defined member and the
14485         parent name match are methods, then do not emit any warnings: let
14486         the Method.Define routine take care of flagging warnings.  But if
14487         there is a mismatch (method overrides something else, or method is
14488         overriwritten by something, then emit warning).
14489
14490         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14491         set to null, this means `do not check for the return type on the
14492         signature'. 
14493
14494         (Method.Define): set the return type for the method signature to
14495         null, so that we get methods with the same name and parameters and
14496         different return types.  This is used to flag warning 114 (you are
14497         hiding a method, and you probably want to use the new/override
14498         keywords instead).
14499
14500         * typemanager.cs (MemberLookup): Implemented proper access
14501         control, closing a long standing set of bug reports.  The problem
14502         was that the Framework only has two bits: Public and NonPublic,
14503         and NonPublic includes private and protected methods, but we need
14504         to enforce the FamANDAssem, FamOrAssem and Family. 
14505
14506 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14507
14508         * statement.cs (GotoCase): Return true: Ammounts to giving up
14509         knowledge on whether we return or not, and letting the other case
14510         be responsible for it.
14511
14512 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14513
14514         * driver.cs: Do not load directories for each file processed, only
14515         do it if there is a pattern.
14516
14517         * ecore.cs: Report readonly assigns here as well, as we might have
14518         been resolved only by MemberAccess.
14519
14520         (SimpleName.SimpleNameResolve): Also be useful for LValue
14521         resolution.   We need this to propagate assign to local readonly variables
14522
14523         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14524         do not want to reuse potential criteria memory.
14525
14526         * class.cs (MyEventBuilder): Set reflected_type;
14527
14528         * ecore.cs (Constantify): Added support for constifying bools.
14529
14530         (RootContext.LookupType): Added a cache for values looked up in
14531         the declaration space.
14532
14533         * typemanager.cs (FindMembers): Now is a front-end to
14534         RealFindMembers, and provides a two-level hashtable-based cache to
14535         the request.  
14536
14537         15% performance improvement: from 22.5 to 19.2 seconds.
14538
14539         * expression.cs (IsParamsMethodApplicable): use foreach.
14540         (Invocation.DoResolve): ditto.
14541         (New.DoResolve): ditto.
14542         (ArrayCreation.DoResolve): ditto.
14543
14544         * ecore.cs (FindMostEncompassingType): use foreach.
14545
14546         * delegate.cs (NewDelegate.DoResolve): Use foreach
14547
14548         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14549         (RemoveMethods): use foreach.
14550
14551         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14552         nested foreach statements instead of for, and also break out of
14553         the inner loop once a match is found.
14554
14555         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14556
14557 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14558
14559         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14560         we actually unwrap the expression to allow for extra information
14561         to be extracted. 
14562
14563         * expression.cs: Use Shr_Un on unsigned operations. 
14564
14565 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14566
14567         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14568         applicable operators was not being considered correctly. This closes
14569         the bug Miguel reported.
14570
14571 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14572
14573         * attribute.cs: check that the type derives from System.Attribute
14574         and report the correct error in that case (moved the duplicate code to
14575         its own method, too).
14576
14577 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14578
14579         * attribute.cs: lookup attribute type name as the spec says: first the
14580         bare attribute name and then name + "Attribute" (nant compiles with
14581         mcs after this fix).
14582
14583 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14584
14585         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14586         Because of the way we parse things, we should try to see if a
14587         UIntConstant can fit in an integer.
14588
14589 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14590
14591         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14592         when we are in an explicit context.
14593
14594         (ConvertReferenceExplicit): When converting from Iface type S to Class
14595         T make sure the rules are implemented as an OR.
14596
14597         * parameter.cs (ParameterType): Make it a property for now although the
14598         purpose really isn't anything immediate.
14599
14600         * expression.cs (Is*Applicable): Do better checking on the parameter type
14601         of a ref/out parameter. The ones from the system assemblies are already 
14602         marked with the correct type so we don't need to do any correction.
14603
14604         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14605         the object type is standard too so include that.
14606
14607 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14608
14609         * ecore.cs (StandardConversionExists): Augment with missing code:
14610         deal with IntConstant, LongConstants and Enumerations.
14611
14612         * assign.cs: Report the error, instead of failing silently
14613
14614         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14615         typecontainer that they are declared, because the
14616         typecontainer/namespace will have the list of using clauses that
14617         need to be applied.
14618
14619         Assembly Attributes were escaping the normal registration
14620         mechanism. 
14621
14622         (EmitCode): Apply attributes within an EmitContext that represents
14623         the container they were declared on.
14624
14625         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14626
14627 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14628
14629         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14630         Revamp completely - make much cleaner as we now operate only
14631         on a set of Types.
14632
14633         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14634         to implement the logic detailed in the spec more correctly.
14635
14636         (UserDefinedConversion): Update accordingly.
14637
14638 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14639
14640         * statement.cs: Return flow analysis information up.
14641
14642         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14643         and the default.
14644
14645         (token): Do not consume an extra character before calling
14646         decimal_digits.
14647
14648 2002-05-06  Piers Haken <piersh@friskit.com>
14649
14650         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14651
14652 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14653
14654         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14655         EmitContext during the instance constructor initializer
14656         resolution, to stop access to instance variables.
14657
14658         This is mandated by the spec, last paragraph of the `constructor
14659         initializers' section. 
14660
14661 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14662
14663         * cs-parser.jay, class.cs (Accessor): new class used to represent
14664         an accessor (get or set).  In the past we used `null' to represent
14665         a missing accessor.  But this is ambiguous because there was no
14666         way to tell in abstract indexers/properties if one of them was
14667         specified.
14668
14669         Now there is a way of addressing that.
14670
14671         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14672         instead of FindMembers.
14673
14674         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14675         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14676
14677         * attribute.cs: Treat indexers and properties as the same in terms
14678         of applying attributes
14679
14680         * ecore.cs (FindMostEncompassedType): Use statically initialized
14681         EmptyExpressions()s like we do elsewhere to avoid creating useless
14682         objects (and we take this out of the tight loop).
14683
14684         (GetConversionOperators): Move the code to extract the actual
14685         operators to a separate routine to clean things up.
14686
14687 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14688
14689         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14690         events are always registered FieldBuilders.
14691
14692         * class.cs (FieldBase): New class shared by Fields 
14693
14694         * delegate.cs: If we are a toplevel delegate, use our full name.
14695         If we are a nested delegate, then only use our tail name.
14696
14697 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14698
14699         * expression.cs (IsApplicable): Ensure that we add the "&" to
14700         ref/out types before comparing it with the type of the argument.
14701
14702         (IsParamsMethodApplicable): Ditto.
14703
14704         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14705         silly me ;-)
14706
14707         * delegate.cs : Handle the case when we have more than one applicable
14708         method. Flag an error only when we finish checking all.
14709
14710 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14711
14712         * expression.cs: Add support for boolean static initializers.
14713
14714 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14717
14718         * parameter.cs (ComputeParameterTypes,
14719         ComputeAndDefineParameterTypes): Better error handling: now we
14720         clear the `types' cache if we fail during any of the type lookups.
14721         We also return the status code correctly to our caller
14722
14723         * delegate.cs: If we fail to define a delegate, abort the extra
14724         steps. 
14725
14726         * expression.cs (Binary.ResolveOperator): for
14727         operator==(object,object) and operator !=(object, object) we also
14728         have to verify that there is an implicit conversion from one to
14729         the other.
14730
14731         (ArrayAccess.DoResolve): Array Access can operate on
14732         non-variables. 
14733
14734 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14735
14736         * assign.cs (CompoundAssign): A new class used as a "flag" that
14737         the assignment actually is happening as part of a compound
14738         assignment operator.
14739
14740         During compound assignment, a few new rules exist to enable things
14741         like:
14742
14743         byte b |= 1 + 2
14744
14745         From the spec:
14746
14747         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14748         to the type of x) if y is implicitly convertible to the type of x,
14749         and the operator is a builtin operator and the return type of the
14750         operator is explicitly convertible to the type of x. 
14751
14752         * rootcontext.cs: Reset warning level to 2.  4 catches various
14753         "interesting" features in mcs, we must clean this up at some
14754         point, but currently am trying to kill other bugs ;-)
14755
14756         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14757         in container classes as well.  
14758
14759         * expression.cs (Binary.ResolveOperator): Handle string case
14760         before anything else (as operator overloading does emit an error
14761         before doing anything else).
14762
14763         This code could go away when we move to a table driven model, but
14764         i could not come up with a good plan last night.
14765
14766 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14767
14768         * typemanager.cs (CSharpName): reimplementation using regex.
14769         * class.cs: added null check for fields in Emit
14770         * rootcontext.cs: set warninglevel to 4
14771
14772 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14773
14774         * typemanager.cs (CSharpName): reimplemented with Lupus
14775         suggestion.
14776
14777 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14778
14779         * statement.cs (If): correclty implement Resolve, because we were
14780         not catching sem errors in there.  The same process is needed
14781         everywhere else. 
14782         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14783
14784
14785         (Statement.Warning_DeadCodeFound): Factorize code.
14786         (While): Report dead code here too.
14787
14788         (Statement): Added Resolve virtual method to allow
14789         for resolution split from the emit code.
14790
14791 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14792
14793         * statement.cs (EmitBoolExpression): No longer try to resolve the
14794         expression here.    
14795         (MakeBoolean): New utility function that resolve, implicitly
14796         converts to boolean and tags the expression. 
14797
14798
14799         (If, Do): Implement dead code elimination.
14800         (While): Implement loop inversion
14801
14802         (Do, While, For, If): Resolve the expression prior to calling our
14803         code generation.
14804
14805 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14806
14807         * class.cs:
14808           - added method Report28 (warning: program has more than one entry point)
14809           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14810           - modified method Method.Define, the part at the end of the method
14811
14812         * rootcontext.cs: added static public Location EntryPointLocation;
14813           
14814         * ../errors/cs0028.cs : Add test case for the above warning.              
14815
14816         * typemanager.cs:
14817           - modified method CSharpName to allow arrays of primitive type to
14818             be printed nicely (e.g. instead of System.Int32[][] it now prints
14819             int[][])
14820           - added method CSharpSignature: returns the signature of a method
14821             in string format to be used in reporting errors, warnings, etc.
14822
14823         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14824         with String.Empty.
14825
14826 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14827
14828         * delegate.cs (Define): Fix extremely silly bug where I was
14829         setting the type of the 'object' parameter of the BeginInvoke
14830         method to System.IAsyncResult instead of System.Object ;-)
14831
14832 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14833
14834         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14835         here. 
14836
14837         (Constructor.Emit): return if we fail to initialize the
14838         constructor.  Another door closed!  
14839
14840         * expression.cs (New.DoResolve): Improve error message (from -6 to
14841         1501).  Use DeclaredOnly lookup to find the exact constructor.
14842
14843         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14844         loop.  This is useful.
14845
14846         * cs-parser.jay: Adjust the default parameters so that destructors
14847         have the proper signature.
14848
14849 2002-04-26  Martin Baulig  <martin@gnome.org>
14850
14851         * driver.cs (LoadAssembly): If `assembly' contains any characters
14852         which are only valid in path names and not in assembly names
14853         (currently slash, backslash and point), use Assembly.LoadFrom ()
14854         instead of Assembly.Load () on the `assembly' (before iteration
14855         over the link_paths).
14856
14857 2002-04-26  Martin Baulig  <martin@gnome.org>
14858
14859         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14860
14861 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * class.cs (Property): use the new typemanager.MemberLookup
14864
14865         (TypeContainer.MemberLookup): Implement using the
14866         TypeManager.MemberLookup now. 
14867
14868         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14869         and return MemberInfos, so that these can be used without an
14870         EmitContext (what we had before).
14871
14872 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14873
14874         * expression.cs: Fix the case where the argument to params if the
14875         type of the params.  I omitted handling this before.   Fixed
14876
14877 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14878
14879         * driver.cs: Call BootCorlib_PopulateCoreType
14880
14881         * class.cs (Property.CheckBase): Check for properties only, not
14882         for all members. 
14883
14884         * interface.cs: Temporary hack: try/catch around the
14885         CustomAttributeBuilder, because I am getting an exception that I
14886         do not understand.
14887
14888         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14889         types whose definitions are required to be there (attributes are
14890         defined before standard types).
14891
14892         Compute definitions as we boot the various types, as they are used
14893         immediately (value_type class will need object_type, but if we do
14894         not initialize object_type, we will pass a null, which will let
14895         the runtime pick the System.Object from the existing corlib, which
14896         is not what we want).
14897
14898 2002-04-22  Patrik Torstensson <totte@labs2.com>
14899
14900         * cs-tokenizer.cs: fixed a number of trim() issues.
14901
14902 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14903
14904         * expression.cs (Argument.Type): Ensure that we return the correct
14905         type when we have out or ref parameters [in which case we 
14906         append a "&"].
14907
14908 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14909
14910         * class.cs (Property, Indexer): Allow extern modifier in there. 
14911
14912         * typemanager.cs (InitBaseTypes): Initializes object_type and
14913         value_type, since those will be used early on during the bootstrap
14914         process to compile corlib.
14915
14916         (InitCoreTypes): Move code from here to InitBaseTypes.
14917
14918 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14919
14920         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14921         single-dimension arrays as using the ldlen opcode.  
14922
14923         Daniel Lewis discovered this optimization.  
14924
14925         * typemanager.cs: Add signature for System.Array::get_Length
14926
14927 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14928
14929         * statement.cs: report the error when the foreach does not apply to an
14930         array nor a collection.
14931
14932 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14933
14934         * expression.cs: Add implicit conversions to the operator ~.
14935
14936         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14937
14938         * typemanager.cs: Locate the decimal constructor.
14939
14940 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14941
14942         * attribute.cs: use the new property of TypeOf.
14943         * expression.cs: added 'get' property around typearg.
14944
14945         These changes fix a build breaker reported by NickD. Is this the
14946         correct way to fix?  If not, please, revert my changes and make it
14947         work :-).
14948
14949 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14950
14951         * attribute.cs: Add support for typeof in attribute invocations.
14952         I am not sure that this is right though.
14953
14954 2002-04-14  Duncan Mak  <duncan@ximian.com>
14955
14956         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14957         Binary.Operator.Division case.
14958
14959 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14960
14961         * class.cs (DefineType): Ensure that we do a proper check on
14962         attribute types and also register it with the TypeManager.
14963
14964         (TypeContainer.Targets): The default for attribute types is
14965         AttributeTargets.All.
14966
14967         * attribute.cs (ApplyAttributes): Registering the attribute type
14968         is done elsewhere, not when we discover we have a Usage attribute.
14969
14970 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14971
14972         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14973         and get rid of is_delegate parameter.
14974
14975         * everywhere : update.
14976
14977 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14978
14979         * cs-parser.jay (compilation_unit): Revamp completely to use
14980         some new ideas that I got from Rhys' grammar to solve the problems
14981         with assembly level attributes.
14982
14983         (outer_declaration): New grammar production.
14984
14985         (attribute_sections): Add.
14986
14987         (opt_attributes): Base on attribute_sections
14988
14989         (namespace_declaration): Allow opt_attributes to tackle the case
14990         when we have assembly level attributes - we are clever in this
14991         regard now ;-)
14992
14993         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14994         attributes in the non-global context.
14995
14996         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14997         instead of SetGlobalAttributes.
14998
14999         * class.cs, rootcontext.cs : Ensure we define and generate 
15000         attribute types before anything else.
15001
15002         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15003         and flag the new error -20 for the case when the attribute type
15004         does not have valid targets specified. csc does not catch this.
15005
15006         * ../errors/errors.txt : update for error # -20
15007
15008 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15009
15010         * support.cs (InternalParameters.ParameterModifier): Do some null
15011         checking and return sane values.
15012
15013         * class.cs (Method.Define): If we are a PInvoke method, ensure
15014         that we are static and extern. Report error # 601
15015
15016         * ../errors/cs0601.cs : Add test case for the above error.
15017
15018 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15019
15020         * rootcontext.cs (attribute_types): We need to keep type of
15021         all attribute types separately and emit code for them first.
15022
15023         (RegisterAttribute) : Implement.
15024
15025         * class.cs (DefineType): Check if the current Type is a custom
15026         attribute type and register it accordingly.
15027
15028         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15029         adding the first attribute twice and rename to
15030
15031         (SetGlobalAttributes): this.
15032
15033         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15034         lookups.
15035
15036         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15037         if we are processing global arguments. Hmm, I am unsure of this.
15038
15039 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15040
15041         * expression.cs: added static array of strings to avoid calling
15042         Enum.ToString () for Operator in Binary. Significant recover of
15043         performance.
15044
15045 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15046
15047         * class.cs (FindMembers): Allow the Builders of the various
15048         members to be null.  If they are skip them.  This only happens
15049         during the PInvoke declaration.
15050
15051 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15052
15053         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15054         failure, so we do not keep going afterwards.
15055
15056         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15057         wanted to pass `false' as the `is_delegate' argument.  If this is
15058         the case, why not use delegate_type == null to mean `is_delegate =
15059         false' and anything else as is_delegate = true.
15060
15061 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15062
15063         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15064         code for the section, not the beginning of the tests.
15065
15066 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15067
15068         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15069
15070         * expression.cs (Binary): same.  Warn about errors where we have
15071         Enum/Enum in operator + as well.
15072
15073 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15074
15075         * statement.cs:
15076                 - added support for switch(bool)
15077                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15078                 - add TableSwitchEmit() to handle table-based switch statements
15079
15080 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15081
15082         * expression.cs (Invocation.OverloadResolve): Factor out code which
15083         does parameter compatibility checking with arguments so that we can 
15084         re-use the code even from Delegate.VerifyApplicability
15085
15086         (VerifyArgumentsCompat): Move above code here.
15087
15088         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15089         and instead make a call to the above method.
15090
15091 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15092
15093         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15094         We use it to keep track of classes which are attribute types.
15095
15096 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * delegate.cs (Delegate.Define): Correctly define the types in the
15099         presence of fixed and array parameters.
15100
15101         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15102         doing FindMembers.
15103
15104         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15105         include NonPublic after the first iteration.
15106
15107         * class.cs (Indexer.CheckBase): Only check if both parents are
15108         non-null. 
15109
15110         * cs-parser.jay (accessor_body): If empty, set to null.
15111
15112         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15113         same code path here to resolve constants names that we did have in
15114         MemberAccess.DoResolve.  There is too much code duplicated here.
15115
15116 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15117
15118         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15119
15120         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15121         to MakeUnionSet.
15122
15123         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15124         tokens, numbers and strings.
15125
15126         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15127         parenthesis.
15128
15129         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15130         asyncronous parameters and the regular parameters.  
15131
15132         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15133         specify the target directory.
15134
15135         * expression.cs: (This.DoResolve): Simplify
15136         (As.Emit): Optimize, do not generate IsInst if the expression is
15137         always of the given type.
15138
15139         (Is.DoResolve): Bug fix, we were reporting both always/never for
15140         the is expression.
15141
15142         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15143         creating too many unnecessary arrays.
15144
15145 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15146
15147         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15148         fields instead of rolling our own initializer.   Takes care of all
15149         implicit conversions, and drops unnecessary static checks/argument.
15150
15151 2002-03-31  Dick Porter  <dick@ximian.com>
15152
15153         * driver.cs: use the GetDirectories() return values properly, and
15154         use "/" as path separator.
15155
15156 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15157
15158         * expression.cs (Unary): Optimize - - expr into expr.
15159         (Binary): Optimize a + (-b) into a -b.
15160
15161         * codegen.cs (CodeGen): Made all methods static.
15162
15163 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15164
15165         * rootcontext.cs: 
15166
15167         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15168         TypeBuilder property.
15169
15170         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15171         instead. 
15172
15173         * tree.cs: Removed the various RecordXXXX, and replaced with a
15174         single RecordDecl.  Removed all the accessor methods, and just
15175         left a single access point Type 
15176
15177         * enum.cs: Rename DefineEnum to DefineType.
15178
15179         * decl.cs: New abstract method `DefineType' used to unify the
15180         Defines for Enumerations, Interfaces, TypeContainers and
15181         Delegates.
15182
15183         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15184         LookupBaseClasses method that used to live in class.cs and
15185         interface.cs here, and renamed to FindType.
15186
15187         * delegate.cs: Implement DefineType.  Take advantage of the
15188         refactored pattern for locating the parent builder without taking
15189         the parent_builder argument (which we know does not work if we are
15190         nested, and triggering a toplevel definition).
15191
15192 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15193
15194         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15195         accessibility of a member has changed during override and report
15196         an error if so.
15197
15198         * class.cs (Method.Define, Property.Define): Only complain on
15199         overrides if the method is private, any other accessibility is
15200         fine (and since we just checked the permission is the same, we are
15201         good to go).
15202
15203         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15204         and elif are processed always.  The other pre-processing
15205         directives are only processed if we are "taking" the path
15206
15207 2002-03-29  Martin Baulig  <martin@gnome.org>
15208
15209         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15210         current location is not Null.
15211
15212         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15213         a separate method so we can profile it.
15214
15215         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15216         `span.Seconds' are just seconds, but no minutes or hours.
15217         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15218
15219 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15220
15221         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15222         Remove the gratuitous set of Final:
15223
15224                                 // If an interface implementation, then we can set Final.
15225                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15226                                     implementing.DeclaringType.IsInterface)
15227                                         flags |= MethodAttributes.Final;
15228
15229         I do not know what I was smoking when I used that.
15230
15231
15232         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15233         step into fixing the name resolution issues for delegates and
15234         unifying the toplevel name resolution.
15235
15236 2002-03-28  Martin Baulig  <martin@gnome.org>
15237
15238         * class.cs (Method.Emit): If we have a symbol writer, call its
15239         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15240         tell it about the current method.
15241
15242         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15243         writer that we're going to emit the first byte of IL code for a new
15244         statement (a new source line).
15245         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15246         EmitContext.Mark() before emitting any code.
15247
15248         * location.cs (SymbolDocument): Return null when we're Null.
15249
15250         * statement.cs (Statement): Moved the `Location loc' variable here.
15251         (Statement.EmitBoolExpression): If we have a symbol writer, call
15252         ec.Mark() before emitting any code to tell it that we're at the
15253         beginning of a new statement.
15254         (StatementExpression): Added `Location' argument to the constructor.
15255         (Block): Added public readonly variable `StartLocation' and public
15256         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15257         (Block): Added constructor which takes a start and end location.
15258         (Block.SetEndLocation): New method. This sets the end location.
15259         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15260         local variables we create.
15261         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15262         each statement and do also mark the begin and end of the block.
15263
15264         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15265         tell it the current lexer.Location, use Location.Null for the end of the
15266         block.
15267         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15268         current block, set its end location using SetEndLocation().
15269         (statement_expression): StatementExpression constructor now takes the
15270         lexer.Location as additional argument.
15271         (for_statement, declare_local_variables): Likewise.
15272         (declare_local_variables): When creating a new implicit block, use the
15273         new Block constructor and pass it the lexer.Location.
15274
15275 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15276
15277         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15278         members also on the parent interfaces recursively.
15279
15280 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15281
15282         * report.cs: Use new formats, since Gonzalo finished the missing
15283         bits. 
15284
15285         * expression.cs (Binary.ResolveOperator): added missing operator|
15286         operator& and operator^ for bool/bool.
15287
15288         * cs-parser.jay: CheckDef now takes a Location argument that is
15289         used to report errors more precisly (instead of reporting the end
15290         of a definition, we try to track something which is a lot closer
15291         to the source of the problem).
15292
15293         * cs-tokenizer.cs: Track global token use, so we can properly flag
15294         the use of #define/#undef after the first token has been seen.
15295
15296         Also, rename the reportXXXX to Error_DescriptiveName
15297
15298         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15299         TypeContainer, so that Enum and Interface can use this too.
15300
15301         * class.cs (TypeContainer.LookupInterfaceOrClass,
15302         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15303         `builder' argument.  Typically this was used to pass the parent
15304         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15305         the definition).  
15306
15307         The problem is that a nested class could trigger the definition of
15308         a toplevel class, and the builder would be obviously wrong in that
15309         case. 
15310
15311         So we drop this argument, and we compute dynamically the
15312         TypeBuilder/ModuleBuilder (the correct information was available
15313         to us anyways from DeclSpace.Parent)
15314
15315         * interface.cs (Interface.DefineInterface): Drop builder
15316         parameter cleanup like class.cs
15317
15318         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15319         like class.cs
15320
15321         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15322         values. 
15323
15324         (Try.Emit): Propagate the returns value from the statement.
15325
15326         (Return.Emit): Even if we are leavning 
15327
15328         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15329
15330         * modifiers.cs: Fix the computation of MethodAttributes flags.
15331
15332 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15333
15334         * driver.cs: allow compilation of files that start with '/'.
15335         Add a default case when checking the argument of --target.
15336
15337 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * interface.cs: Implement the same search algorithm for types in
15340         the interface code.
15341
15342         * delegate.cs: Do not allow multiple definition.
15343
15344         * Recovered ChangeLog that got accidentally amputated
15345
15346         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15347
15348         * rootcontext.cs: Load manually enum to allow core classes to
15349         contain enumerations.
15350
15351         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15352         Update to new static methods in TypeManager.
15353
15354         * typemanager.cs (GetMethod, GetConstructor): Use our
15355         implementation of FindMembers to find the members, since during
15356         corlib compilation, the types are TypeBuilders and GetMethod and
15357         GetConstructor do not work.
15358
15359         Make all methods in TypeManager static.
15360
15361         (InitCodeHelpers): Split the functionality from
15362         the InitCodeTypes function.
15363
15364         * driver.cs: Call InitCodeHelpers after we have populated the
15365         types. 
15366
15367         * cs-parser.jay (delegate_declaration): we did not used to compute
15368         the delegate name correctly for void delegates.
15369
15370 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15371
15372         * rootcontext.cs (RootContext): Init the interface_resolve_order
15373         and type_container_resolve_order always.
15374
15375         (ResolveCore, BootstrapCorlib_ResolveClass,
15376         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15377         compiler when compiling with --nostdlib
15378
15379         * class.cs (TypeContainer.DefineType): Check that our parent is
15380         not null.  This test is most important when we are bootstraping
15381         the core types.
15382
15383         * codegen.cs: Split out the symbol writing code.
15384
15385 2002-03-25  Martin Baulig  <martin@gnome.org>
15386
15387         * driver.cs (-g): Made -g an alias for --debug.
15388
15389 2002-03-24  Martin Baulig  <martin@gnome.org>
15390
15391         * codegen.cs (SymbolWriter): New public variable. Returns the
15392         current symbol writer.
15393         (CodeGen): Added `bool want_debugging_support' argument to the
15394          constructor. If true, tell the ModuleBuild that we want debugging
15395         support and ask it for the ISymbolWriter.
15396         (Save): If we have a symbol writer, call it's Close() method after
15397         saving the assembly.
15398
15399         * driver.c (--debug): New command line argument to create a
15400         debugger information file.
15401
15402         * location.cs (SymbolDocument): New public property. Returns an
15403         ISymbolDocumentWriter object for the current source file or null
15404         if we don't have a symbol writer.
15405
15406 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15407
15408         * driver.cs (LoadAssembly): Correctly return when all the paths
15409         have been tried and not before.
15410
15411         * statement.cs (Switch.Emit): return the actual coverage for this
15412         statement (returns/not-returns)
15413
15414         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15415         switch of the statement if we are the last switch section.  That
15416         kills two problems: try/catch problems (we used to emit an empty
15417         nop at the end) and switch statements where all branches would
15418         return. 
15419
15420 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15421
15422         * driver.cs: Add default assemblies (the equivalent to the
15423         Microsoft CSC.RSP file)
15424
15425         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15426         also update tokens_seen and set it to false.
15427
15428         * driver.cs: Implement --recurse for Mike.
15429
15430         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15431         correctly splitting out the paths.
15432
15433 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15434
15435         * interface.cs (Interface.PopulateProperty): Instead of using
15436         `parent' as the declaration space for the set parameters, use
15437         `this' 
15438
15439         * support.cs (InternalParameters): InternalParameters constructor
15440         takes a DeclSpace instead of a TypeContainer.
15441
15442         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15443         types are being initialized, load the address of it before calling
15444         the function.  
15445
15446         (New): Provide a mechanism to disable the generation of local
15447         value type temporaries when the caller will be providing us with
15448         an address to store it.
15449
15450         (ArrayCreation.EmitDynamicInitializers): Use it.
15451
15452 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15453
15454         * expression.cs (Invocation.EmitArguments): Only probe for array
15455         property if there is more than one argument.  Sorry about that.
15456
15457         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15458         empty param arrays.
15459
15460         * class.cs (Method.LabelParameters): Fix incorrect code path that
15461         prevented the `ParamArrayAttribute' from being applied to the
15462         params attribute.
15463
15464 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15465
15466         * support.cs (ReflectionParameters): Correctly compute whether the
15467         last argument is a params array.  Fixes the problem with
15468         string.Split ('a')
15469
15470         * typemanager.cs: Make the assemblies array always be non-null
15471         (empty, but non-null)
15472
15473         * tree.cs (RecordDecl): New function that abstracts the recording
15474         of names.  This reports error 101, and provides a pointer to the
15475         previous declaration.  Fixes a crash in the compiler.
15476
15477         * cs-parser.jay (constructor_declaration): Update to new grammar,
15478         and provide a constructor_body that can be empty.
15479
15480 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15481
15482         * driver.cs: Add support for --resources.
15483
15484         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15485         Make all types for the various array helper methods be integer.
15486
15487         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15488         CheckState to ConvCast.
15489
15490         (ConvCast): Now it takes a `checked' state argument, to avoid
15491         depending on the emit context for the conversion, and just using
15492         the resolve time setting.
15493
15494         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15495         instead of Invocation.EmitArguments.  We do not emit the original
15496         arguments, instead we emit those which have been converted to
15497         unsigned int expressions.
15498
15499         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15500
15501         * codegen.cs: ditto.
15502
15503         * expression.cs (LocalVariableReference): Drop the use of the
15504         Store function that depended on the variable index.
15505
15506         * statement.cs (VariableInfo): Drop the `Idx' property from this
15507         class, as this is not taking into account the indexes for
15508         temporaries tat we generate during the execution, getting the
15509         indexes wrong.
15510
15511         * class.cs: First emit class initializers, then call the parent
15512         constructor. 
15513
15514         * expression.cs (Binary): Fix opcode emision.
15515         (UnaryMutator.EmitCode): Support checked code generation
15516
15517         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15518         matches for events for both the Static and Instance scans,
15519         pointing to the same element.   Fix that.
15520
15521 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * rootcontext.cs (ResolveTree): Always set the
15524         interface_resolve_order, because nested interfaces will be calling
15525         into us.
15526
15527         * class.cs (GetInterfaceOrClass): Track the same resolution
15528         process used by TypeManager.LookupType.  This fixes the nested
15529         type lookups in class declarations (separate path from
15530         LookupType). 
15531
15532         (TypeContainer.DefineType): Also define nested interfaces.
15533         (TypeContainer.RegisterOrder): New public function used to
15534         register the order in which child interfaces need to be closed.
15535
15536         Nested interfaces need to be closed after their parents have been
15537         created. 
15538
15539         * interface.cs (InterfaceAttr): Put all the logic for computing
15540         the interface attribute here. 
15541
15542         (DefineInterface): Register our interface order with the
15543         RootContext or with the TypeContainer depending on the case.
15544
15545 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15546
15547         * cs-parser.jay: rework foreach statement to work with the new
15548         changes to the policy on SimpleNames.
15549
15550         * report.cs: support Stacktrace on warnings as well.
15551
15552         * makefile: drop --unsafe and /unsafe from the compile.
15553
15554 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15555
15556         * ecore.cs (StandardConversionExists): Modify to take an Expression
15557         as the first parameter. Ensure we do null -> reference type conversion
15558         checking.
15559
15560         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15561         temporary Expression objects.
15562
15563 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15564
15565         * interface.cs: workaround bug in method overloading resolution
15566         (there is already a bugzilla bug for it).
15567
15568 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15569
15570         We could also solve this problem by having a separate path for
15571         performing type lookups, instead of DoResolve, we could have a
15572         ResolveType entry point, and only participating pieces of the
15573         production (simplename, deref, array) would implement this. 
15574
15575         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15576         signal SimpleName to only resolve type names and not attempt to
15577         resolve anything else.
15578
15579         * expression.cs (Cast): Set the flag.
15580
15581         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15582
15583         * class.cs: Only report 108 if there is no `new' modifier.
15584
15585         * cs-parser.jay: rework foreach statement to work with the new
15586         changes to the policy on SimpleNames.
15587
15588         * report.cs: support Stacktrace on warnings as well.
15589
15590         * makefile: drop --unsafe and /unsafe from the compile.
15591
15592 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15593
15594         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15595         lookups here, instead of doing that at parse time.  This means
15596         that our grammar will not introduce `LocalVariableReferences' as
15597         expressions at this point.  That solves the problem of code like
15598         this:
15599
15600         class X {
15601            static void Main ()
15602            { int X = 1;
15603             { X x = null }}}
15604
15605         This is only half the fix.  The full fix requires parameters to
15606         also be handled in this way.
15607
15608         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15609         makes the use more obvious of the DeclSpace.  The
15610         ec.TypeContainer.TypeBuilder is now only used to pull the
15611         TypeBuilder for it.
15612
15613         My theory is that I can get rid of the TypeBuilder completely from
15614         the EmitContext, and have typecasts where it is used (from
15615         DeclSpace to where it matters).  
15616
15617         The only pending problem is that the code that implements Aliases
15618         is on TypeContainer, and probably should go in DeclSpace.
15619
15620         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15621         lookups here, instead of doing that at parse time.  This means
15622         that our grammar will not introduce `LocalVariableReferences' as
15623         expressions at this point.  That solves the problem of code like
15624         this:
15625
15626         class X {
15627            static void Main ()
15628            { int X = 1;
15629             { X x = null }}}
15630
15631         This is only half the fix.  The full fix requires parameters to
15632         also be handled in this way.
15633
15634         * class.cs (Property.DefineMethod): When implementing an interface
15635         method, set newslot, when implementing an abstract method, do not
15636         set the flag (before we tried never setting it, or always setting
15637         it, which is the difference).
15638         (Indexer.DefineMethod): same.
15639         (Method.DefineMethod): same.
15640
15641         * ecore.cs: Only set the status used flag if we get back a Field.
15642
15643         * attribute.cs: Temporary hack, so Paolo can keep working.
15644
15645 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15646
15647         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15648         the unmanaged type in the case we have a MarshalAs attribute.
15649
15650         (Resolve): Handle the case when we are parsing the special MarshalAs
15651         attribute [we need to store the unmanaged type to use later]
15652
15653         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15654         MarshalAs Attribute.
15655
15656         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15657         on parameters and accordingly set the marshalling info.
15658
15659 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15660
15661         * class.cs: Optimizing slightly by removing redundant code after
15662         we switched to the `NoTypes' return value.
15663         (Property.DefineMethod): use NoTypes here too.
15664
15665         This fixes the bug I introduced in my last batch of changes.
15666
15667 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15668
15669         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15670
15671         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15672         Enums since those are types too. 
15673
15674         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15675
15676         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15677         thanks to a call during the lookup process.
15678
15679 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15680
15681         * statement.cs (Foreach): Lots of work to accomodate a particular
15682         kind of foreach statement that I had not kept in mind.  It is
15683         possible to have foreachs on classes that provide a GetEnumerator
15684         method that return objects that implement the "pattern" for using
15685         a foreach, there is no need to support GetEnumerator
15686         specifically. 
15687
15688         This is needed to compile nant.
15689
15690         * decl.cs: Only report 114 if the member is not `Finalize' and if
15691         the warning level is at least 2.
15692
15693         * class.cs: Moved the compare function from Method to
15694         MethodSignature. 
15695
15696         (MethodSignature.InheritableMemberSignatureCompare): Add new
15697         filter function that is used to extract inheritable methods from a
15698         class. 
15699
15700         (Method.Define): Use the new `inheritable_method_signature_filter'
15701         delegate
15702
15703         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15704         command. 
15705
15706 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15709
15710         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15711
15712         * expression.cs: Pass location information to
15713         ConvertImplicitStandard. 
15714
15715         * class.cs: Added debugging code to track return values from
15716         interfaces. 
15717
15718 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * expression.cs (Is.DoResolve): If either side of the `is' is an
15721         interface, do not flag the warning.
15722
15723         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15724         for interfaces
15725
15726         * report.cs: Allow for --fatal to be used with --probe.
15727
15728         * typemanager.cs (NoTypes): Move the definition for the empty Type
15729         array here. 
15730
15731         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15732         properties. 
15733         (TypeContainer.DefineProxy): New function used to proxy to parent
15734         implementations when implementing interfaces.
15735         (TypeContainer.ParentImplements): used to lookup if our parent
15736         implements a public function that is required by an interface.
15737         (TypeContainer.VerifyPendingMethods): Hook this up.
15738
15739         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15740         `modules' and `assemblies' arraylists into arrays.  We only grow
15741         these are the very early start up of the program, so this improves
15742         the speedof LookupType (nicely measured).
15743
15744         * expression.cs (MakeByteBlob): Replaced unsafe code with
15745         BitConverter, as suggested by Paolo.
15746
15747         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15748         folding of string concatenation, but if either side is a string,
15749         and the other is not, then return null, and let the runtime use
15750         the concatenation on the string plus the object (using
15751         `Object.ToString'). 
15752
15753 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15754
15755         Constant Folding has been implemented now.
15756
15757         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15758         the error instead on types that are not supported in one's
15759         complement. 
15760
15761         * constant.cs (Constant and all children): New set of functions to
15762         perform implict and explicit conversions.
15763
15764         * ecore.cs (EnumConstant): Implement the new functions to perform
15765         conversion by proxying to the child expression.
15766
15767         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15768         own separate setting that can not be turned off from the command
15769         line using --unchecked or --checked and is only controlled using
15770         the checked/unchecked statements and expressions.  This setting is
15771         used by the constant folder to flag errors.
15772
15773         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15774         ConstantCheckState as well.   
15775
15776         During Resolve, they also have to flag the state, because the
15777         constant folder runs completely in the Resolve phase.
15778
15779         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15780         well.
15781
15782 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15783
15784         * cfold.cs: New file, this file contains the constant folder.
15785
15786         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15787         argument to track whether we are using the resulting address to
15788         load or store a value and provide better error messages. 
15789
15790         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15791         new AddressOf arguments.
15792
15793         * statement.cs (Foreach.EmitCollectionForeach): Update
15794
15795         * expression.cs (Argument.Emit): Call AddressOf with proper
15796         arguments to track usage.
15797
15798         (New.DoEmit): Call AddressOf with new arguments.
15799
15800         (Unary.Emit): Adjust AddressOf call.
15801
15802 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15803
15804         * cs-parser.jay (member_access): Change the case for pre-defined types
15805         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15806         this suggestion.
15807
15808         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15809         a method body.
15810
15811         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15812         essentially like methods and apply attributes like MethodImplOptions to them too.
15813
15814         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15815         not being null.
15816
15817         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15818         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15819         is the DeclSpace.
15820
15821         * Update code everywhere accordingly.
15822
15823         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15824
15825         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15826
15827 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15828
15829         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15830         try performing lookups against those instead of jumping straight into using
15831         the 'using' clauses.
15832
15833         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15834
15835         (LookupType): Perform lookups in implicit parents too.
15836
15837         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15838         sequence as RootContext.LookupType. 
15839
15840         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15841         the various cases of namespace lookups into this method.
15842
15843 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15844
15845         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15846         in positional arguments)
15847
15848         * class.cs (Operator): Update the AllowedModifiers to contain
15849         extern. 
15850
15851         * cs-parser.jay: Update operator declaration to allow for the
15852         operator body to be empty.
15853
15854         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15855         values. 
15856
15857 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15858
15859         * class.cs (Method.Emit): Label parameters.
15860
15861         * driver.cs: Return 1 or 0 as the program exit code.
15862
15863 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15864
15865         * expression.cs: Special case the `null' object when trying to
15866         auto-compute the type, as anything can be explicitly converted to
15867         that. 
15868
15869         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15870         spotting this Paolo.
15871
15872         (Expression.ImplicitNumericConversion): Perform comparissions of
15873         the type using the underlying type in the case of an enumeration
15874         rather than using the enumeration type for the compare.
15875
15876         Cope with the underlying == type case, which is not possible to
15877         catch before. 
15878
15879         (Expression.ConvertNumericExplicit): Perform comparissions of
15880         the type using the underlying type in the case of an enumeration
15881         rather than using the enumeration type for the compare.
15882
15883         * driver.cs: If the user does not supply an extension, assume .exe
15884
15885         * cs-parser.jay (if_statement): Rewrote so that we can track the
15886         location for the if statement.
15887
15888         * expression.cs (Binary.ConstantFold): Only concat strings when
15889         the operation is "+", not everything ;-)
15890
15891         * statement.cs (Statement.EmitBoolExpression): Take a location
15892         argument. 
15893         (If, While, Do): Track location.
15894
15895         * expression.cs (Binary.ResolveOperator): In the object + string
15896         case, I was missing a call to ConvertImplicit
15897
15898 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15899
15900         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15901         Location arguments. Ensure we use RootContext.LookupType to do our work
15902         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15903
15904         * interface.cs (PopulateMethod): Handle the type of the parameter being
15905         null gracefully.
15906
15907         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15908         have a params method with no fixed arguments and a call is made with no
15909         arguments.
15910
15911 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15914         the verbatim-string-literal
15915
15916         * support.cs (InternalParameters.ParameterModifier): handle null
15917         fixed parameters.
15918         (InternalParameters.ParameterType): ditto.
15919
15920         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15921         duplicating the name of the variable parameter.
15922         (GetParameterByName): Fix bug where we were not looking up array
15923         paramters if they were the only present (thanks Paolo!).
15924         (GetParameterInfo): We only have an empty set of types if both
15925         fixed and array are set to null.
15926         (GetParameterInfo-idx): Handle FixedParameter == null
15927
15928         * cs-parser.jay: Handle the case where there is no catch
15929         statements (missing null test).
15930
15931 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15932
15933         * driver.cs (MainDriver): Be conservative on our command line
15934         handling.
15935
15936         Catch DirectoryNotFoundException when calling GetFiles.
15937
15938         (SplitPathAndPattern): Used to split the input specification into
15939         a path and a pattern that we can feed to Directory.GetFiles.
15940
15941 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15942
15943         * statement.cs (Fixed): Implement the last case of the Fixed
15944         statement (string handling).
15945
15946         * expression.cs (StringPtr): New class used to return a char * to
15947         a string;  Used by the Fixed statement.
15948
15949         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15950
15951         * expression.cs (Binary.ResolveOperator): Remove redundant
15952         MemberLookup pn parent type.
15953         Optimize union call, we do not need a union if the types are the same.
15954         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15955         type.
15956
15957         Specialize the use of MemberLookup everywhere, instead of using
15958         the default settings. 
15959
15960         (StackAlloc): Implement stackalloc keyword.
15961
15962         * cs-parser.jay: Add rule to parse stackalloc.
15963
15964         * driver.cs: Handle /h, /help, /?
15965
15966         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15967         before we supported unsafe code.
15968
15969         * makefile: add --unsafe to the self compilation of mcs.
15970
15971 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15972
15973         * expression.cs (PointerArithmetic): New class that is used to
15974         perform pointer arithmetic.
15975         (Binary.Resolve): Handle pointer arithmetic
15976         Handle pointer comparission.
15977         (ArrayPtr): Utility expression class that is used to take the
15978         address of an array.
15979
15980         (ElementAccess): Implement array access for pointers
15981
15982         * statement.cs (Fixed): Implement fixed statement for arrays, we
15983         are missing one more case before we are done.
15984
15985         * expression.cs (Indirection): Implement EmitAssign and set the
15986         ExprClass to Variable.  This allows pointer dereferences to be
15987         treated as variables, and to have values assigned to them.
15988
15989         * ecore.cs (Expression.StoreFromPtr): New utility function to
15990         store values dereferencing.
15991
15992 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15993
15994         * expression.cs (Binary.ResolveOperator): Ensure that we are
15995         not trying to operate on a void type - this fixes the reported
15996         bug.
15997
15998         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15999         the parent implementation is sealed.
16000
16001         * ../errors/cs0239.cs : Add.
16002
16003         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16004
16005         * typemanager.cs (unverifiable_code_type): Corresponds to 
16006         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16007         which have unsafe code in them.
16008
16009         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16010         unsafe context.
16011
16012 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * cs-tokenizer.cs: Add support for @"litreal strings"
16015
16016         Make tokenizer accept pre-processor directives
16017         on any column (remove the old C-like limitation). 
16018
16019         * rootcontext.cs (EmitCode): Emit any global attributes.
16020         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16021
16022         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16023
16024         * cs-parser.jay: Add support for global attributes.  
16025
16026 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16027
16028         * expression.cs (Indirection): New helper class.  Unary will
16029         create Indirection classes to be able to implement the
16030         IMemoryLocation interface on it.
16031
16032 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * cs-parser.jay (fixed_statement): reference the right statement.
16035
16036         * statement.cs (Fixed.Emit): Finish implementing the fixed
16037         statement for the &x case.
16038
16039 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16040
16041         * class.cs (Property.Define, Method.Define): Remove newslot when
16042         `implementing'.  
16043
16044         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16045         wrong.  NewSlot should only be used if the `new' keyword is present.
16046
16047         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16048         locating our system dir.  Sorry about this.
16049
16050 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16051
16052         * driver.cs (GetSystemDir): Compute correctly the location of our
16053         system assemblies.  I was using the compiler directory instead of
16054         the library directory.
16055
16056 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16057
16058         * expression.cs (BetterFunction): Put back in what Miguel commented out
16059         since it is the correct fix. The problem is elsewhere ;-)
16060
16061         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16062         parameters of the parms method are themselves compatible or not !
16063
16064         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16065         to check that a class implements an interface before saying that an implicit
16066         conversion was allowed. Use ImplementsInterface to do the checking.
16067
16068 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * class.cs (Method.Define): Track whether we are an explicit
16071         implementation or not.  And only call DefineMethodOverride if we
16072         are an explicit implementation.
16073
16074         (Property.DefineMethod): Ditto.
16075
16076 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16077
16078         * expression.cs (BetterFunction): Catch hideous bug which was
16079          preventing us from detecting ambiguous calls due to implicit casts i.e
16080         cs0121.
16081
16082 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16083
16084         * support.cs (Pair): Remove un-needed method.  I figured why I was
16085         getting the error in cs-parser.jay, the variable in a foreach loop
16086         is readonly, and the compiler does not really treat this as a variable.
16087
16088         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16089         instead of EQUALS in grammar.  
16090
16091         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16092
16093         * expression.cs (Unary.DoResolve): Check whether the argument is
16094         managed or not.
16095
16096 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * support.cs: Api for Pair to set a value.  Despite the fact that
16099         the variables are public the MS C# compiler refuses to compile
16100         code that accesses the field if the variable is part of a foreach
16101         statement. 
16102
16103         * statement.cs (Fixed): Begin implementation of the fixed
16104         statement.
16105
16106         (Block.AddVariable): Return the VariableInfo on success and null
16107         on failure instead of true/false. 
16108
16109         * cs-parser.jay (foreach): Catch errors on variables already
16110         defined (we were ignoring this value before) and properly unwind
16111         the block hierarchy
16112
16113         (fixed_statement): grammar for the fixed statement.
16114
16115 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16116
16117         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16118         pointer types to be incretemented.
16119
16120         (SizeOf): Implement.
16121
16122         * cs-parser.jay (pointer_member_access): Implement
16123         expr->IDENTIFIER production.
16124
16125         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16126         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16127         on safe contexts.
16128
16129         (Unary): Implement indirection.
16130
16131         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16132         use in non-unsafe context).
16133
16134         (SimpleName.DoResolve): Check for pointers in field access on safe
16135         contexts. 
16136
16137         (Expression.LoadFromPtr): Factor the load-indirect code in this
16138         function.  This was duplicated in UnboxCast and ParameterReference
16139
16140 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16141
16142         * expression.cs (ComposedCast): report an error if a pointer cast
16143         is used in a safe region.
16144
16145         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16146         pointer type casts in unsafe context.
16147
16148         * codegen.cs (EmitContext): Set up IsUnsafe.
16149
16150         * cs-parser.jay (non_expression_type): Add productions for pointer
16151         casts. 
16152
16153         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16154         code.  We should not use force into static mode if the method is
16155         not virtual.  Fixes bug in MIS
16156
16157         * statement.cs (Do.Emit, While.Emit, For.Emit,
16158         Statement.EmitBoolExpression): Add support to Do and While to
16159         propagate infinite loop as `I do return' semantics.
16160
16161         Improve the For case to also test for boolean constants.
16162
16163         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16164         to the list of attributes we can add.
16165
16166         Remove `EmitContext' argument.
16167
16168         * class.cs (Method.Define): Apply parameter attributes.
16169         (Constructor.Define): Apply parameter attributes.
16170         (MethodCore.LabelParameters): Move here the core of labeling
16171         parameters. 
16172
16173         * support.cs (ReflectionParameters.ParameterModifier,
16174         InternalParameters.ParameterModifier): Use IsByRef on the type and
16175         only return the OUT bit for these parameters instead of in/out/ref
16176         flags.
16177
16178         This is because I miss-understood things.  The ParameterInfo.IsIn
16179         and IsOut represent whether the parameter has the [In] and [Out]
16180         attributes set.  
16181
16182 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16183
16184         * ecore.cs (FieldExpr.Emit): Release temporaries.
16185
16186         * assign.cs (LocalTemporary.Release): new function.
16187
16188         * codegen.cs (EmitContext.GetTemporaryStorage,
16189         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16190         temporary storage.  Now we can "put back" localbuilders when we
16191         are done with them
16192
16193 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16196         need to make a copy of the variable to generate verifiable code.
16197
16198 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16199
16200         * driver.cs: Compute dynamically the system directory.
16201
16202         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16203         Slower, but more generally useful.  Used by the abstract
16204         registering implementation. 
16205
16206         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16207         the rules for the special rule on Type/instances.  First check if
16208         we have the same name, and if so, try that special static path
16209         rather than the instance path.
16210
16211 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16212
16213         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16214         for, while and if.
16215
16216         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16217         Enum, ValueType, Delegate or Array for non-corlib compiles.
16218
16219         * cs-tokenizer.cs: Catch long identifiers (645)
16220
16221         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16222         piece of code.
16223
16224         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16225         fix, we were returning too early, so we were not registering
16226         pending methods from abstract classes.
16227
16228         Do not register pending methods if the class is abstract.
16229
16230         * expression.cs (Conditional.DoResolve): Report circular implicit
16231         conversions when we neecd to compute it for conditional
16232         expressions. 
16233
16234         (Is.DoResolve): If the expression is always of the provided type,
16235         flag warning 183.  If the expression can not ever be of the
16236         provided type flag warning 184.
16237
16238         * class.cs: Catch 169 as well.
16239
16240         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16241         read. 
16242
16243 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16244
16245         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16246
16247 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16248
16249         * interface.cs: (PopulateMethod): Check for pointers being defined
16250         only if the unsafe context is active.
16251         (PopulateProperty): ditto.
16252         (PopulateIndexer): ditto.
16253
16254         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16255         specified.  If pointers are present, make sure that they are
16256         present in an unsafe context.
16257         (Constructor, Constructor.Define): ditto.
16258         (Field, Field.Define): ditto.
16259         (Property, Property.Define): ditto.
16260         (Event, Event.Define): ditto.
16261
16262         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16263         hashtable if there are classes or structs defined.
16264
16265         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16266         code, as the constant resolution moved.
16267
16268         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16269         the metadata, so we can flag error 133. 
16270
16271         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16272         pointer is being declared in an unsafe context.
16273
16274 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16275
16276         * modifiers.cs (Modifiers.Check): Require a Location argument.
16277         Report error 227 for Unsafe use.
16278
16279         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16280
16281         * statement.cs (For.Emit): If the test is null, then report that
16282         we do `return', as we wont reach anything afterwards.
16283
16284         (Switch.SwitchGoverningType): Track the expression that matched
16285         the conversion.
16286
16287         * driver.cs: Allow negative numbers as an error code to flag.
16288
16289         * cs-parser.jay: Handle 1551.
16290
16291         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16292
16293 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16294
16295         * cs-parser.jay: Report 1518 (type declaration can only contain
16296         class, struct, interface, enum or delegate)
16297
16298         (switch_label): Report 1523 (keywords `case' or `default' must
16299         preced code)
16300
16301         (opt_switch_sections): Report 1522 (empty switch)
16302
16303         * driver.cs: Report 1515 (response file specified multiple times)
16304         Report 1516 (Source file specified multiple times).
16305
16306         * expression.cs (Argument.Resolve): Signal 1510
16307
16308         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16309         access not allowed in static code)
16310
16311 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16312
16313         * typemanager.cs (IsPointerType): Utility method which we are going
16314         to need a lot.
16315
16316         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16317         the object type, so we take care of that.
16318
16319         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16320
16321         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16322         added to non-params parameters :-)
16323
16324         * typemanager.cs (CSharpName): Include 'void' type too. 
16325
16326         (void_ptr_type): Include in the set of core types.
16327
16328         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16329         duplicating code.
16330
16331         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16332         an unsafe context.
16333
16334         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16335         completely forgotten about it.
16336
16337 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16338
16339         * cs-parser.jay (pointer_type): Add. This begins our implementation
16340         of parsing rules for unsafe code.
16341
16342         (unsafe_statement): Implement.
16343
16344         (embedded_statement): Modify to include the above.
16345
16346         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16347
16348         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16349         if the current context is an unsafe one.
16350
16351         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16352         are handled differently, we need separate rules for them.
16353
16354         (local_variable_declaration): Update to use local_variable_pointer_type
16355         to allow variable declarations of unmanaged pointer types.
16356
16357         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16358         in unsafe contexts.
16359
16360         * ../errors/cs0214.cs : Add.
16361
16362 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16363
16364         * makefile: remove 'response' file when cleaning.
16365
16366 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16367
16368         * cs-parser.jay: Report 1524.
16369
16370 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16371
16372         * typemanager.cs (RegisterMethod): drop checking if we have
16373         registered this from here
16374
16375 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16376
16377         * class.cs (Method.EmitDestructor): Implement calling our base
16378         destructor. 
16379
16380         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16381         value of InFinally.
16382
16383         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16384         this routine and will wrap the call in a try/catch block.  Deal
16385         with the case.
16386
16387 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16388
16389         * ecore.cs (Expression.MemberLookup): instead of taking a
16390         parameter `same_type' that was used to tell whether we could
16391         access private members we compute our containing type from the
16392         EmitContext.
16393
16394         (FieldExpr): Added partial support for volatile fields.  This does
16395         not work for volatile fields exposed from assemblies, as I can not
16396         figure out how to extract the modreq from it.
16397
16398         Updated all the source files to use this.
16399
16400         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16401         because it is referenced by MemberLookup very often. 
16402
16403 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16404
16405         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16406         TypeBuilder.GetCustomAttributes to retrieve what we need.
16407
16408         Get rid of redundant default_member_attr_type as this is the same as
16409         default_member_type which already exists.
16410
16411         * interface.cs, attribute.cs : Update accordingly.
16412
16413 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16414
16415         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16416         work for TYpeBuilders though.  Ravi, can you please fix this?
16417
16418         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16419
16420         * expression.cs (Argument.Emit): Handle the case of ref objects
16421         being passed to ref functions;  
16422
16423         (ParameterReference.EmitLoad): Loads the content of the pointer
16424         without dereferencing.
16425
16426 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16427
16428         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16429
16430 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16431
16432         * class.cs (Indexer.DefineMethod): Incorporate the interface
16433         type in the name of the method if we are doing explicit interface
16434         implementation.
16435
16436         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16437
16438         (BetterConversion): Fix extremely trivial bug where we were referring to
16439         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16440         again !
16441
16442         * ../errors/bug16.cs : Add although we have fixed it.
16443
16444 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16445
16446         * expression.cs (BaseIndexer): Begin implementation.
16447
16448         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16449
16450         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16451         production directly to remove a shift/reduce, and implement
16452         explicit interface implementation.
16453
16454         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16455         after a floating point suffix.
16456
16457         * expression.cs (DoNumericPromotions): Improved the conversion for
16458         uint/uint.  If we have a constant, we avoid doing a typecast to a
16459         larger type.
16460
16461         * class.cs (Indexer): Implement explicit interface implementation
16462         for indexers.
16463
16464 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16465
16466         * class.cs: make the default instance constructor public and hidebysig.
16467
16468 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16469
16470         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16471         so we can call it from elsewhere.
16472
16473         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16474         we emit it internally if the class has a defined indexer; otherwise the user
16475         emits it by decorating the class definition with the DefaultMemberAttribute.
16476
16477         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16478         attribute is not used on a type which defines an indexer.
16479
16480         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16481         character when we skip whitespace.
16482
16483         * ../errors/cs0646.cs : Add.
16484
16485 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16486
16487         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16488         again. 
16489
16490         * makefile: Add practical target `mcs3.exe' which builds the third
16491         generation compiler. 
16492
16493         * expression.cs (New): Fix structures constructor calling.
16494
16495         * class.cs (Property, Method, Indexer): Emit Final flag on the
16496         method if we are an interface implementation and we are not
16497         abstract. 
16498
16499         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16500         whether this property is referencing a `base' method.
16501
16502         * expression.cs (Invocation.EmitCall): take an extra argument:
16503         is_base, this is used to determine whether the `call' or
16504         `callvirt' opcode should be used.
16505
16506
16507         * delegate.cs: update EmitCall.
16508
16509         * class.cs (Method.Define): Set NewSlot for the cases where we are
16510         not implementing an interface method.
16511
16512         (Property.Define): ditto.
16513
16514 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16517         'r'.  Allows mcs to parse itself fully.
16518
16519 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16520
16521         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16522         of the number of initializers that require the InitializeArray method.
16523
16524         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16525         update the above field where necessary.
16526
16527         (MakeByteBlob): Update accordingly.
16528
16529         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16530         greater than 2.
16531
16532         (EmitDynamicInitializers): Update in accordance with the new optimization.
16533
16534         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16535         same OpCode applies.
16536
16537         * cs-parser.jay : Fix some glaring errors I introduced.
16538
16539 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16540
16541         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16542         so that we can check for name clashes there too.
16543
16544         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16545         for interface indexers.
16546
16547         * interfaces.cs (Define): Emit the default member attribute.
16548
16549         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16550         variable was being referred to while setting the value ;-)
16551
16552 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16553
16554         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16555         byte-by-byte information when we know the data is zero.
16556
16557         Make the block always a multiple of 4, because
16558         DefineInitializedData has a bug.
16559
16560         * assign.cs: Fix, we should assign from the temporary, not from
16561         the source. 
16562
16563         * expression.cs (MakeByteBlob): Fix my incorrect code.
16564
16565 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16566
16567         * typemanager.cs (EnumToUnderlying): This function is used to get
16568         the underlying type from an enumeration, because it does not
16569         always work. 
16570
16571         * constant.cs: Use the I4_S form for values between -128 and 127.
16572
16573         * statement.cs (Block.LookupLabel): Looks up a label.
16574         (Block): Drop support for labeled blocks.
16575
16576         (LabeledStatement): New kind of statement that represents a label
16577         only.
16578
16579         (Goto): Finally implement this bad boy.
16580
16581         * cs-parser.jay: Update to reflect new mechanism to implement
16582         labels.
16583
16584 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16585
16586         * codegen.cs (EmitContext.This): a codegen property that keeps the
16587         a single instance of this instead of creating many different this
16588         instances. 
16589
16590         * delegate.cs (Delegate.DoResolve): Update to use the property;
16591
16592         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16593
16594         * expression.cs (BaseAccess.DoResolve): Ditto.
16595
16596 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16597
16598         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16599         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16600
16601         (InitCoreTypes): Update accordingly.
16602
16603         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16604         so we can quickly store the state.
16605
16606         (ApplyAttributes): Set the correct implementation flags
16607         for InternalCall methods.
16608
16609 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16610
16611         * expression.cs (EmitCall): if a method is not virtual, then do
16612         not use callvirt on it.
16613
16614         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16615         user defined stuff) requires the use of stobj, which takes an
16616         address on the stack instead of an array and an index.  So emit
16617         the Ldelema operation for it.
16618
16619         (EmitStoreOpcode): Use stobj for valuetypes.
16620
16621         (UnaryMutator.EmitCode): Use the right 1 value depending on
16622         whether we are dealing with int64/uint64, float or doubles.
16623
16624         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16625         constructors that I implemented last night.
16626
16627         (Constructor.IsDefault): Fix to work properly for static
16628         constructors.
16629
16630         * cs-parser.jay (CheckDef): report method signature errors.
16631         Update error number 103 to be 132.
16632
16633         * decl.cs: New AdditionResult enumeration value: MethodExists.
16634         Although we do this check for methods later on in the semantic
16635         analysis, catching repeated default constructors is so easy that
16636         we catch these here. 
16637
16638         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16639         promotions code.
16640
16641         (ParameterReference.EmitAssign, Emit): handle
16642         bools as bytes.
16643
16644         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16645         (ArrayAccess.EmitStoreOpcode): ditto.
16646
16647         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16648
16649         * expression.cs (MakeByteBlob): Complete all the missing types
16650         (uint, short, ushort, byte, sbyte)
16651
16652         * class.cs: Only init instance field initializers on instance
16653         constructors. 
16654
16655         Rename `constructors' to instance_constructors. 
16656
16657         (TypeContainer.AddConstructor): Only add constructors to the list
16658         if it is not static.
16659
16660         Make sure that we handle default_static_constructor independently
16661         everywhere where we handle instance_constructors
16662
16663 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16664
16665         * class.cs: Do not lookup or create a base initializer for a
16666         static constructor.
16667
16668         (ConstructorInitializer.Resolve): use the proper type to lookup
16669         for constructors.
16670
16671         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16672
16673         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16674         in DeclSpace. 
16675
16676         * decl.cs: CloseType is now an virtual method, the default
16677         implementation just closes this type.
16678
16679 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16680
16681         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16682         to PreserveSig by default. Also emit HideBySig on such methods.
16683
16684         Basically, set the defaults to standard values.
16685
16686         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16687         argument, if candidate is better, it can't be worse than the best !
16688
16689         (Invocation): Re-write bits to differentiate between methods being
16690         applicable in their expanded form and their normal form - for params
16691         methods of course.
16692
16693         Get rid of use_standard everywhere as only standard conversions are allowed
16694         in overload resolution. 
16695
16696         More spec conformance.
16697
16698 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * driver.cs: Add --timestamp, to see where the compiler spends
16701         most of its time.
16702
16703         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16704         `this' in static code.
16705
16706         (SimpleName.DoResolve): Implement in terms of a helper function
16707         that allows static-references to be passed upstream to
16708         MemberAccess.
16709
16710         (Expression.ResolveWithSimpleName): Resolve specially simple
16711         names when called by MemberAccess to implement the special
16712         semantics. 
16713
16714         (Expression.ImplicitReferenceConversion): Handle conversions from
16715         Null to reference types before others, as Null's type is
16716         System.Object. 
16717
16718         * expression.cs (Invocation.EmitCall): Handle the special case of
16719         calling methods declared on a reference type from a ValueType
16720         (Base classes System.Object and System.Enum)
16721
16722         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16723         the left hand side is a TypeExpr, not on every enumeration. 
16724
16725         (Binary.Resolve): If types are reference types, then do a cast to
16726         object on operators != and == of both arguments.
16727
16728         * typemanager.cs (FindMembers): Extract instance and static
16729         members if requested.
16730
16731         * interface.cs (PopulateProperty): Use void_type instead of null
16732         as the return type for the setter method.
16733
16734         (PopulateIndexer): ditto.
16735
16736 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16737
16738         * support.cs (ReflectionParameters): Fix minor bug where we
16739         were examining the wrong parameter for the ParamArray attribute.
16740
16741         Cope with requests for the type of the parameter at position
16742         greater than the params parameter's. We now return the element
16743         type of the params array as that makes more sense.
16744
16745         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16746         accordingly as we no longer have to extract the element type
16747         ourselves.
16748
16749         (Invocation.OverloadResolve): Update.
16750
16751 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16752
16753         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16754         against IEnumerator, test whether the return value is a descendant
16755         of the IEnumerator interface.
16756
16757         * class.cs (Indexer.Define): Use an auxiliary method to implement
16758         the other bits of the method definition.  Begin support for
16759         explicit interface implementation.
16760
16761         (Property.DefineMethod): Use TypeManager.void_type instead of null
16762         for an empty return value.
16763
16764 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16765
16766         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16767         dealing with a FieldExpr which is composed of a FieldBuilder, in
16768         the code path we did extract the constant, but we should have
16769         obtained the underlying value to be able to cast it (otherwise we
16770         end up in an infinite loop, this is what Ravi was running into).
16771
16772         (ArrayCreation.UpdateIndices): Arrays might be empty.
16773
16774         (MemberAccess.ResolveMemberAccess): Add support for section
16775         14.5.4.1 that deals with the special case of E.I when E is a type
16776         and something else, that I can be a reference to a static member.
16777
16778         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16779         handle a particular array type to create byte blobs, it is just
16780         something we dont generate byteblobs for.
16781
16782         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16783         arguments. 
16784
16785         * location.cs (Push): remove the key from the hashtable that we
16786         are about to add.   This happens for empty files.
16787
16788         * driver.cs: Dispose files after we have parsed them.
16789
16790         (tokenize): new function that only runs the tokenizer on its
16791         input, for speed testing.
16792
16793 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16794
16795         * class.cs (Event.Define): Define the private field only if there
16796         are no accessors defined.
16797
16798         * expression.cs (ResolveMemberAccess): If there is no associated
16799         field with the event, that means we have an event defined with its
16800         own accessors and we should flag error cs0070 since transforming
16801         ourselves into a field is not valid in that case.
16802
16803         * ecore.cs (SimpleName.DoResolve): Same as above.
16804
16805         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16806         and charset to sane values.
16807
16808 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16809
16810         * assign.cs (DoResolve): Perform check on events only if they 
16811         are being accessed outside the declaring type.
16812
16813         * cs-parser.jay (event_declarations): Update rules to correctly
16814         set the type of the implicit parameter etc.
16815
16816         (add_accessor, remove_accessor): Set current local parameters.
16817
16818         * expression.cs (Binary): For delegate addition and subtraction,
16819         cast the return value from the method into the appropriate delegate
16820         type.
16821
16822 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16823
16824         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16825         of these as the workaround is unnecessary.
16826
16827         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16828         delegate data - none of that is needed at all.
16829
16830         Re-write bits to extract the instance expression and the delegate method
16831         correctly.
16832
16833         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16834         on delegates too.
16835
16836         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16837         of attaching attributes instead of duplicating code everywhere.
16838
16839         * everywhere : Update code to do attribute emission using the above method.
16840
16841 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16842
16843         * expression.cs (IsParamsMethodApplicable): if there are not
16844         parameters, return immediately.
16845
16846         * ecore.cs: The 0 literal can be implicity converted to an enum
16847         type. 
16848
16849         (SimpleName.DoResolve): First lookup the type, then lookup the
16850         members. 
16851
16852         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16853         want to get its address.  If the InstanceExpression is not
16854         addressable, store the result in a temporary variable, then get
16855         the address of it.
16856
16857         * codegen.cs: Only display 219 errors on warning level or above. 
16858
16859         * expression.cs (ArrayAccess): Make it implement the
16860         IMemoryLocation interface.
16861
16862         (Binary.DoResolve): handle the operator == (object a, object b)
16863         and operator != (object a, object b) without incurring into a
16864         BoxedCast (because 5 != o should never be performed).
16865
16866         Handle binary enumerator operators.
16867
16868         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16869         value type, otherwise use Ldelem_ref.
16870
16871         Use precomputed names;
16872
16873         (AddressOf): Implement address of
16874
16875         * cs-parser.jay (labeled_statement): Fix recursive block
16876         addition by reworking the production.
16877
16878         * expression.cs (New.DoEmit): New has a special case:
16879                 
16880                  If we are dealing with a ValueType, we have a few
16881                  situations to deal with:
16882                 
16883                     * The target of New is a ValueType variable, that is
16884                       easy, we just pass this as the variable reference
16885                 
16886                     * The target of New is being passed as an argument,
16887                       to a boxing operation or a function that takes a
16888                       ValueType.
16889                 
16890                       In this case, we need to create a temporary variable
16891                       that is the argument of New.
16892
16893
16894 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16895
16896         * rootcontext.cs (LookupType): Check that current_type is not null before
16897         going about looking at nested types.
16898
16899         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16900         not implement the IAssignMethod interface any more.
16901
16902         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16903         where we tranform them into FieldExprs if they are being resolved from within
16904         the declaring type.
16905
16906         * ecore.cs (SimpleName.DoResolve): Do the same here.
16907
16908         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16909
16910         * ../errors/bug10.cs : Add.
16911
16912         * ../errors/cs0070.cs : Add.
16913
16914         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16915
16916         * assign.cs : Get rid of EventIsLocal everywhere.
16917
16918 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16919
16920         * ecore.cs (ConvertIntLiteral): finished the implementation.
16921
16922         * statement.cs (SwitchLabel): Convert the value we are using as a
16923         key before looking up the table.
16924
16925 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16926
16927         * codegen.cs (EmitTopBlock): Require a Location argument now.
16928
16929         * cs-parser.jay (constructor_declarator): We need to setup
16930         current_local_parameters before we parse the
16931         opt_constructor_initializer, to allow the variables to be bound
16932         to the constructor arguments.
16933
16934         * rootcontext.cs (LookupType): First lookup nested classes in our
16935         class and our parents before we go looking outside our class.
16936
16937         * expression.cs (ConstantFold): Extract/debox the values at the
16938         beginnning. 
16939
16940         * rootcontext.cs (EmitCode): Resolve the constants first before we
16941         resolve the types.  This is not really needed, but it helps debugging.
16942
16943         * statement.cs: report location.
16944
16945         * cs-parser.jay: pass location to throw statement.
16946
16947         * driver.cs: Small bug fix.
16948
16949         * report.cs: Updated format to be 4-zero filled digits.
16950
16951 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16952
16953         * expression.cs (CheckIndices): Fix minor bug where the wrong
16954         variable was being referred to ;-)
16955
16956         (DoEmit): Do not call EmitStaticInitializers when the 
16957         underlying type is System.Object.
16958
16959 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16960
16961         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16962         and do the usual workaround for SRE.
16963
16964         * class.cs (MyEventBuilder.EventType): New member to get at the type
16965         of the event, quickly.
16966
16967         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16968
16969         * assign.cs (Assign.DoResolve): Handle the case when the target
16970         is an EventExpr and perform the necessary checks.
16971
16972         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16973         interface.
16974
16975         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16976
16977         (EventExpr): Set the type in the constructor itself since we 
16978         are meant to be born fully resolved.
16979
16980         (EventExpr.Define): Revert code I wrote earlier.
16981                 
16982         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16983         instance expression is null. The instance expression is a This in that case
16984         or a null, depending on whether it is a static method or not.
16985
16986         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16987         refers to more than one method.
16988
16989         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16990         and accordingly flag errors.
16991
16992 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16993
16994         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16995
16996 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16997
16998         * location.cs (ToString): Provide useful rutine.
16999
17000 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17001
17002         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17003         objects, return the actual integral boxed.
17004
17005         * statement.cs (SwitchLabel): define an ILLabel for each
17006         SwitchLabel. 
17007
17008         (Switch.CheckSwitch): If the value is a Literal, extract
17009         the underlying literal.
17010
17011         Also in the unused hashtable we had, add the SwitchLabel so we can
17012         quickly look this value up.
17013
17014         * constant.cs: Implement a bunch of new constants.  Rewrite
17015         Literal based on this.  Made changes everywhere to adapt to this.
17016
17017         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17018         dereferencing array only once, and also copes with enumrations.
17019
17020         bytes are two bytes wide, not one.
17021
17022         (Cast): Perform constant conversions.
17023
17024         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17025         wrappers to the literals here.
17026
17027         * expression.cs (DoNumericPromotions): long literals can converted
17028         to ulong implicity (this is taken care of elsewhere, but I was
17029         missing this spot).
17030
17031         * ecore.cs (Expression.Literalize): Make the return type Literal,
17032         to improve type checking.
17033
17034         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17035
17036 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17037
17038         * literal.cs: Revert code from ravi that checked the bounds.  The
17039         bounds are sane by the definition of the type itself. 
17040
17041         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17042         need to actually look up in our parent hierarchy for interfaces
17043         implemented. 
17044
17045         * const.cs: Use the underlying type for enumerations
17046
17047         * delegate.cs: Compute the basename for the delegate creation,
17048         that should fix the delegate test case, and restore the correct
17049         Type Lookup semantics in rootcontext
17050
17051         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17052         referencing a nested type with the Reflection API is using the "+"
17053         sign. 
17054
17055         * cs-parser.jay: Do not require EOF token at the end.
17056
17057 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17058
17059         * rootcontext.cs (LookupType): Concatenate type names with
17060         a '.' instead of a '+' The test suite passes again.
17061
17062         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17063         field of the enumeration.
17064
17065         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17066         the case when the member is an EventExpr.
17067
17068         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17069         static has an associated instance expression.
17070
17071         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17072
17073         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17074
17075         * class.cs (Event.Define): Register event and perform appropriate checks
17076         for error #111.
17077
17078         We define the Add and Remove methods even if the use provides none because
17079         in that case, we provide default implementations ourselves.
17080
17081         Define a private field of the type of the event. This is done by the CSC compiler
17082         and we should be doing it too ;-)
17083
17084         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17085         More methods we use in code we generate.
17086
17087         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17088         is important.
17089
17090         (InitCoreTypes): Update accordingly for the above.
17091
17092         * class.cs (Event.Emit): Generate code for default accessors that we provide
17093
17094         (EmitDefaultMethod): Do the job in the above.
17095
17096         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17097         appropriate place.
17098
17099 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17100
17101         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17102         builders even if we were missing one.
17103
17104         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17105         pass the Basename as our class name instead of the Name.  The
17106         basename will be correctly composed for us.
17107
17108         * parameter.cs (Paramters): Now takes a Location argument.
17109
17110         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17111         make all the code call directly LookupType in RootContext and take
17112         this chance to pass the Location information everywhere.
17113
17114         * Everywhere: pass Location information.
17115
17116 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17117
17118         * class.cs (Constructor.Define): Updated way of detecting the
17119         length of the parameters.
17120
17121         (TypeContainer.DefineType): Use basename as the type name for
17122         nested types.
17123
17124         (TypeContainer.Define): Do not recursively define types here, as
17125         definition is taken care in order by the RootContext.
17126
17127         * tree.cs: Keep track of namespaces in a per-file basis.
17128
17129         * parameter.cs (Parameter.ComputeSignature): Update to use
17130         DeclSpace. 
17131
17132         (Parameters.GetSignature): ditto.
17133
17134         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17135         instead of a TypeContainer.
17136
17137         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17138         resolve names.  Because we need to be resolve in our context, not
17139         our parents.
17140
17141         * driver.cs: Implement response files.
17142
17143         * class.cs (TypeContainer.DefineType): If we are defined, do not
17144         redefine ourselves.
17145
17146         (Event.Emit): Emit the code for add/remove handlers.
17147         (Event.Define): Save the MethodBuilders for add/remove.
17148
17149         * typemanager.cs: Use pair here too.
17150
17151         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17152         DictionaryEntry requires the first argument to be non-null.  
17153
17154         (enum_declaration): Compute full name for registering the
17155         enumeration.
17156
17157         (delegate_declaration): Instead of using
17158         formal_parameter_list, use opt_formal_parameter_list as the list
17159         can be empty.
17160
17161         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17162         (EventParsing): New property that controls whether `add' and
17163         `remove' are returned as tokens or identifiers (for events);
17164
17165 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17166
17167         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17168         use MyEventBuilder only and let it wrap the real builder for us.
17169
17170         (MyEventBuilder): Revamp constructor etc.
17171
17172         Implement all operations that we perform on EventBuilder in precisely the same
17173         way here too.
17174
17175         (FindMembers): Update to use the EventBuilder member.
17176
17177         (Event.Emit): Update accordingly.
17178
17179 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17180
17181         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17182         by calling the appropriate methods.
17183
17184         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17185         useful.
17186
17187         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17188
17189 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17190
17191         * delegate.cs (Delegate.Populate): Check that the return type
17192         and various parameters types are indeed accessible.
17193
17194         * class.cs (Constructor.Define): Same here.
17195
17196         (Field.Define): Ditto.
17197
17198         (Event.Define): Ditto.
17199
17200         (Operator.Define): Check that the underlying Method defined itself
17201         correctly - so it's MethodBuilder should not be null.
17202
17203         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17204         expression happens to be null.
17205
17206         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17207         members but as of now we don't seem to be able to do anything really useful with it.
17208
17209         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17210         not the EventBuilder.
17211
17212 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17213
17214         * cs-tokenizer.cs: Add support for defines.
17215         Add support for #if, #elif, #else, #endif
17216
17217         (eval_var): evaluates a variable.
17218         (eval): stubbed for evaluating functions.
17219
17220         * cs-parser.jay: Pass the defines information
17221
17222         * driver.cs: Add --define command line option.
17223
17224         * decl.cs: Move MemberCore here.
17225
17226         Make it the base class for DeclSpace.  This allows us to catch and
17227         report 108 and 109 for everything now.
17228
17229         * class.cs (TypeContainer.Define): Extract all the members
17230         before populating and emit the warning 108 (new keyword required
17231         to override) instead of having each member implement this.
17232
17233         (MemberCore.Define): New abstract method, we will be using this in
17234         the warning reporting engine in Populate.
17235
17236         (Operator.Define): Adjust to new MemberCore protocol. 
17237
17238         * const.cs (Const): This does not derive from Expression, it is a
17239         temporary object we use to create fields, it is a MemberCore. 
17240
17241         * class.cs (Method.Define): Allow the entry point to be in a
17242         specific class.
17243
17244         * driver.cs: Rewrite the argument handler to clean it up a bit.
17245
17246         * rootcontext.cs: Made it just an auxiliary namespace feature by
17247         making everything static.
17248
17249         * driver.cs: Adapt code to use RootContext type name instead of
17250         instance variable.
17251
17252         * delegate.cs: Remove RootContext argument.
17253
17254         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17255         argument. 
17256
17257         * class.cs (Event.Define): The lookup can fail.
17258
17259         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17260
17261         * expression.cs: Resolve the this instance before invoking the code.
17262
17263 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17264
17265         * cs-parser.jay: Add a production in element_access that allows
17266         the thing to become a "type" reference.  This way we can parse
17267         things like "(string [])" as a type.
17268
17269         Note that this still does not handle the more complex rules of
17270         casts. 
17271
17272
17273         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17274
17275         * ecore.cs: (CopyNewMethods): new utility function used to
17276         assemble the list of methods from running FindMembers.
17277
17278         (MemberLookup): Rework FindMembers so that 
17279
17280 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17281
17282         * class.cs (TypeContainer): Remove Delegates who fail to be
17283         defined.
17284
17285         * delegate.cs (Populate): Verify that we dont get null return
17286         values.   TODO: Check for AsAccessible.
17287
17288         * cs-parser.jay: Use basename to emit error 574 (destructor should
17289         have the same name as container class), not the full name.
17290
17291         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17292         possible representation.  
17293
17294         Also implements integer type suffixes U and L.
17295
17296 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17297
17298         * expression.cs (ArrayCreation.DoResolve): We need to do the
17299         argument resolution *always*.
17300
17301         * decl.cs: Make this hold the namespace.  Hold the root context as
17302         well.
17303         (LookupType): Move here.
17304
17305         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17306
17307         * location.cs (Row, Name): Fixed the code, it was always returning
17308         references to the first file.
17309
17310         * interface.cs: Register properties defined through interfaces.
17311
17312         * driver.cs: Add support for globbing on the command line
17313
17314         * class.cs (Field): Make it derive from MemberCore as well.
17315         (Event): ditto.
17316
17317 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17318
17319         * class.cs (Event::Define): Check that the type of the event is a delegate
17320         type else flag error #66.
17321
17322         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17323         same.
17324
17325         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17326         values of EntryPoint, CharSet etc etc.
17327
17328         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17329
17330         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17331         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17332         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17333         which needs this to do its work.
17334
17335         * ../errors/cs0066.cs : Add.
17336
17337 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17338
17339         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17340         helper functions.
17341
17342         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17343         clears out the parameters field.
17344         (MemberSignatureCompare): Cleanup
17345
17346         (MemberCore): New base class used to share code between MethodCore
17347         and Property.
17348
17349         (RegisterRequiredImplementations) BindingFlags.Public requires
17350         either BindingFlags.Instace or Static.  Use instance here.
17351
17352         (Property): Refactored code to cope better with the full spec.
17353
17354         * parameter.cs (GetParameterInfo): Return an empty array instead
17355         of null on error.
17356
17357         * class.cs (Property): Abstract or extern properties have no bodies.
17358
17359         * parameter.cs (GetParameterInfo): return a zero-sized array.
17360
17361         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17362         method modifier validation to the typecontainer so we can reuse
17363         this on properties.
17364
17365         (MethodCore.ParameterTypes): return an empty sized array of types.
17366
17367         (Property.Define): Test property modifier validity.
17368
17369         Add tests for sealed/override too.
17370
17371         (Method.Emit): abstract or extern methods have no bodies.
17372
17373 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17374
17375         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17376         thing.
17377
17378         (Method::Define, ::Emit): Modify accordingly.
17379
17380         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17381
17382         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17383
17384         * makefile: Pass in /unsafe.
17385
17386 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17387
17388         * class.cs (MakeKey): Kill routine.
17389
17390         * class.cs (TypeContainer.Define): Correctly define explicit
17391         method implementations (they require the full interface name plus
17392         the method name).
17393
17394         * typemanager.cs: Deply the PtrHashtable here and stop using the
17395         lame keys.  Things work so much better.
17396
17397         This of course broke everyone who depended on `RegisterMethod' to
17398         do the `test for existance' test.  This has to be done elsewhere.
17399
17400         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17401         the object stupid Equals method (because, that like fails all over
17402         the place).  We still do not use it.
17403
17404         * class.cs (TypeContainer.SetRequiredInterface,
17405         TypeContainer.RequireMethods): Killed these two routines and moved
17406         all the functionality to RegisterRequiredImplementations.
17407
17408         (TypeContainer.RegisterRequiredImplementations): This routine now
17409         registers all the implementations required in an array for the
17410         interfaces and abstract methods.  We use an array of structures
17411         which can be computed ahead of time to reduce memory usage and we
17412         also assume that lookups are cheap as most classes will not
17413         implement too many interfaces.
17414
17415         We also avoid creating too many MethodSignatures.
17416
17417         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17418         clear the "pending" bit if we find that there are problems with
17419         the declaration.
17420
17421         (TypeContainer.VerifyPendingMethods): Update to report errors of
17422         methods that look like implementations but are not.
17423
17424         (TypeContainer.Define): Add support for explicit interface method
17425         implementation. 
17426
17427 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17428
17429         * typemanager.cs: Keep track of the parameters here instead of
17430         being a feature of the TypeContainer.
17431
17432         * class.cs: Drop the registration of parameters here, as
17433         InterfaceMethods are also interface declarations.
17434
17435         * delegate.cs: Register methods with the TypeManager not only with
17436         the TypeContainer.  This code was buggy.
17437
17438         * interface.cs: Full registation here.
17439
17440 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17441
17442         * expression.cs: Remove reducer for binary expressions, it can not
17443         be done this way.
17444
17445         * const.cs: Put here the code that used to go into constant.cs
17446
17447         * constant.cs: Put here the code for constants, this is a new base
17448         class for Literals.
17449
17450         * literal.cs: Make Literal derive from Constant.
17451
17452 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17453
17454         * statement.cs (Return.Emit): Report error 157 if the user
17455         attempts to return from a finally block.
17456
17457         (Return.Emit): Instead of emitting a return, jump to the end of
17458         the function.
17459
17460         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17461         LocalBuilder to store the result of the function.  ReturnLabel is
17462         the target where we jump.
17463
17464
17465 2001-12-09  Radek Doulik  <rodo@ximian.com>
17466
17467         * cs-parser.jay: remember alias in current namespace
17468
17469         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17470         namespaces
17471
17472         * class.cs (LookupAlias): lookup alias in my_namespace
17473
17474         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17475         aliases hashtable
17476         (LookupAlias): lookup alias in this and if needed in parent
17477         namespaces
17478
17479 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17480
17481         * support.cs: 
17482
17483         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17484         making things static.  I need this to avoid passing the
17485         TypeContainer when calling ParameterType.
17486
17487         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17488         that did string manipulation to compute the type and then call
17489         GetType.  Use Parameter.ParameterType instead.
17490
17491         * cs-tokenizer.cs: Consume the suffix for floating values.
17492
17493         * expression.cs (ParameterReference): figure out whether this is a
17494         reference parameter or not.  Kill an extra variable by computing
17495         the arg_idx during emission.
17496
17497         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17498         function that returns whether a parameter is an out/ref value or not.
17499
17500         (Parameter.ParameterType): The type of the parameter (base,
17501         without ref/out applied).
17502
17503         (Parameter.Resolve): Perform resolution here.
17504         (Parameter.ExternalType): The full type (with ref/out applied).
17505
17506         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17507         support for expressions on the using statement.
17508
17509 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17510
17511         * statement.cs (Using.EmitLocalVariableDecls): Split the
17512         localvariable handling of the using statement.
17513
17514         (Block.EmitMeta): Keep track of variable count across blocks.  We
17515         were reusing slots on separate branches of blocks.
17516
17517         (Try.Emit): Emit the general code block, we were not emitting it. 
17518
17519         Check the type of the declaration to be an IDisposable or
17520         something that can be implicity converted to it. 
17521
17522         Emit conversions if required.
17523
17524         * ecore.cs (EmptyExpression): New utility class.
17525         (Expression.ImplicitConversionExists): New utility function.
17526
17527 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17528
17529         * statement.cs (Using): Implement.
17530
17531         * expression.cs (LocalVariableReference): Support read only variables.
17532
17533         * statement.cs: Remove the explicit emit for the Leave opcode.
17534         (VariableInfo): Add a readonly field.
17535
17536 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17537
17538         * ecore.cs (ConvCast): new class used to encapsulate the various
17539         explicit integer conversions that works in both checked and
17540         unchecked contexts.
17541
17542         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17543         properly generate the overflow opcodes.
17544
17545 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17546
17547         * statement.cs: The correct type for the EmptyExpression is the
17548         element_type, not the variable type.  Ravi pointed this out.
17549
17550 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17551
17552         * class.cs (Method::Define): Handle PInvoke methods specially
17553         by using DefinePInvokeMethod instead of the usual one.
17554
17555         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17556         above to do the task of extracting information and defining the method.
17557
17558 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17559
17560         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17561         of the condition for string type.
17562
17563         (Emit): Move that here. 
17564
17565         (ArrayCreation::CheckIndices): Keep string literals in their expression
17566         form.
17567
17568         (EmitDynamicInitializers): Handle strings appropriately.
17569
17570 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17571
17572         * codegen.cs (EmitContext): Replace multiple variables with a
17573         single pointer to the current Switch statement.
17574
17575         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17576         EmitContext.
17577
17578 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17579
17580         * statement.cs 
17581
17582         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17583         default'.
17584
17585         (Foreach.Emit): Foreach on arrays was not setting
17586         up the loop variables (for break/continue).
17587
17588         (GotoCase): Semi-implented.
17589
17590 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17591
17592         * attribute.cs (CheckAttribute): Handle system attributes by using
17593         Attribute.GetAttributes to examine information we need.
17594
17595         (GetValidPlaces): Same here.
17596
17597         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17598
17599         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17600
17601         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17602
17603         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17604
17605         (Method::Emit): Handle the case when we are a PInvoke method.
17606
17607 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17608
17609         * expression.cs: Use ResolveWithSimpleName on compound names.
17610
17611 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17612
17613         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17614         before trying to reduce it.
17615
17616         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17617
17618         * constant.cs (LookupConstantValue): Implement.
17619
17620         (EmitConstant): Use the above in emitting the constant.
17621
17622         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17623         that are user-defined by doing a LookupConstantValue on them.
17624
17625         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17626         too, like above.
17627
17628 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17629
17630         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17631
17632         (BaseAccess.DoResolve): Implement.
17633
17634         (MemberAccess.DoResolve): Split this routine into a
17635         ResolveMemberAccess routine that can be used independently
17636
17637 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17638
17639         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17640         As that share bits of the implementation.  Is returns a boolean,
17641         while As returns the Type that is being probed.
17642
17643 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17644
17645         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17646         instead of a Literal - much easier.
17647
17648         (EnumInTransit): Remove - utterly useless :-)
17649
17650         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17651
17652         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17653
17654         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17655         chain when we have no associated expression.
17656
17657 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17658
17659         * constant.cs (Define): Use Location while reporting the errror.
17660
17661         Also emit a warning when 'new' is used and there is no inherited
17662         member to hide.
17663
17664         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17665         populated.
17666
17667         (LookupEnumValue): Implement to lookup an enum member's value and define it
17668         if necessary.
17669
17670         (Populate): Re-write accordingly to use the above routine.
17671
17672 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17673
17674         * expression.cs (This): Fix prototype for DoResolveLValue to
17675         override the base class DoResolveLValue.
17676
17677         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17678         declarations) 
17679
17680         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17681         (we need to load the address of the field here).  This fixes
17682         test-22. 
17683
17684         (FieldExpr.DoResolveLValue): Call the DoResolve
17685         function to initialize the Instance expression.
17686
17687         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17688         correctly the GetEnumerator operation on a value type.
17689
17690         * cs-parser.jay: Add more simple parsing error catches.
17691
17692         * statement.cs (Switch): Add support for string switches.
17693         Handle null specially.
17694
17695         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17696
17697 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17698
17699         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17700
17701         (declare_local_constant): New helper function.
17702
17703         * statement.cs (AddConstant): Keep a separate record of constants
17704
17705         (IsConstant): Implement to determine if a variable is a constant.
17706
17707         (GetConstantExpression): Implement.
17708
17709         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17710
17711         * statement.cs (IsVariableDefined): Re-write.
17712
17713 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17714
17715         * class.cs (TypeContainer::FindMembers): Look for constants
17716         in the case when we are looking for MemberTypes.Field
17717
17718         * expression.cs (MemberAccess::DoResolve): Check that in the
17719         case we are a FieldExpr and a Literal, we are not being accessed
17720         by an instance reference.
17721
17722         * cs-parser.jay (local_constant_declaration): Implement.
17723
17724         (declaration_statement): Implement for constant declarations.
17725
17726 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17727
17728         * statement.cs (Switch): Catch double defaults.
17729
17730         (Switch): More work on the switch() statement
17731         implementation.  It works for integral values now, need to finish
17732         string support.
17733
17734
17735 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17736
17737         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17738         integer literals into other integer literals.  To be used by
17739         switch. 
17740
17741 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17742
17743         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17744         some memory.
17745
17746         (EmitDynamicInitializers): Cope with the above since we extract data
17747         directly from ArrayData now.
17748
17749         (ExpectInitializers): Keep track of whether initializers are mandatory
17750         or not.
17751
17752         (Bounds): Make it a hashtable to prevent the same dimension being 
17753         recorded for every element in that dimension.
17754
17755         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17756         from being found.
17757
17758         Also fix bug which was causing the indices to be emitted in the reverse
17759         order.
17760
17761 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17764         unfinished.  They do not work, because the underlying code is
17765         sloppy.
17766
17767 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17768
17769         * cs-parser.jay: Remove bogus fixme.
17770
17771         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17772         on Switch statement.
17773
17774 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17775
17776         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17777         the same. 
17778
17779         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17780         parameter. Apparently, any expression is allowed. 
17781
17782         (ValidateInitializers): Update accordingly.
17783
17784         (CheckIndices): Fix some tricky bugs thanks to recursion.
17785
17786         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17787         I was being completely brain-dead.
17788
17789         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17790         and re-write acordingly.
17791
17792         (DelegateInvocation): Re-write accordingly.
17793
17794         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17795
17796         (MakeByteBlob): Handle types more correctly.
17797
17798         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17799         initialization from expressions but it is incomplete because I am a complete
17800         Dodo :-|
17801
17802 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17803
17804         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17805         on If.  Basically, we have to return `true' (ie, we do return to
17806         our caller) only if both branches of the if return.
17807
17808         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17809         short-circuit operators, handle them as short circuit operators. 
17810
17811         (Cast.DoResolve): Resolve type.
17812         (Cast.Cast): Take an expression as the target type.
17813
17814         * cs-parser.jay (cast_expression): Remove old hack that only
17815         allowed a limited set of types to be handled.  Now we take a
17816         unary_expression and we resolve to a type during semantic
17817         analysis.
17818
17819         Use the grammar productions from Rhys to handle casts (this is
17820         not complete like Rhys syntax yet, we fail to handle that corner
17821         case that C# has regarding (-x), but we will get there.
17822
17823 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17824
17825         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17826         field which is an array type.
17827
17828         * cs-parser.jay (declare_local_variables): Support array initialization too.
17829
17830         * typemanager.cs (MakeKey): Implement.
17831
17832         (everywhere): Use the above appropriately.
17833
17834         * cs-parser.jay (for_statement): Update for array initialization while
17835         declaring variables.
17836
17837         * ecore.cs : The error message was correct, it's the variable's names that
17838         were misleading ;-) Make the code more readable.
17839
17840         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17841         the correct type etc.
17842
17843         (ConvertExplicit): Handle Enum types by examining the underlying type.
17844
17845 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17846
17847         * parameter.cs (GetCallingConvention): Always return
17848         CallingConventions.Standard for now.
17849
17850 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17851
17852         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17853         and `r' after calling DoNumericPromotions.
17854
17855         * ecore.cs: Fix error message (the types were in the wrong order).
17856
17857         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17858         BindingFlags.Instance as well 
17859
17860         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17861         implicit int literal conversion in an empty cast so that we
17862         propagate the right type upstream.
17863
17864         (UnboxCast): new class used to unbox value types.
17865         (Expression.ConvertExplicit): Add explicit type conversions done
17866         by unboxing.
17867
17868         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17869         the target type before applying the implicit LongLiterals to ULong
17870         literal cast.
17871
17872 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17873
17874         * cs-parser.jay (for_statement): Reworked the way For works: now
17875         we declare manually any variables that are introduced in
17876         for_initializer to solve the problem of having out-of-band code
17877         emition (that is what got for broken).
17878
17879         (declaration_statement): Perform the actual variable declaration
17880         that used to be done in local_variable_declaration here.
17881
17882         (local_variable_declaration): Do not declare anything, just pass
17883         the information on a DictionaryEntry
17884
17885 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17886
17887         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17888         re-write of the logic to now make it recursive.
17889
17890         (UpdateIndices): Re-write accordingly.
17891
17892         Store element data in a separate ArrayData list in the above methods.
17893
17894         (MakeByteBlob): Implement to dump the array data into a byte array.
17895
17896 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17897
17898         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17899         into CheckIndices.
17900
17901         * constant.cs (Define): Implement.
17902
17903         (EmitConstant): Re-write fully.
17904
17905         Pass in location info.
17906
17907         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17908         respectively.
17909
17910         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17911         DictionaryEntry since we need location info too.
17912
17913         (constant_declaration): Update accordingly.
17914
17915         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17916         code into another method : UpdateIndices.
17917
17918 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17919
17920         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17921         some type checking etc.
17922
17923 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17924
17925         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17926         bits to provide dimension info if the user skips doing that.
17927
17928         Update second constructor to store the rank correctly.
17929
17930 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17931
17932         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17933         and try to implement.
17934
17935         * ../errors/cs0150.cs : Add.
17936
17937         * ../errors/cs0178.cs : Add.
17938
17939 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17940
17941         * statement.cs: Implement foreach on multi-dimensional arrays. 
17942
17943         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17944         name of the params argument.
17945
17946         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17947         initializing the array.
17948
17949         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17950         we can use this elsewhere.
17951
17952         * statement.cs: Finish implementation of foreach for single
17953         dimension arrays.
17954
17955         * cs-parser.jay: Use an out-of-band stack to pass information
17956         around, I wonder why I need this.
17957
17958         foreach_block: Make the new foreach_block the current_block.
17959
17960         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17961         function used to return a static Parameters structure.  Used for
17962         empty parameters, as those are created very frequently.
17963
17964         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17965
17966 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17967
17968         * interface.cs : Default modifier is private, not public. The
17969         make verify test passes again.
17970
17971 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17972
17973         * support.cs (ReflectionParameters): Fix logic to determine
17974         whether the last parameter is a params one. Test 9 passes again.
17975
17976         * delegate.cs (Populate): Register the builders we define with
17977         RegisterParameterForBuilder. Test 19 passes again.
17978
17979         * cs-parser.jay (property_declaration): Reference $6 instead
17980         of $$ to get at the location.
17981
17982         (indexer_declaration): Similar stuff.
17983
17984         (attribute): Ditto.
17985
17986         * class.cs (Property): Register parameters for the Get and Set methods
17987         if they exist. Test 23 passes again.
17988
17989         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17990         call to EmitArguments as we are sure there aren't any params arguments. 
17991         Test 32 passes again.
17992
17993         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17994         IndexOutOfRangeException. 
17995
17996         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17997         Test 33 now passes again.
17998
17999 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18000
18001         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18002         broke a bunch of things.  Will have to come up with a better way
18003         of tracking locations.
18004
18005         * statement.cs: Implemented foreach for single dimension arrays.
18006
18007 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18008
18009         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18010         an error.  This removes the lookup from the critical path.
18011
18012         * cs-parser.jay: Removed use of temporary_loc, which is completely
18013         broken. 
18014
18015 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18016
18017         * support.cs (ReflectionParameters.ParameterModifier): Report
18018         whether the argument is a PARAMS argument or not.
18019
18020         * class.cs: Set the attribute `ParamArrayAttribute' on the
18021         parameter argument.
18022
18023         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18024         and cons_param_array_attribute (ConstructorInfo for
18025         ParamArrayAttribute)., 
18026
18027         * codegen.cs: Emit the return using the `Return' statement, that
18028         way we can report the error correctly for missing return values. 
18029
18030         * class.cs (Method.Emit): Clean up.
18031
18032         * expression.cs (Argument.Resolve): Take another argument: the
18033         location where this argument is used.  Notice that this is not
18034         part of the "Argument" class as to reduce the size of the
18035         structure (we know the approximate location anyways).
18036
18037         Test if the argument is a variable-reference, if not, then
18038         complain with a 206.
18039
18040         (Argument.Emit): Emit addresses of variables.
18041
18042         (Argument.FullDesc): Simplify.
18043
18044         (Invocation.DoResolve): Update for Argument.Resolve.
18045
18046         (ElementAccess.DoResolve): ditto.
18047
18048         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18049         method should be virtual, as this method is always virtual.
18050
18051         (NewDelegate.DoResolve): Update for Argument.Resolve.
18052
18053         * class.cs (ConstructorInitializer.DoResolve): ditto.
18054
18055         * attribute.cs (Attribute.Resolve): ditto.
18056
18057 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18058
18059         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18060
18061         * expression.cs (ParameterReference): Drop IStackStorage and implement
18062         IAssignMethod instead. 
18063
18064         (LocalVariableReference): ditto.
18065
18066         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18067         IAssignMethod instead. 
18068
18069 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18070
18071         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18072         enumerations that are used in heavily used structures derive from
18073         byte in a laughable and pathetic attempt to reduce memory usage.
18074         This is the kind of pre-optimzations that you should not do at
18075         home without adult supervision.
18076
18077         * expression.cs (UnaryMutator): New class, used to handle ++ and
18078         -- separatedly from the other unary operators.  Cleans up the
18079         code, and kills the ExpressionStatement dependency in Unary.
18080
18081         (Unary): Removed `method' and `Arguments' from this class, making
18082         it smaller, and moving it all to SimpleCall, so I can reuse this
18083         code in other locations and avoid creating a lot of transient data
18084         strucutres when not required.
18085
18086         * cs-parser.jay: Adjust for new changes.
18087
18088 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18089
18090         * enum.cs (Enum.Populate): If there is a failure during
18091         definition, return
18092
18093         * cs-parser.jay (opt_enum_base): we used to catch type errors
18094         here, but this is really incorrect.  The type error should be
18095         catched during semantic analysis.
18096
18097 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18098
18099         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18100         current_local_parameters as expected since I, in my stupidity, had forgotten
18101         to do this :-)
18102
18103         * attribute.cs (GetValidPlaces): Fix stupid bug.
18104
18105         * class.cs (Method::Emit): Perform check on applicability of attributes.
18106
18107         (Constructor::Emit): Ditto.
18108
18109         (Field::Emit): Ditto.
18110
18111         (Field.Location): Store location information.
18112
18113         (Property, Event, Indexer, Operator): Ditto.
18114
18115         * cs-parser.jay (field_declaration): Pass in location for each field.
18116
18117         * ../errors/cs0592.cs : Add.
18118
18119 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18120
18121         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18122
18123         (InitCoreTypes): Update accordingly.
18124
18125         (RegisterAttrType, LookupAttr): Implement.
18126
18127         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18128         info about the same.
18129
18130         (Resolve): Update to populate the above as necessary.
18131
18132         (Error592): Helper.
18133
18134         (GetValidPlaces): Helper to the above.
18135
18136         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18137
18138         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18139
18140 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18141
18142         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18143
18144         * ../errors/cs0617.cs : Add.
18145
18146 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18147
18148         * enum.cs (Emit): Rename to Populate to be more consistent with what
18149         we expect it to do and when exactly it is called.
18150
18151         * class.cs, rootcontext.cs : Update accordingly.
18152
18153         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18154         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18155
18156         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18157
18158         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18159         of a fieldinfo using the above, when dealing with a FieldBuilder.
18160
18161 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18162
18163         * ../errors/cs0031.cs : Add.
18164
18165         * ../errors/cs1008.cs : Add.
18166
18167         * ../errrors/cs0543.cs : Add.
18168
18169         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18170         enum type.
18171
18172         (FindMembers): Implement.
18173
18174         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18175         enums and delegates too.
18176
18177         (enum_types): Rename to builder_to_enum.
18178
18179         (delegate_types): Rename to builder_to_delegate.
18180
18181         * delegate.cs (FindMembers): Implement.
18182
18183 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18184
18185         * typemanager.cs (IsEnumType): Implement.
18186
18187         * enum.cs (Emit): Re-write parts to account for the underlying type
18188         better and perform checking etc.
18189
18190         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18191         of the underlying type.
18192
18193         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18194         value
18195
18196         * enum.cs (error31): Helper to report error #31.
18197
18198         * cs-parser.jay (enum_declaration): Store location of each member too.
18199
18200         * enum.cs (member_to_location): New hashtable. 
18201
18202         (AddEnumMember): Update location hashtable.
18203
18204         (Emit): Use the location of each member while reporting errors.
18205
18206 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18207
18208         * cs-parser.jay: A for_initializer if is a
18209         local_variable_declaration really ammount to have an implicit
18210         block with the variable declaration and no initializer for for.
18211
18212         * statement.cs (For.Emit): Cope with null initializers.
18213
18214         This fixes the infinite loop on for initializers.
18215
18216 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18217
18218         * enum.cs: More cleanup.
18219
18220         * ecore.cs: Remove dead code.
18221
18222         * class.cs (Property.Emit): More simplification.
18223         (Event.Emit): ditto.
18224
18225         Reworked to have less levels of indentation.
18226
18227 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18228
18229         * class.cs (Property): Emit attributes.
18230
18231         (Field): Ditto.
18232
18233         (Event): Ditto.
18234
18235         (Indexer): Ditto.
18236
18237         (Operator): Ditto.
18238
18239         * enum.cs (Emit): Ditto.
18240
18241         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18242         Enums too.
18243
18244         * class.cs (Field, Event, etc.): Move attribute generation into the
18245         Emit method everywhere.
18246
18247         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18248         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18249         as we had no way of defining nested enums !
18250
18251         * rootcontext.cs : Adjust code accordingly.
18252
18253         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18254
18255 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18256
18257         * expression.cs (EvalConstantExpression): Move into ecore.cs
18258
18259         * enum.cs (Enum): Rename some members and make them public and readonly
18260         according to our convention.
18261
18262         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18263         nothing else.
18264
18265         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18266
18267         (Enum::Emit): Write a simple version for now which doesn't try to compute
18268         expressions. I shall modify this to be more robust in just a while.
18269
18270         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18271
18272         (TypeContainer::CloseType): Create the Enum types too.
18273
18274         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18275
18276         * expression.cs (EvalConstantExpression): Get rid of completely.
18277
18278         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18279         user-defined values and other cases.
18280
18281         (IsValidEnumLiteral): Helper function.
18282
18283         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18284         out there in the case we had a literal FieldExpr.
18285
18286         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18287
18288         (Literalize): Revamp a bit to take two arguments.
18289
18290         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18291
18292 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18293
18294         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18295
18296         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18297
18298         (Resolve): Use the above to ensure we have proper initializers.
18299
18300 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18301
18302         * expression.cs (Expression::EvalConstantExpression): New method to 
18303         evaluate constant expressions.
18304
18305         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18306
18307 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18310         in an array.
18311
18312         (Binary.ResolveOperator): Handle operator != (object a, object b)
18313         and operator == (object a, object b);
18314
18315         (Binary.DoNumericPromotions): Indicate whether the numeric
18316         promotion was possible.
18317
18318         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18319         Implement.  
18320
18321         Made the ArrayAccess implement interface IAssignMethod instead of
18322         IStackStore as the order in which arguments are passed reflects
18323         this.
18324
18325         * assign.cs: Instead of using expr.ExprClass to select the way of
18326         assinging, probe for the IStackStore/IAssignMethod interfaces.
18327
18328         * typemanager.cs: Load InitializeArray definition.
18329
18330         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18331         static data that can be used to initialize arrays. 
18332
18333 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18334
18335         * expression.cs: Handle operator== and operator!= for booleans.
18336
18337         (Conditioal.Reduce): Implement reducer for the ?: operator.
18338
18339         (Conditional.Resolve): Implement dead code elimination.
18340
18341         (Binary.Resolve): Catch string literals and return a new
18342         concatenated string.
18343
18344         (Unary.Reduce): Implement reduction of unary expressions.
18345
18346         * ecore.cs: Split out the expression core handling here.
18347
18348         (Expression.Reduce): New method used to perform constant folding
18349         and CSE.  This is needed to support constant-expressions. 
18350
18351         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18352         targets, and optimize for !x.
18353
18354 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18355
18356         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18357         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18358         set custom atttributes.
18359
18360         * literal.cs (Literal::GetValue): New abstract method to return the actual
18361         value of the literal, cast as an object.
18362
18363         (*Literal): Implement GetValue method.
18364
18365         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18366         expressions to the arraylist but objects of type Argument.
18367
18368         * class.cs (TypeContainer::Emit): Emit our attributes too.
18369
18370         (Method::Emit, Constructor::Emit): Ditto.
18371
18372         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18373         to be ignoring earlier.
18374
18375 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18376
18377         * attribute.cs (AttributeSection::Define): Implement to do the business
18378         of constructing a CustomAttributeBuilder.
18379
18380         (Attribute): New trivial class. Increases readability of code.  
18381
18382         * cs-parser.jay : Update accordingly.
18383
18384         (positional_argument_list, named_argument_list, named_argument): New rules
18385
18386         (attribute_arguments): Use the above so that we are more correct.
18387
18388 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18389
18390         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18391         to perform all checks for a method with a params parameter.
18392
18393         (Invocation::OverloadResolve): Update to use the above method and therefore
18394         cope correctly with params method invocations.
18395
18396         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18397         params too.
18398
18399         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18400         constructors in our parent too because we can't afford to miss out on 
18401         protected ones ;-)
18402
18403         * attribute.cs (AttributeSection): New name for the class Attribute
18404
18405         Other trivial changes to improve readability.
18406
18407         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18408         use the new class names.
18409
18410 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18411
18412         * class.cs (Method::Define): Complete definition for params types too
18413
18414         (Indexer::Define): Ditto.
18415
18416         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18417         Cope everywhere with a request for info about the array parameter.
18418
18419 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18420
18421         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18422
18423         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18424         local_variable_type to extract the string corresponding to the type.
18425
18426         (local_variable_type): Fixup the action to use the new helper method.
18427
18428         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18429         go.
18430
18431         * expression.cs : Clean out code which uses the above.
18432
18433 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18434
18435         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18436         and bale out if necessary by returning a false.
18437
18438         (RegisterProperty): Ditto.
18439
18440         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18441         and print out appropriate error messages.
18442
18443         * interface.cs (everywhere): Ditto.
18444
18445         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18446         location to constructor.
18447
18448         * class.cs (Property, Event, Indexer): Update accordingly.
18449
18450         * ../errors/cs111.cs : Added.
18451
18452         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18453         of a method, as laid down by the spec.
18454
18455         (Invocation::OverloadResolve): Use the above method.
18456
18457 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18458
18459         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18460         now take a TypeContainer and a Parameters object.
18461
18462         (ParameterData): Modify return type of ParameterModifier method to be 
18463         Parameter.Modifier and not a string.
18464
18465         (ReflectionParameters, InternalParameters): Update accordingly.
18466
18467         * expression.cs (Argument::GetParameterModifier): Same here.
18468
18469         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18470         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18471         symbol in it at all so maybe this is only for now.
18472
18473 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18474
18475         * support.cs (InternalParameters): Constructor now takes an extra argument 
18476         which is the actual Parameters class.
18477
18478         (ParameterDesc): Update to provide info on ref/out modifiers.
18479
18480         * class.cs (everywhere): Update call to InternalParameters to pass in
18481         the second argument too.
18482
18483         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18484         to return the modifier info [ref/out etc]
18485
18486         (InternalParameters, ReflectionParameters): Implement the above.
18487
18488         * expression.cs (Argument::ParameterModifier): Similar function to return
18489         info about the argument's modifiers.
18490
18491         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18492         too.
18493
18494         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18495         a new SetFormalParameters object which we pass to InternalParameters.
18496
18497 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18498
18499         * expression.cs (NewArray): Merge into the ArrayCreation class.
18500
18501 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18502
18503         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18504         NewUserdefinedArray into one as there wasn't much of a use in having
18505         two separate ones.
18506
18507         * expression.cs (Argument): Change field's name to ArgType from Type.
18508
18509         (Type): New readonly property which returns the proper type, taking into 
18510         account ref/out modifiers.
18511
18512         (everywhere): Adjust code accordingly for the above.
18513
18514         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18515         whether we are emitting for a ref or out parameter.
18516
18517         * expression.cs (Argument::Emit): Use the above field to set the state.
18518
18519         (LocalVariableReference::Emit): Update to honour the flag and emit the
18520         right stuff.
18521
18522         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18523
18524         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18525
18526         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18527
18528         (ReflectionParameters, InternalParameters): Implement the above method.
18529
18530         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18531         reporting errors.
18532
18533         (Invocation::FullMethodDesc): Ditto. 
18534
18535 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18536
18537         * cs-parser.jay: Add extra production for the second form of array
18538         creation. 
18539
18540         * expression.cs (ArrayCreation): Update to reflect the above
18541         change. 
18542
18543         * Small changes to prepare for Array initialization.
18544
18545 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18546
18547         * typemanager.cs (ImplementsInterface): interface might be null;
18548         Deal with this problem;
18549
18550         Also, we do store negative hits on the cache (null values), so use
18551         this instead of calling t.GetInterfaces on the type everytime.
18552
18553 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18554
18555         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18556
18557         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18558         split functionality out into different classes.
18559
18560         (New::FormArrayType): Move into NewBuiltinArray.
18561
18562         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18563         quite useless.
18564
18565         (NewBuiltinArray): New class to handle creation of built-in arrays.
18566
18567         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18568         account creation of one-dimensional arrays.
18569
18570         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18571
18572         (NewUserdefinedArray::DoResolve): Implement.
18573
18574         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18575
18576         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18577         we maintain inside the TypeManager. This is necessary to perform lookups on the
18578         module builder.
18579
18580         (LookupType): Update to perform GetType on the module builders too.     
18581
18582         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18583
18584         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18585
18586 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18587
18588         * expression.cs (New::DoResolve): Implement guts of array creation.
18589
18590         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18591
18592 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18593
18594         * expression.cs: Fix bug I introduced lsat night that broke
18595         Delegates. 
18596
18597         (Expression.Resolve): Report a 246 error (can not resolve name)
18598         if we find a SimpleName in the stream.
18599
18600         (Expression.ResolveLValue): Ditto.
18601
18602         (Expression.ResolveWithSimpleName): This function is a variant of
18603         ResolveName, this one allows SimpleNames to be returned without a
18604         warning.  The only consumer of SimpleNames is MemberAccess
18605
18606 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18607
18608         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18609         might arrive here.  I have my doubts that this is correct.
18610
18611         * statement.cs (Lock): Implement lock statement.
18612
18613         * cs-parser.jay: Small fixes to support `lock' and `using'
18614
18615         * cs-tokenizer.cs: Remove extra space
18616
18617         * driver.cs: New flag --checked, allows to turn on integer math
18618         checking. 
18619
18620         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18621         Threading.Monitor.Exit 
18622
18623 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18624
18625         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18626         Expression Class to be IndexerAccess.
18627
18628         Notice that Indexer::DoResolve sets the eclass to Value.
18629
18630 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18631
18632         * class.cs (TypeContainer::Emit): Emit code for indexers.
18633
18634         * assign.cs (IAssignMethod): New interface implemented by Indexers
18635         and Properties for handling assignment.
18636
18637         (Assign::Emit): Simplify and reuse code. 
18638
18639         * expression.cs (IndexerAccess, PropertyExpr): Implement
18640         IAssignMethod, clean up old code. 
18641
18642 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18643
18644         * typemanager.cs (ImplementsInterface): New method to determine if a type
18645         implements a given interface. Provides a nice cache too.
18646
18647         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18648         method.
18649
18650         (ConvertReferenceExplicit): Ditto.
18651
18652         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18653         various methods, with correct names etc.
18654
18655         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18656         Operator.UnaryNegation.
18657
18658         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18659         we have a unary plus or minus operator.
18660
18661         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18662         UnaryMinus.
18663
18664         * everywhere : update accordingly.
18665
18666         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18667         respectively.
18668
18669         * class.cs (Method::Define): For the case where we are implementing a method
18670         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18671         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18672
18673 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18674
18675         * interface.cs (FindMembers): Implement to work around S.R.E
18676         lameness.
18677
18678         * typemanager.cs (IsInterfaceType): Implement.
18679
18680         (FindMembers): Update to handle interface types too.
18681
18682         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18683         use IsAssignableFrom as that is not correct - it doesn't work.
18684
18685         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18686         and accordingly override EmitStatement.
18687
18688         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18689         using the correct logic :-)
18690
18691 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18692
18693         * ../errors/cs-11.cs : Add to demonstrate error -11 
18694
18695 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18696
18697         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18698         then pass this as a hint to ResolveLValue.
18699
18700         * expression.cs (FieldExpr): Add Location information
18701
18702         (FieldExpr::LValueResolve): Report assignment to readonly
18703         variable. 
18704
18705         (Expression::ExprClassFromMemberInfo): Pass location information.
18706
18707         (Expression::ResolveLValue): Add new method that resolves an
18708         LValue. 
18709
18710         (Expression::DoResolveLValue): Default invocation calls
18711         DoResolve. 
18712
18713         (Indexers): New class used to keep track of indexers in a given
18714         Type. 
18715
18716         (IStackStore): Renamed from LValue, as it did not really describe
18717         what this did.  Also ResolveLValue is gone from this interface and
18718         now is part of Expression.
18719
18720         (ElementAccess): Depending on the element access type
18721
18722         * typemanager.cs: Add `indexer_name_type' as a Core type
18723         (System.Runtime.CompilerServices.IndexerNameAttribute)
18724
18725         * statement.cs (Goto): Take a location.
18726
18727 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18728
18729         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18730         if two delegates are compatible.
18731
18732         (NewDelegate::DoResolve): Update to take care of the case when
18733         we instantiate a delegate from another delegate.
18734
18735         * typemanager.cs (FindMembers): Don't even try to look up members
18736         of Delegate types for now.
18737
18738 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18739
18740         * delegate.cs (NewDelegate): New class to take care of delegate
18741         instantiation.
18742
18743         * expression.cs (New): Split the delegate related code out into 
18744         the NewDelegate class.
18745
18746         * delegate.cs (DelegateInvocation): New class to handle delegate 
18747         invocation.
18748
18749         * expression.cs (Invocation): Split out delegate related code into
18750         the DelegateInvocation class.
18751
18752 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18753
18754         * expression.cs (New::DoResolve): Implement delegate creation fully
18755         and according to the spec.
18756
18757         (New::DoEmit): Update to handle delegates differently.
18758
18759         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18760         because of which we were printing out arguments in reverse order !
18761
18762         * delegate.cs (VerifyMethod): Implement to check if the given method
18763         matches the delegate.
18764
18765         (FullDelegateDesc): Implement.
18766
18767         (VerifyApplicability): Implement.
18768
18769         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18770         delegate invocations too.
18771
18772         (Invocation::Emit): Ditto.
18773
18774         * ../errors/cs1593.cs : Added.
18775
18776         * ../errors/cs1594.cs : Added.
18777
18778         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18779
18780 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18781
18782         * typemanager.cs (intptr_type): Core type for System.IntPtr
18783
18784         (InitCoreTypes): Update for the same.
18785
18786         (iasyncresult_type, asynccallback_type): Ditto.
18787
18788         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18789         correct.
18790
18791         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18792         too.
18793
18794         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18795         the builders for the 4 members of a delegate type :-)
18796
18797         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18798         type.
18799
18800         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18801
18802         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18803
18804 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18805
18806         * statement.cs (Break::Emit): Implement.   
18807         (Continue::Emit): Implement.
18808
18809         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18810         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18811         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18812         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18813         end loop
18814
18815         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18816         properties that track the label for the current loop (begin of the
18817         loop and end of the loop).
18818
18819 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18820
18821         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18822         use of emitting anything at all.
18823
18824         * class.cs, rootcontext.cs : Get rid of calls to the same.
18825
18826         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18827
18828         (Populate): Define the constructor correctly and set the implementation
18829         attributes.
18830
18831         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18832         have been defined.
18833
18834         (AddDelegateType): Implement.
18835
18836         (IsDelegateType): Implement helper method.
18837
18838         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18839
18840         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18841         and accordingly handle it.
18842
18843         * delegate.cs (Populate): Take TypeContainer argument.
18844         Implement bits to define the Invoke method. However, I still haven't figured out
18845         how to take care of the native int bit :-(
18846
18847         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18848         Qualify the name of the delegate, not its return type !
18849
18850         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18851         conversion.
18852
18853         (StandardConversionExists): Checking for array types turns out to be recursive.
18854
18855         (ConvertReferenceExplicit): Implement array conversion.
18856
18857         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18858
18859 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18860
18861         * cs-parser.jay (delegate_declaration): Store the fully qualified
18862         name as it is a type declaration.
18863
18864         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18865         readonly.
18866
18867         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18868         as TypeContainer::DefineType.
18869
18870         (Populate): Method in which all the definition of the various methods (Invoke)
18871         etc is done.
18872
18873         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18874         see.
18875
18876         (CloseDelegate): Finally creates the delegate.
18877
18878         * class.cs (TypeContainer::DefineType): Update to define delegates.
18879         (Populate, Emit and CloseType): Do the same thing here too.
18880
18881         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18882         delegates in all these operations.
18883
18884 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18885
18886         * expression.cs: LocalTemporary: a new expression used to
18887         reference a temporary that has been created.
18888
18889         * assign.cs: Handle PropertyAccess back here, so that we can
18890         provide the proper semantic access to properties.
18891
18892         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18893         a few more explicit conversions. 
18894
18895         * modifiers.cs: `NEW' modifier maps to HideBySig.
18896
18897         * expression.cs (PropertyExpr): Make this into an
18898         ExpressionStatement, and support the EmitStatement code path. 
18899
18900         Perform get/set error checking, clean up the interface.
18901
18902         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18903         them into toplevel access objects.
18904
18905 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18906
18907         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18908         SRE.
18909
18910         * typemanager.cs: Keep track here of our PropertyBuilders again to
18911         work around lameness in SRE.
18912
18913 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18914
18915         * expression.cs (LValue::LValueResolve): New method in the
18916         interface, used to perform a second resolution pass for LValues. 
18917
18918         (This::DoResolve): Catch the use of this in static methods.
18919
18920         (This::LValueResolve): Implement.
18921
18922         (This::Store): Remove warning, assigning to `this' in structures
18923         is 
18924
18925         (Invocation::Emit): Deal with invocation of
18926         methods on value types.  We need to pass the address to structure
18927         methods rather than the object itself.  (The equivalent code to
18928         emit "this" for structures leaves the entire structure on the
18929         stack instead of a pointer to it). 
18930
18931         (ParameterReference::DoResolve): Compute the real index for the
18932         argument based on whether the method takes or not a `this' pointer
18933         (ie, the method is static).
18934
18935         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18936         value types returned from functions when we need to invoke a
18937         method on the sturcture.
18938
18939
18940 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18941
18942         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18943         defining the type in the Modulebuilder or Typebuilder. This is to take
18944         care of nested types which need to be defined on the TypeBuilder using
18945         DefineNestedMethod.
18946
18947         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18948         methods in RootContext, only ported to be part of TypeContainer.
18949
18950         (TypeContainer::GetInterfaceOrClass): Ditto.
18951
18952         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18953
18954         * interface.cs (Interface::DefineInterface): New method. Does exactly
18955         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18956         too.
18957
18958         (Interface::GetInterfaces): Move from RootContext here and port.
18959
18960         (Interface::GetInterfaceByName): Same here.
18961
18962         * rootcontext.cs (ResolveTree): Re-write.
18963
18964         (PopulateTypes): Re-write.
18965
18966         * class.cs (TypeContainer::Populate): Populate nested types too.
18967         (TypeContainer::Emit): Emit nested members too.
18968
18969         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18970         instead just use the name argument passed in as it is already fully
18971         qualified.
18972
18973         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18974         to TypeContainer mapping to see if a type is user-defined.
18975
18976         * class.cs (TypeContainer::CloseType): Implement. 
18977
18978         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18979         the default constructor.
18980
18981         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18982         twice.
18983
18984         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18985
18986         * interface.cs (CloseType): Create the type here.
18987
18988         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18989         the hierarchy.
18990
18991         Remove all the methods which are now in TypeContainer.
18992
18993 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18994
18995         * delegate.cs (Define): Re-write bits to define the delegate
18996         correctly.
18997
18998 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18999
19000         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19001
19002         * expression.cs (ImplicitReferenceConversion): handle null as well
19003         as a source to convert to any reference type.
19004
19005         * statement.cs (Return): Perform any implicit conversions to
19006         expected return type.  
19007
19008         Validate use of return statement.  
19009
19010         * codegen.cs (EmitContext): Pass the expected return type here.
19011
19012         * class.cs (Method, Constructor, Property): Pass expected return
19013         type to EmitContext.
19014
19015 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19016
19017         * expression.cs: Make DoResolve take an EmitContext instead of a
19018         TypeContainer.
19019
19020         Replaced `l' and `location' for `loc', for consistency.
19021
19022         (Error, Warning): Remove unneeded Tc argument.
19023
19024         * assign.cs, literal.cs, constant.cs: Update to new calling
19025         convention. 
19026
19027         * codegen.cs: EmitContext now contains a flag indicating whether
19028         code is being generated in a static method or not.
19029
19030         * cs-parser.jay: DecomposeQI, new function that replaces the old
19031         QualifiedIdentifier.  Now we always decompose the assembled
19032         strings from qualified_identifier productions into a group of
19033         memberaccesses.
19034
19035 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19036
19037         * rootcontext.cs: Deal with field-less struct types correctly now
19038         by passing the size option to Define Type.
19039
19040         * class.cs: Removed hack that created one static field. 
19041
19042 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * statement.cs: Moved most of the code generation here. 
19045
19046 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19047
19048         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19049         seem very right.
19050
19051         (ElementAccess): Remove useless bits for now - keep checks as the spec
19052         says.
19053
19054 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19055
19056         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19057         and start performing checks according to the spec.
19058
19059 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19060
19061         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19062         rank_specifiers instead.
19063
19064         (rank_specifiers): Change the order in which the rank specifiers are stored
19065
19066         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19067
19068         * expression.cs (ElementAccess): Implement the LValue interface too.
19069
19070 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19071
19072         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19073         except that user defined conversions are not included.
19074
19075         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19076         perform the conversion of the return type, if necessary.
19077
19078         (New::DoResolve): Check whether we are creating an array or an object
19079         and accordingly do the needful.
19080
19081         (New::Emit): Same here.
19082
19083         (New::DoResolve): Implement guts of array creation.
19084
19085         (New::FormLookupType): Helper function.
19086
19087 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19088
19089         * codegen.cs: Removed most of the code generation here, and move the
19090         corresponding code generation bits to the statement classes. 
19091
19092         Added support for try/catch/finalize and throw.
19093
19094         * cs-parser.jay: Added support for try/catch/finalize.
19095
19096         * class.cs: Catch static methods having the flags override,
19097         virtual or abstract.
19098
19099         * expression.cs (UserCast): This user cast was not really doing
19100         what it was supposed to do.  Which is to be born in fully resolved
19101         state.  Parts of the resolution were being performed at Emit time! 
19102
19103         Fixed this code.
19104
19105 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19106
19107         * expression.cs: Implicity convert the result from UserCast.
19108
19109 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19110
19111         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19112         prevented it from working correctly. 
19113
19114         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19115         merely ConvertImplicit.
19116
19117 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19118
19119         * typemanager.cs: Make the LookupTypeContainer function static,
19120         and not per-instance.  
19121
19122         * class.cs: Make static FindMembers (the one that takes a Type
19123         argument). 
19124
19125         * codegen.cs: Add EmitForeach here.
19126
19127         * cs-parser.jay: Make foreach a toplevel object instead of the
19128         inline expansion, as we need to perform semantic analysis on it. 
19129
19130 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19131
19132         * expression.cs (Expression::ImplicitUserConversion): Rename to
19133         UserDefinedConversion.
19134
19135         (Expression::UserDefinedConversion): Take an extra argument specifying 
19136         whether we look for explicit user conversions too.
19137
19138         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19139
19140         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19141
19142         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19143         with the appropriate arguments.
19144
19145         * cs-parser.jay (cast_expression): Record location too.
19146
19147         * expression.cs (Cast): Record location info.
19148
19149         (Expression::ConvertExplicit): Take location argument.
19150
19151         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19152         to determine if we are doing explicit conversions.
19153
19154         (UserCast::Emit): Update accordingly.
19155
19156         (Expression::ConvertExplicit): Report an error if everything fails.
19157
19158         * ../errors/cs0030.cs : Add.
19159
19160 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19161
19162         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19163         virtual and newslot bits. 
19164
19165         * class.cs (TypeContainer::RegisterRequiredImplementations):
19166         Record methods we need.
19167
19168         (TypeContainer::MakeKey): Helper function to make keys for
19169         MethodBases, since the Methodbase key is useless.
19170
19171         (TypeContainer::Populate): Call RegisterRequiredImplementations
19172         before defining the methods.   
19173
19174         Create a mapping for method_builders_to_methods ahead of time
19175         instead of inside a tight loop.
19176
19177         (::RequireMethods):  Accept an object as the data to set into the
19178         hashtable so we can report interface vs abstract method mismatch.
19179
19180 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19181
19182         * report.cs: Make all of it static.
19183
19184         * rootcontext.cs: Drop object_type and value_type computations, as
19185         we have those in the TypeManager anyways.
19186
19187         Drop report instance variable too, now it is a global.
19188
19189         * driver.cs: Use try/catch on command line handling.
19190
19191         Add --probe option to debug the error reporting system with a test
19192         suite. 
19193
19194         * report.cs: Add support for exiting program when a probe
19195         condition is reached.
19196
19197 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19198
19199         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19200         we do a forcible conversion regardless of type, to check if 
19201         ForceConversion returns a null.
19202
19203         (Binary::error19): Use location to report error.
19204
19205         (Unary::error23): Use location here too.
19206
19207         * ../errors/cs0019.cs : Check in.
19208
19209         * ../errors/cs0023.cs : Check in.
19210
19211         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19212         case of a non-null MethodInfo object with a length of 0 !
19213
19214         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19215         an applicable member - according to the spec :-)
19216         Also fix logic to find members in base types.
19217
19218         (Unary::ResolveOperator): Same here.
19219
19220         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19221         as I was getting thoroughly confused between this and error19 :-)
19222
19223         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19224         (::FindMostEncompassedType): Implement.
19225         (::FindMostEncompassingType): Implement.
19226         (::StandardConversionExists): Implement.
19227
19228         (UserImplicitCast): Re-vamp. We now need info about most specific
19229         source and target types so that we can do the necessary conversions.
19230
19231         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19232         mathematical union with no duplicates.
19233
19234 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19235
19236         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19237         in order from base classes to child classes, so that we can in
19238         child classes look up in our parent for method names and
19239         attributes (required for handling abstract, virtual, new, override
19240         constructs: we need to instrospect our base class, and if we dont
19241         populate the classes in order, the introspection might be
19242         incorrect.  For example, a method could query its parent before
19243         the parent has any methods and would determine that the parent has
19244         no abstract methods (while it could have had them)).
19245
19246         (RootContext::CreateType): Record the order in which we define the
19247         classes.
19248
19249 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19250
19251         * class.cs (TypeContainer::Populate): Also method definitions can
19252         fail now, keep track of this.
19253
19254         (TypeContainer::FindMembers): Implement support for
19255         DeclaredOnly/noDeclaredOnly flag.
19256
19257         (Constructor::Emit) Return the ConstructorBuilder.
19258
19259         (Method::Emit) Return the MethodBuilder. 
19260         Check for abstract or virtual methods to be public.
19261
19262         * rootcontext.cs (RootContext::CreateType): Register all the
19263         abstract methods required for the class to be complete and the
19264         interface methods that must be implemented. 
19265
19266         * cs-parser.jay: Report error 501 (method requires body if it is
19267         not marked abstract or extern).
19268
19269         * expression.cs (TypeOf::Emit): Implement.
19270
19271         * typemanager.cs: runtime_handle_type, new global type.
19272
19273         * class.cs (Property::Emit): Generate code for properties.
19274
19275 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19276
19277         * expression.cs (Unary::ResolveOperator): Find operators on base type
19278         too - we now conform exactly to the spec.
19279
19280         (Binary::ResolveOperator): Same here.
19281
19282         * class.cs (Operator::Define): Fix minor quirk in the tests.
19283
19284         * ../errors/cs0215.cs : Added.
19285
19286         * ../errors/cs0556.cs : Added.
19287
19288         * ../errors/cs0555.cs : Added.
19289
19290 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19291
19292         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19293         single integer which is really efficient
19294
19295 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19296
19297         *  expression.cs (Expression::ImplicitUserConversion): Use location
19298         even in the case when we are examining True operators.
19299  
19300         * class.cs (Operator::Define): Perform extensive checks to conform
19301         with the rules for operator overloading in the spec.
19302
19303         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19304         some of the other conversions mentioned in the spec.
19305
19306         * typemanager.cs (array_type): New static member for the System.Array built-in
19307         type.
19308
19309         (cloneable_interface): For System.ICloneable interface.
19310
19311         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19312         we start resolving the tree and populating types.
19313
19314         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19315  
19316 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19317
19318         * expression.cs (Expression::ExprClassFromMemberInfo,
19319         Expression::Literalize): Create literal expressions from
19320         FieldInfos which are literals.
19321
19322         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19323         type casts, because they were wrong.  The test suite in tests
19324         caught these ones.
19325
19326         (ImplicitNumericConversion): ushort to ulong requires a widening
19327         cast. 
19328
19329         Int32 constant to long requires widening cast as well.
19330
19331         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19332         for integers because the type on the stack is not i4.
19333
19334 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19335
19336         * expression.cs (report118): require location argument. 
19337
19338         * parameter.cs: Do not dereference potential null value.
19339
19340         * class.cs: Catch methods that lack the `new' keyword when
19341         overriding a name.  Report warnings when `new' is used without
19342         anything being there to override.
19343
19344         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19345
19346         * class.cs: Only add constructor to hashtable if it is non-null
19347         (as now constructors can fail on define).
19348
19349         (TypeManager, Class, Struct): Take location arguments.
19350
19351         Catch field instance initialization in structs as errors.
19352
19353         accepting_filter: a new filter for FindMembers that is static so
19354         that we dont create an instance per invocation.
19355
19356         (Constructor::Define): Catch errors where a struct constructor is
19357         parameterless 
19358
19359         * cs-parser.jay: Pass location information for various new
19360         constructs. 
19361
19362         * delegate.cs (Delegate): take a location argument.
19363
19364         * driver.cs: Do not call EmitCode if there were problesm in the
19365         Definition of the types, as many Builders wont be there. 
19366
19367         * decl.cs (Decl::Decl): Require a location argument.
19368
19369         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19370         into integers, and find the most appropiate integer for it.
19371
19372         * literal.cs: Implement ULongLiteral.
19373
19374         * rootcontext.cs: Provide better information about the location of
19375         failure when CreateType fails.
19376
19377 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19378
19379         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19380         as well.
19381
19382         * expression.cs (Binary::CheckShiftArguments): Add missing type
19383         computation.
19384         (Binary::ResolveOperator): Add type to the logical and and logical
19385         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19386         before.
19387
19388         (Binary::DoNumericPromotions): In the case where either argument
19389         is ulong (and most signed types combined with ulong cause an
19390         error) perform implicit integer constant conversions as well.
19391
19392 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19393
19394         * expression.cs (UserImplicitCast): Method should always be
19395         non-null. 
19396         (Invocation::BetterConversion): Simplified test for IntLiteral.
19397
19398         (Expression::ImplicitNumericConversion): Split this routine out.
19399         Put the code that performs implicit constant integer conversions
19400         here. 
19401
19402         (Expression::Resolve): Become a wrapper around DoResolve so we can
19403         check eclass and type being set after resolve.
19404
19405         (Invocation::Badness): Remove this dead function
19406
19407         (Binary::ResolveOperator): Do not compute the expensive argumnets
19408         unless we have a union for it.
19409
19410         (Probe::Emit): Is needs to do an isinst and then
19411         compare against null.
19412
19413         (::CanConvert): Added Location argument.  If the Location argument
19414         is null (Location.Null), then we do not report errors.  This is
19415         used by the `probe' mechanism of the Explicit conversion.  We do
19416         not want to generate an error for something that the user
19417         explicitly requested to be casted.  But the pipeline for an
19418         explicit cast first tests for potential implicit casts.
19419
19420         So for now, if the Location is null, it means `Probe only' to
19421         avoid adding another argument.   Might have to revise this
19422         strategy later.
19423
19424         (ClassCast): New class used to type cast objects into arbitrary
19425         classes (used in Explicit Reference Conversions).
19426
19427         Implement `as' as well.
19428
19429         Reverted all the patches from Ravi below: they were broken:
19430
19431                 * The use of `level' as a mechanism to stop recursive
19432                   invocations is wrong.  That was there just to catch the
19433                   bug with a strack trace but not as a way of addressing
19434                   the problem.
19435
19436                   To fix the problem we have to *understand* what is going
19437                   on and the interactions and come up with a plan, not
19438                   just get things going.
19439
19440                 * The use of the type conversion cache that I proposed
19441                   last night had an open topic: How does this work across
19442                   protection domains.  A user defined conversion might not
19443                   be public in the location where we are applying the
19444                   conversion, a different conversion might be selected
19445                   (ie, private A->B (better) but public B->A (worse),
19446                   inside A, A->B applies, but outside it, B->A will
19447                   apply).
19448
19449                 * On top of that (ie, even if the above is solved),
19450                   conversions in a cache need to be abstract.  Ie, `To
19451                   convert from an Int to a Short use an OpcodeCast', not
19452                   `To convert from an Int to a Short use the OpcodeCast on
19453                   the variable 5' (which is what this patch was doing).
19454
19455 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19456
19457         * expression.cs (Invocation::ConversionExists): Re-write to use
19458         the conversion cache
19459
19460         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19461         cache all conversions done, not just user-defined ones.
19462
19463         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19464         to determine if a conversion exists instead of acutually trying to 
19465         perform the conversion. It's faster too.
19466
19467         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19468         and only then attempt the implicit conversion.
19469
19470 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19471
19472         * expression.cs (ConvertImplicit): Use a cache for conversions
19473         already found. Check level of recursion and bail out if necessary.
19474
19475 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19476
19477         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19478         Export standard methods that we expect for string operations.
19479
19480         * statement.cs (Block::UsageWarning): Track usage of variables and
19481         report the errors for not used variables.
19482
19483         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19484         operator. 
19485
19486 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19487
19488         * codegen.cs: remove unnneded code 
19489
19490         * expression.cs: Removed BuiltinTypeAccess class
19491
19492         Fix the order in which implicit conversions are
19493         done.  
19494
19495         The previous fixed dropped support for boxed conversions (adding a
19496         test to the test suite now)
19497
19498         (UserImplicitCast::CanConvert): Remove test for source being null,
19499         that code is broken.  We should not feed a null to begin with, if
19500         we do, then we should track the bug where the problem originates
19501         and not try to cover it up here.
19502
19503         Return a resolved expression of type UserImplicitCast on success
19504         rather than true/false.  Ravi: this is what I was talking about,
19505         the pattern is to use a static method as a "constructor" for
19506         objects. 
19507
19508         Also, do not create arguments until the very last minute,
19509         otherwise we always create the arguments even for lookups that
19510         will never be performed. 
19511
19512         (UserImplicitCast::Resolve): Eliminate, objects of type
19513         UserImplicitCast are born in a fully resolved state. 
19514
19515         * typemanager.cs (InitCoreTypes): Init also value_type
19516         (System.ValueType). 
19517
19518         * expression.cs (Cast::Resolve): First resolve the child expression.
19519
19520         (LValue): Add new method AddressOf to be used by
19521         the `&' operator.  
19522
19523         Change the argument of Store to take an EmitContext instead of an
19524         ILGenerator, because things like FieldExpr need to be able to call
19525         their children expression to generate the instance code. 
19526
19527         (Expression::Error, Expression::Warning): Sugar functions for
19528         reporting errors.
19529
19530         (Expression::MemberLookup): Accept a TypeContainer instead of a
19531         Report as the first argument.
19532
19533         (Expression::ResolvePrimary): Killed.  I still want to improve
19534         this as currently the code is just not right.
19535
19536         (Expression::ResolveMemberAccess): Simplify, but it is still
19537         wrong. 
19538
19539         (Unary::Resolve): Catch errors in AddressOf operators.
19540
19541         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19542         index to a byte for the short-version, or the compiler will choose
19543         the wrong Emit call, which generates the wrong data.
19544
19545         (ParameterReference::Emit, ::Store): same.
19546
19547         (FieldExpr::AddressOf): Implement.
19548
19549         * typemanager.cs: TypeManager: made public variable instead of
19550         property.
19551
19552         * driver.cs: document --fatal.
19553
19554         * report.cs (ErrorMessage, WarningMessage): new names for the old
19555         Error and Warning classes.
19556
19557         * cs-parser.jay (member_access): Turn built-in access to types
19558         into a normal simplename
19559
19560 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19561
19562         * expression.cs (Invocation::BetterConversion): Fix to cope
19563         with q being null, since this was introducing a bug.
19564
19565         * expression.cs (ConvertImplicit): Do built-in conversions first.
19566
19567 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19568
19569         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19570
19571 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19572
19573         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19574         I had introduced long ago (what's new ?).
19575
19576         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19577         the work of all the checking. 
19578         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19579         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19580
19581         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19582         that is the right way. 
19583
19584         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19585         overloading resolution. Use everywhere instead of cutting and pasting code.
19586
19587         (Binary::ResolveOperator): Use MakeUnionSet.
19588
19589         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19590         we have to convert to bool types. Not complete yet.
19591
19592 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * typemanager.cs (TypeManager::CSharpName): support ushort.
19595
19596         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19597         to provide an expression that performsn an implicit constant int
19598         conversion (section 6.1.6).
19599         (Expression::ConvertImplicitRequired): Reworked to include
19600         implicit constant expression conversions.
19601
19602         (Expression::ConvertNumericExplicit): Finished.
19603
19604         (Invocation::Emit): If InstanceExpression is null, then it means
19605         that we perform a call on this.
19606
19607 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19608
19609         * expression.cs (Unary::Emit): Remove some dead code.
19610         (Probe): Implement Resolve and Emit for `is'.
19611         (Expression::ConvertImplicitRequired): Attempt to do constant
19612         expression conversions here.  Maybe should be moved to
19613         ConvertImplicit, but I am not sure.
19614         (Expression::ImplicitLongConstantConversionPossible,
19615         Expression::ImplicitIntConstantConversionPossible): New functions
19616         that tell whether is it possible to apply an implicit constant
19617         expression conversion.
19618
19619         (ConvertNumericExplicit): Started work on explicit numeric
19620         conversions.
19621
19622         * cs-parser.jay: Update operator constants.
19623
19624         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19625         (Parameters::GetSignature): Hook up VerifyArgs here.
19626         (Parameters::VerifyArgs): Verifies that no two arguments have the
19627         same name. 
19628
19629         * class.cs (Operator): Update the operator names to reflect the
19630         ones that the spec expects (as we are just stringizing the
19631         operator names).
19632
19633         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19634         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19635         previous usage did only work for our methods.
19636         (Expression::ConvertImplicit): Handle decimal implicit numeric
19637         conversions as well.
19638         (Expression::InternalTypeConstructor): Used to invoke constructors
19639         on internal types for default promotions.
19640
19641         (Unary::Emit): Implement special handling for the pre/post
19642         increment/decrement for overloaded operators, as they need to have
19643         the same semantics as the other operators.
19644
19645         (Binary::ResolveOperator): ditto.
19646         (Invocation::ConversionExists): ditto.
19647         (UserImplicitCast::Resolve): ditto.
19648
19649 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19650
19651         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19652         operator, return after emitting body. Regression tests pass again !
19653
19654         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19655         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19656         (Invocation::OverloadResolve): Ditto.
19657         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19658
19659         * everywhere : update calls to the above methods accordingly.
19660
19661 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19662
19663         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19664
19665         * expression.cs (ExpressionStatement): New base class used for
19666         expressions that can appear in statements, so that we can provide
19667         an alternate path to generate expression that do not leave a value
19668         on the stack.
19669
19670         (Expression::Emit, and all the derivatives): We no longer return
19671         whether a value is left on the stack or not.  Every expression
19672         after being emitted leaves a single value on the stack.
19673
19674         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19675         facilties of ExpressionStatement if possible.
19676
19677         * cs-parser.jay: Update statement_expression.
19678
19679 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19680
19681         * driver.cs: Change the wording of message
19682
19683 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19684
19685         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19686         the type of the expression to the return type of the method if
19687         we have an overloaded operator match ! The regression tests pass again !
19688         (Unary::ResolveOperator): Ditto.
19689
19690         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19691         to find "op_Implicit", not "implicit" ;-)
19692         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19693         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19694
19695         * everywhere : Correct calls to the above accordingly.
19696
19697         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19698         (ConvertImplicit): Do user-defined conversion if it exists.
19699
19700 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19701
19702         * assign.cs: track location.
19703         (Resolve): Use implicit conversions on assignment.
19704
19705         * literal.cs: Oops.  Not good, Emit of short access values should
19706         pass (Bytes) or the wrong argument will be selected.
19707
19708         * expression.cs (Unary::Emit): Emit code for -expr.
19709
19710         (Unary::ResolveOperator): Handle `Substract' for non-constants
19711         (substract from zero from the non-constants).
19712         Deal with Doubles as well. 
19713
19714         (Expression::ConvertImplicitRequired): New routine that reports an
19715         error if no implicit conversion exists. 
19716
19717         (Invocation::OverloadResolve): Store the converted implicit
19718         expressions if we make them
19719
19720 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19721
19722         * class.cs (ConstructorInitializer): Take a Location argument.
19723         (ConstructorBaseInitializer): Same here.
19724         (ConstructorThisInitializer): Same here.
19725
19726         * cs-parser.jay : Update all calls accordingly.
19727
19728         * expression.cs (Unary, Binary, New): Take location argument.
19729         Update accordingly everywhere.
19730
19731         * cs-parser.jay : Update all calls to the above to take a location
19732         argument.
19733
19734         * class.cs : Ditto.
19735
19736 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19737
19738         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19739         (Invocation::BetterConversion): Same here
19740         (Invocation::ConversionExists): Ditto.
19741
19742         (Invocation::ConversionExists): Implement.
19743
19744 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19745
19746         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19747         Also take an additional TypeContainer argument.
19748
19749         * All over : Pass in TypeContainer as argument to OverloadResolve.
19750
19751         * typemanager.cs (CSharpName): Update to check for the string type and return
19752         that too.
19753
19754         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19755         a given method.
19756
19757 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19758
19759         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19760         (Invocation::BetterFunction): Implement.
19761         (Invocation::BetterConversion): Implement.
19762         (Invocation::ConversionExists): Skeleton, no implementation yet.
19763
19764         Okay, things work fine !
19765
19766 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19767
19768         * typemanager.cs: declare and load enum_type, delegate_type and
19769         void_type. 
19770
19771         * expression.cs (Expression::Emit): Now emit returns a value that
19772         tells whether a value is left on the stack or not.  This strategy
19773         might be reveted tomorrow with a mechanism that would address
19774         multiple assignments.
19775         (Expression::report118): Utility routine to report mismatches on
19776         the ExprClass.
19777
19778         (Unary::Report23): Report impossible type/operator combination
19779         utility function.
19780
19781         (Unary::IsIncrementableNumber): Whether the type can be
19782         incremented or decremented with add.
19783         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19784         complemented. 
19785         (Unary::ResolveOperator): Implement ++, !, ~,
19786
19787         (Invocation::Emit): Deal with new Emit convetion.
19788
19789         * All Expression derivatives: Updated their Emit method to return
19790         whether they leave values on the stack or not.
19791
19792         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19793         stack for expressions that are statements. 
19794
19795 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19796
19797         * expression.cs (LValue): New interface.  Must be implemented by
19798         LValue objects.
19799         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19800         LValue interface.
19801
19802         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19803         interface for generating code, simplifies the code.
19804
19805 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19806
19807         * expression.cs (everywhere): Comment out return statements in ::Resolve
19808         methods to avoid the warnings.
19809
19810 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19811
19812         * driver.cs (parse): Report error 2001 if we can not open the
19813         source file.
19814
19815         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19816         not resolve it.
19817
19818         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19819         object. 
19820
19821         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19822         otherwise nested blocks end up with the same index.
19823
19824         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19825
19826         * expression.cs:  Instead of having FIXMEs in the Resolve
19827         functions, throw exceptions so it is obvious that we are facing a
19828         bug. 
19829
19830         * cs-parser.jay (invocation_expression): Pass Location information.
19831
19832         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19833         Use a basename for those routines because .NET does not like paths
19834         on them. 
19835
19836         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19837         already defined.
19838
19839 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19840
19841         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19842         are loading the correct data types (throws an exception if not).
19843         (TypeManager::InitCoreTypes): Use CoreLookupType
19844
19845         * expression.cs (Unary::ResolveOperator): return the child
19846         expression for expressions which are just +expr.
19847         (Unary::ResolveOperator): Return negative literals for -LITERAL
19848         expressions (otherwise they are Unary {Literal}).
19849         (Invocation::Badness): Take into account `Implicit constant
19850         expression conversions'.
19851
19852         * literal.cs (LongLiteral): Implement long literal class.
19853         (IntLiteral): export the `Value' of the intliteral. 
19854
19855 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19856
19857         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19858
19859         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19860         instead of 'Operator'
19861
19862         * expression.cs (Binary::ResolveOperator): Update accordingly.
19863         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19864         and 'Minus'
19865
19866         * cs-parser.jay (unary_expression): Update to use the new names.
19867
19868         * gen-treedump.cs (GetUnary): Same here.
19869
19870         * expression.cs (Unary::Resolve): Implement.
19871         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19872         operators are found instead of making noise ;-)
19873         (Unary::ResolveOperator): New method to do precisely the same thing which
19874         Binary::ResolveOperator does for Binary expressions.
19875         (Unary.method, .Arguments): Add.
19876         (Unary::OperName): Implement.   
19877         (Unary::ForceConversion): Copy and Paste !
19878
19879         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19880         a unary operator.
19881
19882         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19883         for the inbuilt operators. Only overloading works for now ;-)
19884
19885 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19886
19887         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19888         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19889
19890         * expression.cs (This::Emit): Implement. 
19891         (This::Resolve): Implement.
19892         (TypeOf:Resolve): Implement.
19893         (Expression::ResolveSimpleName): Add an implicit this to instance
19894         field references. 
19895         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19896         Bind instance variable to Field expressions.
19897         (FieldExpr::Instance): New field used to track the expression that
19898         represents the object instance.
19899         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19900         binding 
19901         (FieldExpr::Emit): Implement.
19902
19903         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19904         the last instruction contains a return opcode to avoid generating
19905         the last `ret' instruction (this generates correct code, and it is
19906         nice to pass the peverify output).
19907
19908         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19909         initializer for static and instance variables.
19910         (Constructor::Emit): Allow initializer to be null in the case of
19911         static constructors.  Only emit initializer for instance
19912         constructors. 
19913
19914         (TypeContainer::FindMembers): Return a null array if there are no
19915         matches.
19916
19917         Also fix the code for the MemberTypes.Method branch, as it was not
19918         scanning that for operators (or tried to access null variables before).
19919
19920         * assign.cs (Assign::Emit): Handle instance and static fields. 
19921
19922         * TODO: Updated.
19923
19924         * driver.cs: Stop compilation if there are parse errors.
19925
19926         * cs-parser.jay (constructor_declaration): Provide default base
19927         initializer for non-static constructors.
19928         (constructor_declarator): Do not provide a default base
19929         initializers if none was specified.
19930         Catch the fact that constructors should not have parameters.
19931
19932         * class.cs: Do not emit parent class initializers for static
19933         constructors, that should be flagged as an error.
19934
19935 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19936
19937         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19938         Move back code into TypeContainer::Populate.
19939
19940 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19941
19942         * class.cs (TypeContainer::AddConstructor): Fix the check to
19943         compare against Name, not Basename. 
19944         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19945
19946         * cs-parser.jay : Update accordingly.
19947
19948         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19949         for methods, don't forget to look into the operators too.
19950         (RegisterMethodBuilder): Helper method to take care of this for
19951         methods, constructors and operators.
19952         (Operator::Define): Completely revamp.
19953         (Operator.OperatorMethod, MethodName): New fields.
19954         (TypeContainer::Populate): Move the registering of builders into
19955         RegisterMethodBuilder.
19956         (Operator::Emit): Re-write.
19957
19958         * expression.cs (Binary::Emit): Comment out code path to emit method
19959         invocation stuff for the case when we have a user defined operator. I am
19960         just not able to get it right !
19961
19962 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19963
19964         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19965         argument. 
19966
19967         (Expression::MemberLookup): Provide a version that allows to
19968         specify the MemberTypes and BindingFlags. 
19969
19970         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19971         so it was not fetching variable information from outer blocks.
19972
19973         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19974         Beforefieldinit as it was buggy.
19975
19976         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19977         that Ravi put here.  
19978
19979         * class.cs (Constructor::Emit): Only emit if block is not null.
19980         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19981         deal with this by semantically definining it as if the user had
19982         done it.
19983
19984         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19985         constructors as we now "emit" them at a higher level.
19986
19987         (TypeContainer::DefineDefaultConstructor): Used to define the
19988         default constructors if none was provided.
19989
19990         (ConstructorInitializer): Add methods Resolve and Emit. 
19991
19992         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19993
19994 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19995
19996         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19997         the default constructor builder with our hashtable for methodbuilders
19998         to methodcores.
19999
20000         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20001         and argument_count is 0 in which case we have a match.
20002         (Binary::ResolveOperator): More null checking and miscellaneous coding
20003         style cleanup.
20004
20005 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20006
20007         * rootcontext.cs (IsNameSpace): Compare against null.
20008
20009         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20010
20011         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20012         and Unary::Operator.
20013
20014         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20015         accordingly.
20016
20017         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20018         we have overloaded operators.
20019         (Binary::ResolveOperator): Implement the part which does the operator overload
20020         resolution.
20021
20022         * class.cs (Operator::Emit): Implement.
20023         (TypeContainer::Emit): Emit the operators we have too.
20024
20025         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20026         the case when we have a user-defined operator.
20027
20028 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20029
20030         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20031
20032 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20033
20034         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20035         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20036         (Constructor::Emit): Implement.
20037         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20038         if we have no work to do. 
20039         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20040         Emit method.
20041
20042         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20043         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20044
20045         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20046         of parent.parent.
20047
20048 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20049
20050         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20051         in the source.
20052         (Tree::RecordNamespace): Method to do what the name says ;-)
20053         (Tree::Namespaces): Property to get at the namespaces hashtable.
20054
20055         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20056         keep track.
20057
20058         * rootcontext.cs (IsNamespace): Fixed it :-)
20059
20060 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20061
20062         * class.cs (TypeContainer::FindMembers): Add support for
20063         constructors. 
20064         (MethodCore): New class that encapsulates both the shared aspects
20065         of a Constructor and a Method.  
20066         (Method, Constructor): Factored pieces into MethodCore.
20067
20068         * driver.cs: Added --fatal which makes errors throw exceptions.
20069         Load System assembly as well as part of the standard library.
20070
20071         * report.cs: Allow throwing exceptions on errors for debugging.
20072
20073         * modifiers.cs: Do not use `parent', instead use the real type
20074         container to evaluate permission settings.
20075
20076         * class.cs: Put Ravi's patch back in.  He is right, and we will
20077         have to cope with the
20078
20079 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20080
20081         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20082         FamORAssem, not FamANDAssem.
20083
20084 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20085
20086         * driver.cs: Added --parse option that only parses its input files
20087         and terminates.
20088
20089         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20090         incorrect.  IsTopLevel is not used to tell whether an object is
20091         root_types or not (that can be achieved by testing this ==
20092         root_types).  But to see if this is a top-level *class* (not
20093         necessarly our "toplevel" container). 
20094
20095 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20096
20097         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20098         parent instead of a direct call to GetType.
20099
20100 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20101
20102         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20103         Modifiers.TypeAttr. This should just be a call to that method.
20104
20105         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20106         object so that we can determine if we are top-level or not.
20107
20108         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20109         TypeContainer too.
20110
20111         * enum.cs (Enum::Define): Ditto.
20112
20113         * modifiers.cs (FieldAttr): Re-write.
20114
20115         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20116         (TypeContainer::HaveStaticConstructor): New property to provide access
20117         to precisely that info.
20118
20119         * modifiers.cs (MethodAttr): Re-write.
20120         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20121
20122         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20123         of top-level types as claimed.
20124
20125 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20126
20127         * expression.cs (MemberLookup): Fruitless attempt to lookup
20128         constructors.  Maybe I need to emit default constructors?  That
20129         might be it (currently .NET emits this for me automatically).
20130         (Invocation::OverloadResolve): Cope with Arguments == null.
20131         (Invocation::EmitArguments): new function, shared by the new
20132         constructor and us.
20133         (Invocation::Emit): Handle static and instance methods.  Emit
20134         proper call instruction for virtual or non-virtual invocations.
20135         (New::Emit): Implement.
20136         (New::Resolve): Implement.
20137         (MemberAccess:Resolve): Implement.
20138         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20139         to track instances.
20140         (FieldExpr::Resolve): Set type.
20141
20142         * support.cs: Handle empty arguments.
20143                 
20144         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20145         SimpleLookup): Auxiliary routines to help parse a qualifier
20146         identifier.  
20147
20148         Update qualifier_identifier rule.
20149
20150         * codegen.cs: Removed debugging messages.
20151
20152         * class.cs: Make this a global thing, this acts just as a "key" to
20153         objects that we might have around.
20154
20155         (Populate): Only initialize method_builders_to_methods once.
20156
20157         * expression.cs (PropertyExpr): Initialize type from the
20158         PropertyType. 
20159
20160         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20161         Resolve pattern.  Attempt to implicitly convert value to boolean.
20162         Emit code.
20163
20164         * expression.cs: Set the type for the int32/int32 argument case.
20165         (Binary::ResolveOperator): Set the return type to boolean for
20166         comparission operators
20167
20168         * typemanager.cs: Remove debugging print code.
20169
20170         (Invocation::Resolve): resolve type.
20171
20172         * class.cs: Allocate a MemberInfo of the correct size, as the code
20173         elsewhere depends on the test to reflect the correct contents.
20174
20175         (Method::) Keep track of parameters, due to System.Reflection holes
20176
20177         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20178         mapping here.
20179
20180         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20181         of the exact size and return that.
20182
20183         (Class::LookupMethodByBuilder): New function that maps
20184         MethodBuilders to its methods.  Required to locate the information
20185         on methods because System.Reflection bit us again.
20186
20187         * support.cs: New file, contains an interface ParameterData and
20188         two implementations: ReflectionParameters and InternalParameters
20189         used to access Parameter information.  We will need to grow this
20190         as required.
20191
20192         * expression.cs (Invocation::GetParameterData): implement a cache
20193         and a wrapper around the ParameterData creation for methods. 
20194         (Invocation::OverloadResolve): Use new code.
20195
20196 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20197
20198         * class.cs (TypeContainer::EmitField): Remove and move into 
20199         (Field::Define): here and modify accordingly.
20200         (Field.FieldBuilder): New member.
20201         (TypeContainer::Populate): Update accordingly.
20202         (TypeContainer::FindMembers): Implement.
20203
20204 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20205
20206         * statement.cs: (VariableInfo::VariableType): New field to be
20207         initialized with the full type once it is resolved. 
20208
20209 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20210
20211         * parameter.cs (GetParameterInfo): Use a type cache to compute
20212         things only once, and to reuse this information
20213
20214         * expression.cs (LocalVariableReference::Emit): Implement.
20215         (OpcodeCast::Emit): fix.
20216
20217         (ParameterReference::Resolve): Implement.
20218         (ParameterReference::Emit): Implement.
20219
20220         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20221         that are expressions need to stay as Expressions.
20222
20223         * typemanager.cs (CSharpName): Returns the C# name of a type if
20224         possible. 
20225
20226         * expression.cs (Expression::ConvertImplicit): New function that
20227         implements implicit type conversions.
20228
20229         (Expression::ImplicitReferenceConversion): Implements implicit
20230         reference conversions.
20231
20232         (EmptyCast): New type for transparent casts.
20233
20234         (OpcodeCast): New type for casts of types that are performed with
20235         a sequence of bytecodes.
20236
20237         (BoxedCast): New type used for casting value types into reference
20238         types.  Emits a box opcode.
20239
20240         (Binary::DoNumericPromotions): Implements numeric promotions of
20241         and computation of the Binary::Type.
20242
20243         (Binary::EmitBranchable): Optimization.
20244
20245         (Binary::Emit): Implement code emission for expressions.
20246
20247         * typemanager.cs (TypeManager): Added two new core types: sbyte
20248         and byte.
20249
20250 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20251
20252         * class.cs (TypeContainer::FindMembers): Method which does exactly
20253         what Type.FindMembers does, only we don't have to use reflection. No
20254         implementation yet.
20255
20256         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20257         typecontainer objects as we need to get at them.
20258         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20259
20260         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20261         typecontainer object.
20262
20263         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20264         of just a Report object.
20265
20266 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20267
20268         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20269         "remove_"
20270         (TypeContainer::Populate): Now define the delegates of the type too.
20271         (TypeContainer.Delegates): Property to access the list of delegates defined
20272         in the type.
20273
20274         * delegates.cs (Delegate::Define): Implement partially.
20275
20276         * modifiers.cs (TypeAttr): Handle more flags.
20277
20278 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20279
20280         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20281         and not <=
20282         (Operator::Define): Re-write logic to get types by using the LookupType method
20283         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20284         (Indexer::Define): Ditto.
20285         (Event::Define): Ditto.
20286         (Property::Define): Ditto.
20287
20288 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20289
20290         * class.cs (TypeContainer::Populate): Now define operators too. 
20291         (TypeContainer.Operators): New property to access the list of operators
20292         in a type.
20293         (Operator.OperatorMethodBuilder): New member to hold the method builder
20294         for the operator we are defining.
20295         (Operator::Define): Implement.
20296
20297 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20298
20299         * class.cs (Event::Define): Make the prefixes of the accessor methods
20300         addOn_ and removeOn_ 
20301
20302         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20303         of the location being passed in too. Ideally, this should go later since all
20304         error reporting should be done through the Report object.
20305
20306         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20307         (Populate): Iterate thru the indexers we have and define them too.
20308         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20309         for the get and set accessors.
20310         (Indexer::Define): Implement.
20311
20312 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20313
20314         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20315         my previous implementation, did not work.
20316
20317         * typemanager.cs: Add a couple of missing types (the longs).
20318
20319         * literal.cs: Use TypeManager.bool_type instead of getting it.
20320
20321         * expression.cs (EventExpr): New kind of expressions.
20322         (Expressio::ExprClassFromMemberInfo): finish
20323
20324 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20325
20326         * assign.cs: Emit stores to static fields differently.
20327
20328 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20329
20330         * Merge in changes and adjust code to tackle conflicts. Backed out my
20331         code in Assign::Resolve ;-) 
20332
20333 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20334
20335         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20336         instead Report.Error and also pass in the location.
20337         (CSharpParser::Lexer): New readonly property to return the reference
20338         to the Tokenizer object.
20339         (declare_local_variables): Use Report.Error with location instead of plain 
20340         old error.
20341         (CheckDef): Ditto.
20342
20343         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20344         (Operator.CheckBinaryOperator): Ditto.
20345
20346         * cs-parser.jay (operator_declarator): Update accordingly.
20347
20348         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20349         (CheckBinaryOperator): Same here.
20350
20351         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20352         on the name without any prefixes of namespace names etc. This is because we
20353         already might have something already fully qualified like 
20354         'System.Console.WriteLine'
20355
20356         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20357
20358 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20359
20360         * cs-tokenizer.cs (location): Return a string which also contains
20361         the file name.
20362
20363         * expression.cs (ElementAccess): New class for expressions of the
20364         type 'element access.'
20365         (BaseAccess): New class for expressions of the type 'base access.'
20366         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20367         respectively.
20368
20369         * cs-parser.jay (element_access): Implement action.
20370         (base_access): Implement actions.
20371         (checked_expression, unchecked_expression): Implement.
20372
20373         * cs-parser.jay (local_variable_type): Correct and implement.
20374         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20375
20376         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20377
20378         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20379         name and the specifiers.
20380
20381         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20382
20383         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20384         making them all public ;-)
20385
20386         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20387         class anyways.
20388
20389 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20390
20391         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20392         PropertyExprs.
20393         (FieldExpr, PropertyExprs): New resolved expressions.
20394         (SimpleName::MemberStaticCheck): Perform static checks for access
20395         to non-static fields on static methods. Maybe this should be
20396         generalized for MemberAccesses. 
20397         (SimpleName::ResolveSimpleName): More work on simple name
20398         resolution. 
20399
20400         * cs-parser.jay (primary_expression/qualified_identifier): track
20401         the parameter index.
20402
20403         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20404         (EmitContext::EmitBoolExpression): Chain to expression generation
20405         instead of temporary hack.
20406         (::EmitStatementExpression): Put generic expression code generation.
20407
20408         * assign.cs (Assign::Emit): Implement variable assignments to
20409         local variables, parameters and fields.
20410
20411 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20412
20413         * statement.cs (Block::GetVariableInfo): New method, returns the
20414         VariableInfo for a variable name in a block.
20415         (Block::GetVariableType): Implement in terms of GetVariableInfo
20416
20417         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20418         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20419
20420 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20421
20422         * cs-parser.jay (operator_declaration): Continue on my quest : update
20423         to take attributes argument.
20424         (event_declaration): Ditto.
20425         (enum_declaration): Ditto.
20426         (indexer_declaration): Ditto.
20427
20428         * class.cs (Operator::Operator): Update constructor accordingly.
20429         (Event::Event): Ditto.
20430
20431         * delegate.cs (Delegate::Delegate): Same here.
20432
20433         * enum.cs (Enum::Enum): Same here.
20434
20435 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20436
20437         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20438
20439         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20440
20441         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20442         being passed around as an arraylist.
20443         (Attributes::AddAttribute): Method to add attribute sections.
20444
20445         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20446         (struct_declaration): Update accordingly.
20447         (constant_declaration): Update.
20448         (field_declaration): Update.
20449         (method_header): Update.
20450         (fixed_parameter): Update.
20451         (parameter_array): Ditto.
20452         (property_declaration): Ditto.
20453         (destructor_declaration): Ditto.
20454
20455         * class.cs (Struct::Struct): Update constructors accordingly.
20456         (Class::Class): Ditto.
20457         (Field::Field): Ditto.
20458         (Method::Method): Ditto.
20459         (Property::Property): Ditto.
20460         (TypeContainer::OptAttribute): update property's return type.
20461
20462         * interface.cs (Interface.opt_attributes): New member.
20463         (Interface::Interface): Update to take the extra Attributes argument.
20464
20465         * parameter.cs (Parameter::Parameter): Ditto.
20466
20467         * constant.cs (Constant::Constant): Ditto.
20468
20469         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20470         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20471         the attributes as a parameter.
20472         (InterfaceProperty): Update constructor call.
20473         (InterfaceEvent): Ditto.
20474         (InterfaceMethod): Ditto.
20475         (InterfaceIndexer): Ditto.
20476
20477         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20478         pass the attributes too.
20479         (interface_event_declaration): Ditto.
20480         (interface_property_declaration): Ditto.
20481         (interface_method_declaration): Ditto.
20482         (interface_declaration): Ditto.
20483
20484 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20485
20486         * class.cs (Method::Define): Track the "static Main" definition to
20487         create an entry point. 
20488
20489         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20490         EntryPoint if we find it. 
20491
20492         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20493         (EmitContext::ig): Make this variable public.
20494
20495         * driver.cs: Make the default output file be the first file name
20496         with the .exe extension.  
20497
20498         Detect empty compilations
20499
20500         Handle various kinds of output targets.  Handle --target and
20501         rename -t to --dumper.
20502
20503         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20504         methods inherited from Expression return now an Expression.  This
20505         will is used during the tree rewriting as we resolve them during
20506         semantic analysis.
20507
20508         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20509         the spec.  Missing entirely is the information about
20510         accessability of elements of it.
20511
20512         (Expression::ExprClassFromMemberInfo): New constructor for
20513         Expressions that creates a fully initialized Expression based on
20514         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20515         a Type.
20516
20517         (Invocation::Resolve): Begin implementing resolution of invocations.
20518
20519         * literal.cs (StringLiteral):  Implement Emit.
20520
20521 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20522
20523         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20524         member.
20525
20526 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20527
20528         * cs-parser.jay (attribute_arguments): Implement actions.
20529         (attribute): Fix bug in production. Implement action.
20530         (attribute_list): Implement.
20531         (attribute_target): Implement.
20532         (attribute_target_specifier, opt_target_specifier): Implement
20533         (CheckAttributeTarget): New method to check if the attribute target
20534         is valid.
20535         (attribute_section): Implement.
20536         (opt_attributes): Implement.
20537
20538         * attribute.cs : New file to handle attributes.
20539         (Attribute): Class to hold attribute info.
20540
20541         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20542         (attribute_section): Modify production to use 2 different rules to 
20543         achieve the same thing. 1 s/r conflict down !
20544         Clean out commented, useless, non-reducing dimension_separator rules.
20545
20546         * class.cs (TypeContainer.attributes): New member to hold list
20547         of attributes for a type.
20548         (Struct::Struct): Modify to take one more argument, the attribute list.
20549         (Class::Class): Ditto.
20550         (Field::Field): Ditto.
20551         (Method::Method): Ditto.
20552         (Property::Property): Ditto.
20553
20554         * cs-parser.jay (struct_declaration): Update constructor call to
20555         pass in the attributes too.
20556         (class_declaration): Ditto.
20557         (constant_declaration): Ditto.
20558         (field_declaration): Ditto.
20559         (method_header): Ditto.
20560         (fixed_parameter): Ditto.
20561         (parameter_array): Ditto.
20562         (property_declaration): Ditto.
20563
20564         * constant.cs (Constant::Constant): Update constructor similarly.
20565         Use System.Collections.
20566
20567         * parameter.cs (Parameter::Parameter): Update as above.
20568
20569 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20570
20571         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20572         (TypeContainer.delegates): New member to hold list of delegates.
20573
20574         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20575         this time as I seem to be on crack ;-)
20576
20577 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20578
20579         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20580         tell whether an identifier represents a namespace.
20581
20582         * expression.cs (NamespaceExpr): A namespace expression, used only
20583         temporarly during expression resolution.
20584         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20585         utility functions to resolve names on expressions.
20586
20587 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20588
20589         * codegen.cs: Add hook for StatementExpressions. 
20590
20591         * class.cs: Fix inverted test for static flag in methods.
20592
20593 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20594
20595         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20596         to make it coincide with MS' number.
20597         (Operator::CheckBinaryOperator): Ditto.
20598
20599         * ../errors/errors.txt : Remove error numbers added earlier.
20600
20601         * ../errors/cs1019.cs : Test case for error # 1019
20602
20603         * ../errros/cs1020.cs : Test case for error # 1020
20604
20605         * cs-parser.jay : Clean out commented cruft.
20606         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20607         used anywhere - non-reducing rule.
20608         (namespace_declarations): Non-reducing rule - comment out.
20609
20610         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20611         with TypeContainer::AddEnum.
20612
20613         * delegate.cs : New file for delegate handling classes.
20614         (Delegate): Class for declaring delegates.
20615
20616         * makefile : Update.
20617
20618         * cs-parser.jay (delegate_declaration): Implement.
20619
20620 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20621
20622         * class.cs (Event::Define): Implement.
20623         (Event.EventBuilder): New member.
20624
20625         * class.cs (TypeContainer::Populate): Update to define all enums and events
20626         we have.
20627         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20628         readonly fields for all these cases ?
20629
20630 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20631
20632         * class.cs (Property): Revamp to use the convention of making fields readonly.
20633         Accordingly modify code elsewhere.
20634
20635         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20636         the Define method of the Property class.
20637
20638         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20639         trivial bug.
20640         (TypeContainer::Populate): Update to define all the properties we have. Also
20641         define all enumerations.
20642
20643         * enum.cs (Define): Implement.
20644
20645 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20646
20647         * cs-parser.jay (overloadable_operator): The semantic value is an
20648         enum of the Operator class.
20649         (operator_declarator): Implement actions.
20650         (operator_declaration): Implement.
20651
20652         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20653         validity of definitions.
20654         (Operator::CheckBinaryOperator): Static method to check for binary operators
20655         (TypeContainer::AddOperator): New method to add an operator to a type.
20656
20657         * cs-parser.jay (indexer_declaration): Added line to actually call the
20658         AddIndexer method so it gets added ;-)
20659
20660         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20661         already taken care of by the MS compiler ?  
20662
20663 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20664
20665         * class.cs (Operator): New class for operator declarations.
20666         (Operator::OpType): Enum for the various operators.
20667
20668 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20669
20670         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20671         ostensibly handle this in semantic analysis.
20672
20673         * cs-parser.jay (general_catch_clause): Comment out
20674         (specific_catch_clauses, specific_catch_clause): Ditto.
20675         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20676         (catch_args, opt_catch_args): New productions.
20677         (catch_clause): Rewrite to use the new productions above
20678         (catch_clauses): Modify accordingly.
20679         (opt_catch_clauses): New production to use in try_statement
20680         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20681         and re-write the code in the actions to extract the specific and
20682         general catch clauses by being a little smart ;-)
20683
20684         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20685         Hooray, try and catch statements parse fine !
20686
20687 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20688
20689         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20690         string from the hashtable of variables.
20691
20692         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20693         I end up making that mistake ;-)
20694         (catch_clauses): Fixed gross error which made Key and Value of the 
20695         DictionaryEntry the same : $1 !!
20696
20697 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20698
20699         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20700
20701         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20702         when the add and remove accessors are specified. 
20703
20704 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20705
20706         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20707         information about indexer_declarator.
20708         (indexer_declarator): Implement actions.
20709         (parsing_indexer): New local boolean used to keep track of whether
20710         we are parsing indexers or properties. This is necessary because 
20711         implicit_parameters come into picture even for the get accessor in the 
20712         case of an indexer.
20713         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20714
20715         * class.cs (Indexer): New class for indexer declarations.
20716         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20717         (TypeContainer::indexers): New member to hold list of indexers for the
20718         type.
20719
20720 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20721
20722         * cs-parser.jay (add_accessor_declaration): Implement action.
20723         (remove_accessor_declaration): Implement action.
20724         (event_accessors_declaration): Implement
20725         (variable_declarators): swap statements for first rule - trivial.
20726
20727         * class.cs (Event): New class to hold information about event
20728         declarations.
20729         (TypeContainer::AddEvent): New method to add an event to a type
20730         (TypeContainer::events): New member to hold list of events.
20731
20732         * cs-parser.jay (event_declaration): Implement actions.
20733
20734 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20735
20736         * cs-parser.jay (dim_separators): Implement. Make it a string
20737         concatenating all the commas together, just as they appear.
20738         (opt_dim_separators): Modify accordingly
20739         (rank_specifiers): Update accordingly. Basically do the same
20740         thing - instead, collect the brackets here.
20741         (opt_rank_sepcifiers): Modify accordingly.
20742         (array_type): Modify to actually return the complete type string
20743         instead of ignoring the rank_specifiers.
20744         (expression_list): Implement to collect the expressions
20745         (variable_initializer): Implement. We make it a list of expressions
20746         essentially so that we can handle the array_initializer case neatly too.
20747         (variable_initializer_list): Implement.
20748         (array_initializer): Make it a list of variable_initializers
20749         (opt_array_initializer): Modify accordingly.
20750
20751         * expression.cs (New::NType): Add enumeration to help us
20752         keep track of whether we have an object/delegate creation
20753         or an array creation.
20754         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20755         members to hold data about array creation.
20756         (New:New): Modify to update NewType
20757         (New:New): New Overloaded contructor for the array creation
20758         case.
20759
20760         * cs-parser.jay (array_creation_expression): Implement to call
20761         the overloaded New constructor.
20762
20763 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20764
20765         * class.cs (TypeContainer::Constructors): Return member
20766         constructors instead of returning null.
20767
20768 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20769
20770         * typemanager.cs (InitCoreTypes): Initialize the various core
20771         types after we have populated the type manager with the user
20772         defined types (this distinction will be important later while
20773         compiling corlib.dll)
20774
20775         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20776         on Expression Classification.  Now all expressions have a method
20777         `Resolve' and a method `Emit'.
20778
20779         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20780         generation from working.     Also add some temporary debugging
20781         code. 
20782
20783 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20784
20785         * codegen.cs: Lots of code generation pieces.  This is only the
20786         beginning, will continue tomorrow with more touches of polish.  We
20787         handle the fundamentals of if, while, do, for, return.  Others are
20788         trickier and I need to start working on invocations soon.
20789
20790         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20791         s.InitStatement. 
20792
20793         * codegen.cs (EmitContext): New struct, used during code
20794         emission to keep a context.   Most of the code generation will be
20795         here. 
20796
20797         * cs-parser.jay: Add embedded blocks to the list of statements of
20798         this block.  So code generation proceeds in a top down fashion.
20799
20800 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20801
20802         * statement.cs: Add support for multiple child blocks.
20803
20804 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20805
20806         * codegen.cs (EmitCode): New function, will emit the code for a
20807         Block of code given a TypeContainer and its ILGenerator. 
20808
20809         * statement.cs (Block): Standard public readonly optimization.
20810         (Block::Block constructors): Link children. 
20811         (Block::Child): Child Linker.
20812         (Block::EmitVariables): Emits IL variable declarations.
20813
20814         * class.cs: Drop support for MethodGroups here, delay until
20815         Semantic Analysis.
20816         (Method::): Applied the same simplification that I did before, and
20817         move from Properties to public readonly fields.
20818         (Method::ParameterTypes): Returns the parameter types for the
20819         function, and implements a cache that will be useful later when I
20820         do error checking and the semantic analysis on the methods is
20821         performed.
20822         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20823         and made a method, optional argument tells whether this is a class
20824         or a structure to apply the `has-this' bit.
20825         (Method::GetCallingConvention): Implement, returns the calling
20826         convention. 
20827         (Method::Define): Defines the type, a second pass is performed
20828         later to populate the methods.
20829
20830         (Constructor::ParameterTypes): implement a cache similar to the
20831         one on Method::ParameterTypes, useful later when we do semantic
20832         analysis. 
20833
20834         (TypeContainer::EmitMethod):  New method.  Emits methods.
20835
20836         * expression.cs: Removed MethodGroup class from here.
20837
20838         * parameter.cs (Parameters::GetCallingConvention): new method.
20839
20840 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20841
20842         * class.cs (TypeContainer::Populate): Drop RootContext from the
20843         argument. 
20844
20845         (Constructor::CallingConvention): Returns the calling convention.
20846         (Constructor::ParameterTypes): Returns the constructor parameter
20847         types. 
20848
20849         (TypeContainer::AddConstructor): Keep track of default constructor
20850         and the default static constructor.
20851
20852         (Constructor::) Another class that starts using `public readonly'
20853         instead of properties. 
20854
20855         (Constructor::IsDefault): Whether this is a default constructor. 
20856
20857         (Field::) use readonly public fields instead of properties also.
20858
20859         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20860         track of static constructors;  If none is used, turn on
20861         BeforeFieldInit in the TypeAttributes. 
20862
20863         * cs-parser.jay (opt_argument_list): now the return can be null
20864         for the cases where there are no arguments. 
20865
20866         (constructor_declarator): If there is no implicit `base' or
20867         `this', then invoke the default parent constructor. 
20868
20869         * modifiers.cs (MethodAttr): New static function maps a set of
20870         modifiers flags into a MethodAttributes enum
20871         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20872         MethodAttr, TypeAttr to represent the various mappings where the
20873         modifiers are used.
20874         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20875
20876 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20877
20878         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20879         method arguments.
20880
20881         * interface.cs (PopulateIndexer): Implemented the code generator
20882         for interface indexers.
20883
20884 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20885
20886         * interface.cs (InterfaceMemberBase): Now we track the new status
20887         here.  
20888
20889         (PopulateProperty): Implement property population.  Woohoo!  Got
20890         Methods and Properties going today. 
20891
20892         Removed all the properties for interfaces, and replaced them with
20893         `public readonly' fields. 
20894
20895 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20896
20897         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20898         initialize their hashtables/arraylists only when they are needed
20899         instead of doing this always.
20900
20901         * parameter.cs: Handle refs and out parameters.
20902
20903         * cs-parser.jay: Use an ArrayList to construct the arguments
20904         instead of the ParameterCollection, and then cast that to a
20905         Parameter[] array.
20906
20907         * parameter.cs: Drop the use of ParameterCollection and use
20908         instead arrays of Parameters.
20909
20910         (GetParameterInfo): Use the Type, not the Name when resolving
20911         types. 
20912
20913 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20914
20915         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20916         and instead use public readonly fields.
20917
20918         * class.cs: Put back walking code for type containers.
20919
20920 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20921
20922         * class.cs (MakeConstant): Code to define constants.
20923
20924         * rootcontext.cs (LookupType): New function.  Used to locate types 
20925
20926
20927 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20928
20929         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20930         this System.Reflection code is.  Kudos to Microsoft
20931
20932         * typemanager.cs: Implement a type cache and avoid loading all
20933         types at boot time.  Wrap in LookupType the internals.  This made
20934         the compiler so much faster.  Wow.  I rule!
20935
20936         * driver.cs: Make sure we always load mscorlib first (for
20937         debugging purposes, nothing really important).
20938
20939         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20940         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20941
20942         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20943         on namespaces that have been imported using the `using' keyword.
20944
20945         * class.cs (TypeContainer::TypeAttr): Virtualize.
20946         (Class::TypeAttr): Return attributes suitable for this bad boy.
20947         (Struct::TypeAttr): ditto.
20948         Handle nested classes.
20949         (TypeContainer::) Remove all the type visiting code, it is now
20950         replaced with the rootcontext.cs code
20951
20952         * rootcontext.cs (GetClassBases): Added support for structs. 
20953
20954 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20955
20956         * interface.cs, statement.cs, class.cs, parameter.cs,
20957         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20958         Drop use of TypeRefs, and use strings instead.
20959
20960 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20961
20962         * rootcontext.cs: 
20963
20964         * class.cs (Struct::Struct): set the SEALED flags after
20965         checking the modifiers.
20966         (TypeContainer::TypeAttr): new property, returns the
20967         TypeAttributes for a class.  
20968
20969         * cs-parser.jay (type_list): Oops, list production was creating a
20970         new list of base types.
20971
20972         * rootcontext.cs (StdLib): New property.
20973         (GetInterfaceTypeByName): returns an interface by type name, and
20974         encapsulates error handling here.
20975         (GetInterfaces): simplified.
20976         (ResolveTree): Encapsulated all the tree resolution here.
20977         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20978         types. 
20979
20980         * driver.cs: Add support for --nostdlib, to avoid loading the
20981         default assemblies.
20982         (Main): Do not put tree resolution here. 
20983
20984         * rootcontext.cs: Beginning of the class resolution.
20985
20986 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20987
20988         * rootcontext.cs: Provide better error reporting. 
20989
20990         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20991
20992         * rootcontext.cs (CreateInterface): Handle the case where there
20993         are no parent interfaces.
20994
20995         (CloseTypes): Routine to flush types at the end.
20996         (CreateInterface): Track types.
20997         (GetInterfaces): Returns an array of Types from the list of
20998         defined interfaces.
20999
21000         * typemanager.c (AddUserType): Mechanism to track user types (puts
21001         the type on the global type hash, and allows us to close it at the
21002         end). 
21003
21004 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21005
21006         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21007         RecordInterface instead.
21008
21009         * cs-parser.jay: Updated to reflect changes above.
21010
21011         * decl.cs (Definition): Keep track of the TypeBuilder type that
21012         represents this type here.  Not sure we will use it in the long
21013         run, but wont hurt for now.
21014
21015         * driver.cs: Smaller changes to accomodate the new code.
21016
21017         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21018         when done. 
21019
21020         * rootcontext.cs (CreateInterface):  New method, used to create
21021         the System.TypeBuilder type for interfaces.
21022         (ResolveInterfaces): new entry point to resolve the interface
21023         hierarchy. 
21024         (CodeGen): Property, used to keep track of the code generator.
21025
21026 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21027
21028         * cs-parser.jay: Add a second production for delegate_declaration
21029         with `VOID'.
21030
21031         (enum_body): Put an opt_comma here instead of putting it on
21032         enum_body or enum_member_declarations so we can handle trailing
21033         commas on enumeration members.  Gets rid of a shift/reduce.
21034
21035         (type_list): Need a COMMA in the middle.
21036
21037         (indexer_declaration): Tell tokenizer to recognize get/set
21038
21039         * Remove old targets.
21040
21041         * Re-add the parser target.
21042
21043 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21044
21045         * cs-parser.jay: Add precendence rules for a number of operators
21046         ot reduce the number of shift/reduce conflicts in the grammar.
21047
21048 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21049
21050         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21051         and put it here.
21052
21053         Get rid of old crufty code.
21054
21055         * rootcontext.cs: Use this to keep track of the parsed
21056         representation and the defined types available to the program. 
21057
21058         * gen-treedump.cs: adjust for new convention.
21059
21060         * type.cs: Split out the type manager, and the assembly builder
21061         from here. 
21062
21063         * typemanager.cs: the type manager will live here now.
21064
21065         * cil-codegen.cs: And the code generator here. 
21066
21067 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21068
21069         * makefile: Fixed up for easy making.
21070
21071 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21072
21073         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21074         the 
21075
21076         (unary_expression): Expand pre_increment_expression and
21077         post_decrement_expression to reduce a shift/reduce.
21078
21079 2001-07-11  Simon Cozens
21080
21081         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21082
21083         Improve allow_keyword_as_indent name.
21084
21085 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21086
21087         * Adjustments for Beta2. 
21088
21089 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21090
21091         * decl.cs: Added `Define' abstract method.
21092         (InTransit): new property, used to catch recursive definitions. 
21093
21094         * interface.cs: Implement `Define'. 
21095
21096         * modifiers.cs: Map Modifiers.constants to
21097         System.Reflection.TypeAttribute flags.
21098
21099         * class.cs: Keep track of types and user-defined types.
21100         (BuilderInit): New method for creating an assembly
21101         (ResolveType): New function to launch the resolution process, only
21102         used by interfaces for now.
21103
21104         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21105         that are inserted into the name space. 
21106
21107 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21108
21109         * ARGH.  I have screwed up my tree so many times due to the use of
21110         rsync rather than using CVS.  Going to fix this at once. 
21111
21112         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21113         load types.
21114
21115 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21116
21117         * Experiment successful: Use System.Type rather that our own
21118         version of Type.  
21119
21120 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21121
21122         * cs-parser.jay: Removed nsAliases from here.
21123
21124         Use new namespaces, handle `using XXX;' 
21125
21126         * namespace.cs: Reimplemented namespace handling, use a recursive
21127         definition of the class.  Now we can keep track of using clauses
21128         and catch invalid using clauses.
21129
21130 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21131
21132         * gen-treedump.cs: Adapted for all the renaming.
21133
21134         * expression.cs (Expression): this class now has a Type property
21135         which returns an expression Type.
21136
21137         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21138         `Type', as this has a different meaning now in the base
21139
21140 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21141
21142         * interface.cs, class.cs: Removed from all the sources the
21143         references to signature computation, as we can not do method
21144         signature computation during the parsing time, as we are not
21145         trying to solve at that point distinguishing:
21146
21147         class X {
21148                 void a (Blah x) {}
21149                 void a (NS.Blah x) {}
21150         }
21151
21152         Which depending on the context might be valid or not, as we do not
21153         know if Blah is the same thing as NS.Blah at that point.
21154
21155         * Redid everything so the code uses TypeRefs now instead of
21156         Types.  TypeRefs are just temporary type placeholders, that need
21157         to be resolved.  They initially have a pointer to a string and the
21158         current scope in which they are used.  This is used later by the
21159         compiler to resolve the reference to an actual Type. 
21160
21161         * DeclSpace is no longer a CIR.Type, and neither are
21162         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21163         are all DeclSpaces, but no Types. 
21164
21165         * type.cs (TypeRefManager): This implements the TypeRef manager,
21166         which keeps track of all the types that need to be resolved after
21167         the parsing has finished. 
21168
21169 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21170
21171         * ARGH.  We are going to have to store `foreach' as a class rather
21172         than resolving it, as we need to verify error 1579 after name
21173         resolution.   *OR* we could keep a flag that says `This request to
21174         IEnumerator comes from a foreach statement' which we can then use
21175         to generate the error.
21176
21177 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21178
21179         * class.cs (TypeContainer.AddMethod): we now add methods to the
21180         MethodGroup instead of the method hashtable.  
21181
21182         * expression.cs: Add MethodGroup abstraction, which gets us one
21183         step closer to the specification in the way we handle method
21184         declarations.  
21185
21186         * cs-parser.jay (primary_expression): qualified_identifier now
21187         tried to match up an identifier to a local variable reference or
21188         to a parameter reference.
21189
21190         current_local_parameters is now a parser global variable that
21191         points to the current parameters for the block, used during name
21192         lookup.
21193
21194         (property_declaration): Now creates an implicit `value' argument to
21195         the set accessor.
21196
21197 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21198
21199         * parameter.cs: Do not use `param' arguments as part of the
21200         signature, per the spec.
21201
21202 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21203
21204         * decl.cs: Base class for classes, structs and interfaces.  This
21205         is the "Declaration Space" 
21206
21207         * cs-parser.jay: Use CheckDef for checking declaration errors
21208         instead of having one on each function.
21209
21210         * class.cs: Factor out some code for handling error handling in
21211         accordance to the "Declarations" section in the "Basic Concepts"
21212         chapter in the ECMA C# spec.
21213
21214         * interface.cs: Make all interface member classes derive from
21215         InterfaceMemberBase.
21216
21217 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21218
21219         * Many things: all interfaces are parsed and generated in
21220         gen-treedump.  Support for member variables, constructors,
21221         destructors, properties, constants is there.
21222
21223         Beginning of the IL backend, but very little done, just there for
21224         testing purposes. 
21225
21226 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21227
21228         * cs-parser.jay: Fix labeled statement.
21229
21230         * cs-tokenizer.cs (escape): Escape " and ' always.
21231         ref_line, ref_name: keep track of the line/filename as instructed
21232         by #line by the compiler.
21233         Parse #line.
21234
21235 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21236
21237         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21238         to match the values in System.CodeDOM.
21239
21240         Divid renamed to Divide.
21241
21242         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21243         statements. 
21244         (Statements.set): remove.
21245
21246         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21247         statements. 
21248
21249         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21250         falseStatements always have valid values. 
21251
21252         * cs-parser.jay: Use System.CodeDOM now.
21253