2005-09-22 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2
3         * statement.cs (Lock): Use the TemporaryVariable class instead of
4         manually using local variables as those do not work when variables
5         are captured.
6
7         * ecore.cs: Moved the TemporaryVariable class from being a nested
8         class inside Foreach to be a public class that can be employed in
9         other places. 
10
11 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
12
13         * cs-parser.jay: interface_accessors replaced by
14         accessor_declarations.
15
16         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
17         location.
18         
19         * statement.cs (GotoCase.Resolve): Convert null constant to
20         null case.
21         (SwitchLabel.ResolveAndReduce): Ditto.
22         (SwitchLabel.NullStringCase): Custom null stamp.
23         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
24         
25         typemanager.cs (CSharpSignature): Don't skip first argument
26         for full names.
27
28 2005-09-18  Miguel de Icaza  <miguel@novell.com>
29
30         * driver.cs: Set InEmacs based on the environment variable EMACS. 
31
32         * location.cs (InEmacs): in this mode, do not report column
33         location as it confuses Emacs.
34
35 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
36
37         * cfold.cs, constant.cs, convert.cs, ecore.cs,
38         expression.cs, iterators.cs, literal.cs: Store constants and
39         literals location.
40         
41         * class.cs (MemberBase.ShortName): Pass location.
42         
43         * cs-parser.jay: Some location fixes.
44         
45         * ecore.cs (Expression.Location): Made virtual.
46
47 2005-09-05  Miguel de Icaza  <miguel@novell.com>
48
49         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
50         if the underlying types are the same, otherwise we need to produce
51         code that will do the proper cast.
52
53         This was exposed by Marek's constant rewrite which produced
54         invalid code for the call site:
55
56         enum X : long { a }
57         void Method (X v) {}
58
59         Method ((X) 5)
60
61         This fixes test-49.cs
62
63 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
64
65         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
66           Type/Object should be allowed as well. Fixed bug #75968.
67
68 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
69
70         * expression.cs : (Binary.DoResolve): when one is enum constant and
71           another is constant 0, then return enum one *as enum type*.
72           Fixed bug 74846.
73
74 2005-09-02  Raja R Harinath  <rharinath@novell.com>
75
76         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
77         internal.
78
79         Fix #75941.
80         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
81         flow-branching for LocalVariableReferences in case we were invoked
82         from a MemberAccess.
83         * expression.cs (LocalVariableReference.VerifyAssigned): New.
84         Carved out of ...
85         (LocalVariableReference.DoResolveBase): ... this.
86         (MemberAccess.Resolve): Do the check that was disabled during
87         SimpleNameResolve.
88
89 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
90
91         * class.cs :
92           (PartialContainer.Create): check abstract/sealed/static strictly
93           but abstract/sealed can exist only at one side. Fixed bug #75883.
94
95 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
96
97         Fix #75945.
98         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
99         specified, don't default to UnmanagedType.I4.
100
101 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
102
103         * expression.cs : conditional operator should check possibly
104           incorrect assign expression. Fixed bug #75946.
105
106 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
107
108         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
109           Reverting the change. gmcs is much complex than mcs on this matter.
110
111 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
112
113         * cs-tokenizer.cs : To read another token ahead of the actual 
114           consumption, use new SavedToken and cache token instead of moving
115           back the stream with SeekableStreamReader (it seemed problematic).
116         * cs-parser.jay,
117           driver.cs : Thus use StreamReader directly.
118         * support.cs : Thus removed SeekableStreamReader.
119
120 2005-08-30  Raja R Harinath  <rharinath@novell.com>
121
122         Fix #75934.
123         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
124         (ScopeInfo.EmitScopeType): Use it to construct field names from
125         names of captured locals.
126
127         Fix #75929.
128         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
129         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
130         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
131         (ExplicitConversion): Remove enum cases already handled by
132         implicit conversion.  Move implicit conversion check to the beginning.
133         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
134         * expression.cs (ArrayCreation.EmitDynamicInitializers):
135         Don't treat System.Enum as a struct.
136
137 2005-08-30  Jb Evain  <jbevain@gmail.com>
138
139         * attribute.cs: handles as expression in parameters.
140
141 2005-08-30  Raja R Harinath  <rharinath@novell.com>
142
143         Fix #75802.
144         * class.cs (TypeContainer.VerifyClsName): Don't use a
145         PartialContainer when verifying CLS compliance.
146         (AbstractPropertyEventMethod): Set Parent here, ...
147         (PropertyMethod): ... not here.
148
149 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
150
151         * attribute.cs : escaped attribute name should not be allowed to be
152           resolved (e.g. @class as classAttribute). Fixed bug #75930.
153
154 2005-08-29  Raja R Harinath  <rharinath@novell.com>
155
156         Fix #75927.
157         * convert.cs (ImplicitStandardConversionExists): Allow zero also
158         when converting a long constant to unsigned long.
159         * expression.cs (Invocation.OverloadResolve): Add sanity check to
160         detect where IsApplicable and VerifyArgumentsCompat disagree.
161
162 2005-08-29  Raja R Harinath  <rharinath@novell.com>
163         and Carlos Alberto Cortez  <carlos@unixmexico.org>
164
165         Fix #75848.
166         * class.cs (TypeContainer.CanElideInitializer): New helper.
167         (TypeContainer.EmitFieldInitializers): Use it to determine if we
168         can safely emitting the initializer of a field.
169
170 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
171
172         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
173           allowed inside a switch (without loop). Fixed bug #75433.
174
175 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
176
177         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
178         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
179
180 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
181
182         * driver.cs : kinda reverting the default encoding changes (not exact 
183           revert since I noticed that "codepage:reset" might not work fine).
184
185 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
186
187         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
188           Location. Now getter and setter store location correctly.
189           (errors/cs0111-12.cs now reports the expected location.)
190
191 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
192
193         * driver.cs : Use default encoding on the environment.
194           Removed (now that) extra parameter for SeekableStreamReader.
195         * support.cs : (SeekableStreamReader) third .ctor() argument for
196           StreamReader is not required (always true). preamble size could
197           be acquired in simpler and safe way.
198
199 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
200
201         * cs-parser.jay: report CS0642 at warning level 3
202           and report CS0642 for an if else statement also
203           fixes bug #74745. Patch by John Luke (and a bit
204           modified by me).
205           Removed extra CS0642 warning check for "while",
206           "for" and "fixed".
207         * statement.cs: In Block.Resolve(), CS0642 check
208           is reimplemented to check a sequence of an empty
209           statement and a block.
210
211           Both fix bug #66777.
212
213 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
214
215         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
216         detection until I fix it.
217         
218         * cs-tokenizer.cs: Changed error message.
219         
220         * cs-parser.jay: Fixed 2 error locations.
221         
222         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
223         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
224         properties.
225         
226         * enum.cs (GetSignatureForError): Fixed.
227         
228         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
229         method detection.
230         
231         * class.cs,
232         * typemanager.cs (RegisterProperty): Removed.
233         
234         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
235
236 2005-08-24  Raja R Harinath  <rharinath@novell.com>
237
238         Fix #75874.
239         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
240         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
241
242 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
243
244         * expression.cs : tiny fix is required for not warning positive ulong.
245           See test-441.cs.
246
247 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
248
249         * expression.cs : add CS0652 check for constant and integral
250           expression. Fixed bug #53974.
251
252 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
253
254         * expression.cs : in DoNumericPromotions(), check if there is implicit
255           conversion overload for string (to check CS0034). Fixed bug #52492.
256
257 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
258
259         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
260
261 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
262
263         * ecore.cs : report location when it is *not* Null.
264
265 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
266
267         * codegen.cs,
268           ecore.cs,
269           flowanalysis.cs,
270           expression.cs:
271           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
272           correctly. Fixed bug #75721.
273
274 2005-08-23  Raja R Harinath  <rharinath@novell.com>
275
276         * support.cs (SeekableStreamReader.Position): Avoid an expensive
277         loop that performs 'min (pos, char_count)'.
278
279         Fix #75862.
280         * expression.cs (Unary.ResolveOperator): Don't discard implicit
281         converted value in Operator.OnesComplement.
282
283 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
284
285         * anonymous.cs: If the anon method is pulled into a helper class,
286         it needs to be `internal' not `private'. Fixes runtime behavior on
287         msft. bug #75704
288
289 2005-08-20  Martin Baulig  <martin@ximian.com>
290
291         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
292         scope if we don't already have it.
293
294         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
295         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
296         fixes #75867.
297
298 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
299
300         Fix #75803
301         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
302         is a partial class.
303
304 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
305
306         The big constants rewrite
307         Fix #75746, #75685 and more
308         As a side effect saved 1MB for MWF ;-)
309         
310         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
311         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
312         enum based for corlib compilation.
313         
314         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
315         subtractions.
316         
317         * class.cs (FixedField.Define): Use ResolveAsConstant.
318         
319         * const.cs (IConstant): Interface constants and enums.
320         (Const.ResolveValue): New method for constant resolvning.
321         (ExternalConstant): Constants from imported assemblies.
322         
323         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
324         conversion; like enums.
325         (Constant.ToType): Converts this constant to different type.
326         (Constant.Increment): Adds 1.
327         
328         * convert.cs (ImplicitConversionRequired): Simplified.
329         
330         * cs-parser.jay: Create EnumMember directly.
331         
332         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
333         
334         * doc.cs (GenerateEnumDocComment): Removed.
335         
336         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
337         (ConvertIntLiteral): Removed.
338         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
339         
340         * enum.cs (EnumMember): Implement IConstant.
341         (Enum.IsValidEnumConstant): Removed.
342         (Enum.GetNextDefaultValue): Removed.
343         (Enum.FindMembers): Updated.
344         (Enum.GenerateDocComment): Iterate enum members.
345         
346         * expression.cs (Cast.TryReduce): Handle enums correctly.
347         (New.Constantify): Made public.
348         (MemberAccess.DoResolve): Removed contant specific if(s).
349         
350         * literal.cs (NullLiteral): Implement new abstract methods.
351         
352         * statement.cs (GotoCase.Resolve): Use new constant methods.
353         (SwitchLabel.ResolveAndReduce): Use new constant methods.
354         
355         * typemanager.cs (LookupEnum): Removed.
356         (IsEnumType): Fixed to work with corlib.
357         (RegisterConstant): Removed.
358         (LookupConstant): Removed.
359         (GetConstant): Changed to work with IConstant.
360
361 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
362
363         * location.cs : Fixed overflown (>255) column number.
364
365 2005-08-03  Raja R Harinath  <rharinath@novell.com>
366
367         First cut of the qualified-alias-member feature.
368         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
369         token.
370         * cs-parser.jay (DOUBLE_COLON): New token.
371         (namespace_or_type_name): Add rule for recognizing
372         qualified-alias-members.
373         (primary_expression): Likewise.
374         (element_access): Allow QualifiedAliasMember as a possible
375         type-bearing expression.
376         (local_variable_type, local_variable_pointer_type): Likewise.
377         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
378         aliases in the current and enclosing namespace declarations.
379         (NamespaceEntry.UsingAlias): Add CS0440 warning.
380         * decl.cs (MemberName.is_double_colon): New.
381         (MemberName.MemberName): Add new constructor for alias-member.
382         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
383         * expression.cs (QualifiedAliasMember): New expression type.
384
385 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
386
387         * location.cs : it borked when no argument was specified.
388
389 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
390
391         * location.cs : tiny ToString() format fix.
392
393 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
394
395         * statement.cs : oops, it was missing.
396
397 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
398
399         A set of fixes for precise line/column location.
400
401         * location.cs :
402           "token" field now holds a file/line "delta", a line number offset 
403           from the segment, and a column number. See also:
404           http://lists.ximian.com/pipermail/mono-devel-list/2004-
405           December/009508.html
406           Removed static IsNull. Use instance IsNull property instead.
407         * cs-tokenizer.cs :
408           For some tokens it stores Location. For Identifier it stores
409           LocatedToken which is a pair of string name and location.
410           Column numbers are adjusted only at getChar().
411         * report.cs :
412           Use Location.ToString() for reporting (it now contains column).
413         * cs-parser.jay :
414           Largely modified to use LocatedToken instead of
415           string (IDENTIFIER), and to acquire Location from some tokens.
416         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
417           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
418           codegen.cs :
419           Now MemberName holds Location. DeclSpace.ctor() receives Location
420           as a parameter. Removed extra parameters to all derived classes.
421           Replaced Location.IsNull() with instance property.
422         * assign.cs, expression.cs :
423           Added .ctor() overload that omits Location.
424         * attribute.cs :
425           Added "nameEscaped" flag that indicates the identifier was escaped
426           in the source file. This fixes bug #57047.
427
428 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
429
430         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
431         New method, looking for lo-case imported cls type.
432
433         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
434         here.
435
436         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
437
438         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
439
440         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
441         all_imported_types.
442         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
443
444         Optimized to save 3.5 MB for SWF compilation.
445
446 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
447
448         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
449         (PartialContainer.Create): Moved logic AddToContainer.
450         (PartialContainer.MarkForDuplicationCheck): Shares name.
451         
452         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
453         place.
454         
455         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
456         initialization.
457         (Namespace.GetSignatureForError): New method.
458         
459         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
460         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
461
462 2005-08-01  Raja R Harinath  <rharinath@novell.com>
463
464         Fix #75669.
465         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
466         member lookup rather than qualifier_type, since qualifier_type can
467         be null.
468
469 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
470
471         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
472         enum member.
473
474 2005-07-31  Miguel de Icaza  <miguel@novell.com>
475
476         * statement.cs: Copy the local exception into the exception
477         captured local.  Fixes 75674
478
479 2005-07-31  Raja R Harinath  <harinath@gmail.com>
480
481         Fix #75658.
482         * expression.cs (Invocation.OverloadResolve): Don't report error
483         CS1501 if error CS1502 has been reported.
484         (New.DoResolve): Delegate CS1501 reporting to
485         Invocation.OverloadResolve.
486
487         Fix #75656.
488         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
489         invariant-meaning-in-block property in an enclosing block if
490         necessary.
491
492 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
493
494         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
495         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
496         (Switch.CheckSwitch): Just save 50kb for SWF.
497
498 2005-07-27  Martin Baulig  <martin@ximian.com>
499
500         * anonymous.cs (CaptureContext.AddField): Added
501         `AnonymousContainer am' argument; compute its toplevel scope if
502         it's not already computed.  Fixes #75649.
503
504 2005-07-26  Raja R Harinath  <rharinath@novell.com>
505
506         Fix #75628.
507         * class.cs (Constructor.Emit): Reset block to null if the block
508         resolve fails.
509
510 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
511
512         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
513
514 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
515
516         * class.cs (MethodData.Define): Check whether accessor implementing
517         interface is public.
518
519         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
520
521 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
522
523         Fix #57245
524         * namespace.cs (LookupType): Moved same type check to...
525         
526         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
527         with the same name.
528
529 2005-07-21  Raja R Harinath  <rharinath@novell.com>
530
531         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
532         already found a typebuilder.
533         * class.cs (MethodCore.IsDuplicateImplementation): Compare
534         MemberNames, not strings.
535
536         * const.cs (Error_ExpressionMustBeConst): 
537         Rename from Error_EpressionMustBeConst.
538         * const.cs, class.cs, statement.cd: Update.
539
540 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
541
542         Fix #65573
543
544         * const.cs (Const.LookupConstantValue): Report missing contant expression
545         everytime.
546         (Error_EpressionMustBeConstant): Only one error method.
547
548         * class.cs, statement.c: Updated.
549
550 2005-07-20  Raja R Harinath  <rharinath@novell.com>
551
552         * statement.cs (Block.Flags): Add back HasVarargs.
553         (Block.flags): Make protected.
554         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
555
556         * typemanager.cs (types, typecontainers, user_types): Remove.
557         (UserTypes, TypeContainers): Likewise.
558         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
559         (CleanUp, Reset): Update.
560         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
561         (GetNestedType): Use Type.GetNestedType.
562         (CoreLookupType): Take two arguments, the namespace and the
563         basename of the type.  Update to use the Namespace.Lookup
564         mechanism.
565         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
566         (RealMemberLookup): Use IsNestedChildOf instead of playing with
567         string concatenation and substring matches.
568         * class.cs, enum.cs, delegate.cs: Update to changes.
569
570 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
571
572         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
573         Expression and made virtual.
574
575         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
576         (ImplicitStandardConversionExists): Fixed `byte' typo ?
577
578         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
579
580         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
581         error message.
582
583         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
584         change.
585
586 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
587
588         Fix #57707
589         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
590         AssemblyCultureAttribute is not used on executable.
591
592         * rootcontext.cs,
593         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
594
595 2005-07-16  Raja R Harinath  <rharinath@novell.com>
596
597         Fix #60638.
598         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
599         New.  Reports CS0252/CS0253.
600         Mostly taken from preliminary patch by Duncak Mak.
601         (Binary.DoResolveOperator): Store results of operator lookup.
602         Use them to detect if we need to warn about unintended reference
603         comparisons.
604
605 2005-07-15  Raja R Harinath  <rharinath@novell.com>
606
607         Fix #72969.
608         * namespace.cs (Namespace.Lookup): Add back location parameter.
609         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
610         * delegate.cs, ecore.cs, expression.cs: Update to changes.
611
612         * codegen.cs (EmitContext.DeclSpace): Make readonly.
613         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
614         (Namespace.LookupType): ... this.
615         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
616         of namespaces.
617         * typemanager.cs (LookupTypeReflection): Remove buggy code that
618         purported to handle pointers.
619         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
620         CoreLookupType.
621
622 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
623
624         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
625         type as namespace.
626
627 2005-07-15  Raja R Harinath  <rharinath@novell.com>
628
629         * namespace.cs (Namespace.Lookup): Drop location parameter.
630         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
631         (NamespaceEntry.Lookup): ... this.
632         (NamespaceEntry.Error_AmbiguousTypeReference):
633         Move here from DeclSpace.
634         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
635         names ...
636         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
637         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
638         Move to NamespaceEntry.
639         * delegate.cs, expression.cs: Update to changes.
640
641 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
642
643         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
644         CheckAttributeType and refactored.
645         (Attribute.ResolvePossibleAttributeType): Changed to reuse
646         ResolveAsTypeTerminal error handling.
647         (ResolveAsTypeTerminal): Introduced because of global attributes extra
648         handling.
649         (GetSignatureForError): Print errors in same way.
650
651         * class.cs,
652         * codegen.cs: Reflect attribute GetSignatureForError change.
653
654         * ecore.cs,
655         * expression.cs: Add silent parameter to ResolveAsTypeStep.
656
657         * namespace.cs (UsingEntry): Refactored to make fields private.
658
659         * assign.cs,
660         statement.cs: Error_UnexpectedKind has extra parameter.
661
662 2005-07-14  Raja R Harinath  <rharinath@novell.com>
663
664         * ecore.cs (IAlias): Remove.
665         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
666         that implement the interface.
667         * namespace.cs (Namespace): Likewise.
668         (Namespace.declspaces): Renamed from 'defined_names'.
669         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
670         DeclSpace instead of an IAlias.
671         * tree.cs (Tree.AddDecl): Update.
672
673 2005-07-12  Raja R Harinath  <rharinath@novell.com>
674
675         * statement.cs (Block.Flags); Remove HasVarargs.
676         (Block.HasVarargs): Move to ToplevelBlock.
677         (Block.ThisVariable, Block.AddThisVariable): Likewise.
678         (Block.Variables): Make protected.  Initialize variable hashtable
679         if necessary.
680         (Block.AddVariable): Update.
681         (Block.Resolve): Update to changes.
682         (ToplevelBlock.HasVarargs): New boolean.
683         (ToplevelBlock.ThisVariable): Move here from Block.
684         (ToplevelBlock.AddThisVariable): Likewise.
685         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
686         * expression.cs (This.ResolveBase): Update to changes.
687         (ArglistAccess.DoResolve): Likewise.
688
689 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
690
691         Fix #75321
692         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
693
694         * class.cs (TypeContainer.VerifyMembers): Distinguish between
695         not used and not used & assigned.
696         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
697
698 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
699
700         Fix #75053
701         * expression.cs (Is.DoResolve): null is never provided type.
702
703 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
704
705         Fix #52496
706         * cs-parser.jay: Less strict event error rule to catch more errors.
707
708 2005-07-08  Martin Baulig  <martin@ximian.com>
709
710         Fix test-iter-10.cs - distinguish whether we `yield' in a property
711         gettter (allowed) or setter (not allowed).
712
713         * class.cs (Accessor): Implement IIteratorContainer.
714         (Accessor.Yields): New public field.
715         (PropertyBase.PropertyMethod.Define): Handle iterators on a
716         per-accessor basis.
717
718         * cs-parser.jay
719         (get_accessor_declaration, set_accessor_declaration): Set the
720         `yields' flag on the accessor, not the property.
721         (property_declaration): Do the iterators check on a per-accessor
722         basis and not for the whole property.
723
724 2005-07-08  Martin Baulig  <martin@ximian.com>
725
726         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
727         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
728
729 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
730
731         Fix #74975
732         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
733         (ExtractSecurityPermissionSet): Cope with self referencing security
734         attributes properly.
735
736         * driver.cs (SetOutputFile): Made public property OutputFile.
737
738 2005-07-07  Raja R Harinath  <rharinath@novell.com>
739
740         Fix #75486.
741         * class.cs (TypeContainer.first_nonstatic_field): Rename from
742         has_nonstatic_fields.  Make into a FieldBase pointer.
743         (TypeContainer.AddField): Add CS0282 check.
744         (TypeContainer.EmitType): Update.
745
746 2005-07-06  Miguel de Icaza  <miguel@novell.com>
747
748         * cs-tokenizer.cs (consume_identifier): Do not create strings to
749         compare if they start with __.
750
751 2005-07-06  Raja R Harinath  <rharinath@novell.com>
752
753         * statement.cs (Switch.SwitchGoverningType): Only look at
754         UserCasts that don't need implicit standard conversions to one of
755         the allowed switch types (Fixes test-322.cs).
756         (LocalInfo.Resolve): Re-enable sanity-test.
757
758 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
759
760         * cs-tokenizer.cs (consume_identifier): Detect double undescores
761         
762         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
763         
764         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
765
766 2005-07-06  Raja R Harinath  <rharinath@novell.com>
767
768         Fix #75472.
769         * ecore.cs (SimpleName.GetSignatureForError): Add.
770         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
771         (MemberAccess.GetSignatureForError): Add.
772
773 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
774  
775         The big error and warning messages review.
776         
777         * anonymous.cs,
778         * assign.cs,
779         * attribute.cs,
780         * class.cs,
781         * codegen.cs,
782         * convert.cs,
783         * cs-parser.jay,
784         * cs-tokenizer.cs,
785         * decl.cs,
786         * delegate.cs,
787         * doc.cs,
788         * driver.cs,
789         * ecore.cs,
790         * enum.cs,
791         * expression.cs,
792         * flowanalysis.cs,
793         * iterators.cs,
794         * literal.cs,
795         * location.cs,
796         * modifiers.cs,
797         * namespace.cs,
798         * parameter.cs,
799         * pending.cs,
800         * report.cs,
801         * rootcontext.cs,
802         * statement.cs,
803         * support.cs,
804         * tree.cs,
805         * typemanager.cs: Updated.
806         
807         * class.cs: (MethodCore.SetYields): Moved here to share.
808         (PropertyMethod.Define): Moved iterator setup here.
809         
810         * iterators.cs: Add orig_method to have full access to parent
811         container.
812
813 2005-07-05  Raja R Harinath  <rharinath@novell.com>
814
815         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
816         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
817         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
818         variable of struct type.
819         * expression.cs (Unary.ResolveOperator): Update to change.
820         (Indirection.VerifyFixed): Likewise.
821         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
822         (ParameterReference.VerifyFixed): Value parameters are fixed.
823         (This.VerifyFixed): Treat 'this' as a value parameter.
824         * statement.cs (LocalInfo.IsFixed): Remove.
825
826 2005-07-01  Martin Baulig  <martin@ximian.com>
827
828         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
829         `ec.EmitThis ()' to get the correct scope.
830
831 2005-07-01  Martin Baulig  <martin@ximian.com>
832
833         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
834         instance is a ParameterReference; fixes #75299.
835
836 2005-07-01  Martin Baulig  <martin@ximian.com>
837
838         Reverted Marek's latest patch (r46725):
839         - it contains structural changes which are neither mentioned in
840           the ChangeLog nor explained anywhere; for example the additional
841           argument of EmitContext's and Iterator's .ctor's and the
842           TypeContainer.DefineMembers() change.
843         - structural changes like this should go in in seperate patches
844           and not be hidden in a huge patch which just seems to affect
845           warnings and errors.
846           a big and hard to understand patch.
847         - it breaks iterators and causes regressions, for instance in
848           test-iter-03.cs.      
849
850 2005-06-30  Raja R Harinath  <rharinath@novell.com>
851
852         Fix #75412.
853         * expression.cs (Indexers.map): Remove.
854         (Indexers.Append): Filter out inaccessible setters and getters.
855         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
856
857         Fix #75283.
858         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
859         Refactored from ...
860         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
861         (FieldExpr.Emit, PropertyExpr.Emit): Update.
862         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
863         * expression.cs (Invocation.EmitCall): Add CS0120 check.
864
865 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
866
867         Fix #75322
868         * class.cs (FieldBase.GetInitializerExpression): One more field
869         for backup.
870
871 2005-06-28  Miguel de Icaza  <miguel@novell.com>
872
873         * pending.cs: Do not define a proxy if the base method is virtual,
874         it will be picked up by the runtime (bug 75270).
875
876 2005-06-08  Martin Baulig  <martin@ximian.com>
877
878         The big Iterators rewrite :-)
879
880         * iterators.cs: Rewrite this to use the anonymous methods framework.
881
882         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
883         before the TypeContainers; see 2test-21.cs.
884
885         * class.cs
886         (TypeContainer.DefineType): Don't create a new EmitContext if we
887         already have one (this only happens if we're an Iterator).
888         (TypeContainer.Define): Also call Define() on all our iterators.
889         (Method.CreateEmitContext): Added support for iterators.
890
891         * anonymous.cs
892         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
893         (AnonymousContainer.CreateMethodHost): Moved here from
894         AnonymousMethod and made abstract.
895         (AnonymousContainer.CreateScopeType): New abstract method.
896         (AnonymousContainer.IsIterator): New public property.
897         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
898         get the ScopeTypeBuilder rather than manually defining it here. 
899         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
900         iterators here.
901
902         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
903         before RootContext.DefineTypes().
904
905         * codegen.cs (EmitContext.RemapToProxy): Removed.
906         (EmitContext.CurrentAnonymousMethod): Changed type from
907         AnonymousMethod -> AnonymousContainer.
908         (EmitContext.ResolveTopBlock): Protect from being called twice.
909         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
910         (EmitContext.EmitThis): Removed the iterators hacks; use the
911         anonymous methods framework for that.
912
913         * statement.cs
914         (ToplevelBlock.Container): Make this a property, not a field.
915         (ToplevelBlock.ReParent): New public method; move the
916         ToplevelBlock into a new container.
917         (Foreach.TemporaryVariable): Simplify.
918
919 2005-06-05  Martin Baulig  <martin@ximian.com>
920
921         * statement.cs (LocalInfo.CompilerGenerated): New flag.
922         (Block.AddTemporaryVariable): New public method; creates a new
923         `LocalInfo' for a temporary variable.
924         (Block.EmitMeta): Create the LocalBuilders for all the temporary
925         variables here.
926         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
927         non-iterator variables.
928
929 2005-06-05  Martin Baulig  <martin@ximian.com>
930
931         * statement.cs (Foreach.TemporaryVariable): Create the
932         LocalBuilder in the Emit phase and not in Resolve since in some
933         situations, we don't have an ILGenerator during Resolve; see
934         2test-19.cs for an example.
935
936 2005-06-04  Martin Baulig  <martin@ximian.com>
937
938         **** Merged r45395 from GCS ****
939
940         The big Foreach rewrite - Part II.
941
942         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
943         with `PropertyInfo ienumerator_getcurrent'.
944
945         * codegen.cs (VariableStorage): Removed.
946
947         * statement.cs
948         (Foreach): Derive from Statement, not ExceptionStatement.
949         (Foreach.CollectionForeach): New nested class.  Moved all the code
950         dealing with collection foreach here.
951         (Foreach.ForeachHelperMethods): Removed.
952         (Foreach.TemporaryVariable): Implement IMemoryLocation.
953
954 2005-05-23  Martin Baulig  <martin@ximian.com>
955
956         * statement.cs (Try.DoResolve): Don't create a `finally' if we
957         don't need to.  Fix #75014.
958
959 2005-05-20  Martin Baulig  <martin@ximian.com>
960
961         Merged r44808 from GMCS.
962
963         * class.cs (TypeContainer.CircularDepException): Removed.
964         (TypeContainer.DefineType): Removed the `InTransit' stuff.
965         (TypeContainer.CheckRecursiveDefinition): Check for circular class
966         (CS0146) and interface (CS0529) dependencies here.
967
968 2005-06-21  Raja R Harinath  <rharinath@novell.com>
969
970         * expression.cs (Invocation.EmitCall): Fix initialization
971         'this_call' to reflect current behaviour.  Fix indentation.
972
973         * convert.cs (FindMostEncompassedType): Add two trivial special
974         cases (number_of_types == 0 || number_of_types == 1).
975         (FindMostEncompasingType): Likewise.
976
977 2005-06-17  Raja R Harinath  <rharinath@novell.com>
978
979         Some cleanups preparing for the fix of #75283.
980         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
981         error testing.
982         (EventExpr.InstanceResolve): Likewise.
983         (EventExpr.DoResolve): Remove redundant checks.
984
985 2005-06-10  Duncan Mak  <duncan@novell.com>
986
987         * cs-tokenizer.cs (process_directives): New flag for controlling
988         the processing of preprocessor directives.
989         (x_token): After seeing a '#', return Token.NONE instead of going
990         to handle_preprocessing_directive() when not processing
991         directives. This avoids unnecessary processing during the token peek in
992         is_punct().
993
994         This fixes #74939.
995
996         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
997         the existing error reporting methods instead of Report.Error.
998
999         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1000         after Raja's rewrite.
1001
1002 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1003
1004         * class.cs: Small fix.
1005
1006 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1007
1008         Fix #75160.
1009         * class.cs (GetPartialBases): Fix return value check of
1010         part.GetClassBases.
1011
1012 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1013
1014         Ensure that partial classes are registered in their enclosing
1015         namespace.  Initial part of fix of #75160.
1016         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1017         Register declspace with namespace here, not in
1018         DeclSpace.RecordDecl.
1019         * cs-parser.jay: Pass namespace to RecordDecl.
1020         * class.cs (PartialContainer.Create): Likewise.
1021         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1022         called.
1023         * decl.cs (Declspace.RecordDecl): Remove.
1024         * namespace.cs (NamespaceEntry.DefineName): Remove.
1025
1026 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1027
1028         * rootcontext.cs: Reset TargetExt as well.
1029
1030 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1031
1032         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1033         -langversion:ISO-1.
1034
1035 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1036
1037         Fix #75080, cs0119.cs.
1038         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1039         of ...
1040         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1041         allowing ExprClass.Type and ExprClass.Namespace for
1042         ResolveFlags.VariableOrValue.
1043         (Expression.Resolve) [1-argument variant]: Change default resolve
1044         flags based on language version.
1045         (Expression.Error_UnexpectedKind): Use a simple string array
1046         rather than an ArrayList.
1047         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1048         not ExprClass.Type.
1049         (TypeOfVoid.DoResolve): Likewise.
1050         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1051         flags argument -- it always has the same value.
1052
1053 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1054
1055         Fix #75081.
1056         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1057         Use it in the error message.
1058         * assign.cs, expression.cs, statement.cs: Update.
1059
1060 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1061
1062         Fix #75088.
1063         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1064         the "almostMatchedMember" case too.
1065         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1066         that failed the accessibility checks to 'almost_match'.
1067
1068 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1069
1070         * attribute.cs: Use internal MethodBuilder methods to set
1071         ExactSpelling and SetLastError on PInvoke methods, instead
1072         of passing them via charset.  Fixes #75060.
1073
1074 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1075
1076         * parameter.cs (Parameter): Remove TODO comment.
1077         (Parameter.DefineParameter): Remove Location parameter.
1078         (Parameters.LabelParameters): Likewise.
1079         * class.cs (Constructor.Emit): Update to change.
1080         (MethodData.Emit): Likewise.
1081         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1082         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1083
1084 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1085
1086         * parameter.cs,
1087           Removed Parameters.Location and added Parameter.Location instead.
1088           Removed Location parameter from Emit() and GetSignature().
1089         * anonymous.cs,
1090           class.cs,
1091           cs-parser.jay,
1092           delegate.cs,
1093           iterators.cs,
1094           statement.cs :
1095           Modified all related calls.
1096
1097 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1098
1099         Improve user-defined conversion handling.
1100         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1101         applicable operators.
1102         (AddConversionOperators): New.  Helper for GetConversionOperators.
1103         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1104         there is only one most encompassed/encompassing type.
1105         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1106         "applicable operator" handling.
1107         (UserConversion): Move cache here from GetConversionOperators.
1108         Directly cache the chosen operator, rather than the whole
1109         MethodGroup.
1110         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1111         case.  Allow conversion of decimal to sbyte and byte too.
1112         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1113         New static methods.  Used to avoid allocating EmptyExpressions in
1114         convert.cs.
1115
1116 2005-05-24  Duncan Mak  <duncan@novell.com>
1117
1118         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1119         another class, used in Convert.ExplicitNumericConversion.
1120         (CastToDecimal): New class, similar to above, but casts to
1121         System.Decimal, used in Convert.ImplicitNumericConversion and also
1122         in explicit convesion from double/float to decimal.
1123
1124         * convert.cs (ImplicitNumericConversion): Handle implicit
1125         conversions to System.Decimal.
1126         (ExplicitNumericConversion): handle explicit conversions to
1127         System.Decimal.
1128
1129         This fixes #68711.
1130         
1131 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1132
1133         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1134         know the type at this stage, just break through.   Fixes #75008 
1135
1136 2005-05-19  Martin Baulig  <martin@ximian.com>
1137
1138         * delegate.cs
1139         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1140         to disable error reporting.
1141
1142         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1143         here since we don't want to report an error; see the new test-336.cs.
1144
1145 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1146
1147         * statement.cs (ToplevelBlock.GetParameterReference)
1148         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1149         Move here from class Block.
1150         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1151         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1152
1153 2005-05-18  Martin Baulig  <martin@ximian.com>
1154
1155         Fix #74978.
1156
1157         * flowanalysis.cs
1158         (FlowBranching.Reachability): Add non-static public And() and Or()
1159         methods.
1160         (FlowBranchingSwitch): New class; do the `break_origins' thing
1161         like in FlowBranchingLoop.
1162         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1163         reachability, not just locals and parameters.
1164         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1165         switch; MergeBreakOrigins() now takes care of that.
1166
1167 2005-05-18  Martin Baulig  <martin@ximian.com>
1168
1169         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1170         a loop and may leave it, reset the barrier; fixes #74974.
1171
1172 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1173         
1174         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1175         is back.
1176         
1177         * cs-parser.jay: Catch more lexical errors.
1178         
1179         * report.cs: Add one more Error method.
1180         
1181         * rootcontext.cs,
1182         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1183
1184 2005-05-17  Martin Baulig  <martin@ximian.com>
1185
1186         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1187         #70970. 
1188
1189 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1190
1191         Fix test-382.cs.  Emit values of decimal constants.
1192         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1193         Carved out of ...
1194         (TypeContainer.AddField): ... this.
1195         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1196         with initializers to include 'Const's.
1197         (ClassPart.RegisterFieldForInitialization): Forward to
1198         PartialContainer.
1199         * const.cs (Const.Const): Pass initializer to base class.
1200         (Const.Define): In case of decimal constants, register them for
1201         initialization in a static constructor.
1202
1203 2005-05-14  Martin Baulig  <martin@ximian.com>
1204
1205         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1206         do not call ResolveUnreachable() on unreachable statements in
1207         here, see the comment in the source code.
1208
1209 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1210
1211         Fix #74934.
1212         * expression.cs (BinaryResolveOperator): If one of the operands of
1213         an equality comparison is 'null' and the other is a pointer type,
1214         convert the null to a NullPointer.
1215         * convert.cs (ImplicitReferenceConversion): If the expression is a
1216         NullLiteral and the target type is a pointer type, return a
1217         NullPointer instead.
1218         (ImplicitConversionStandard): Likewise.
1219
1220 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1221         
1222         * cs-parser.jay: Set readonly context based on special constructs.
1223         
1224         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1225         readonly variable error handling.
1226         
1227         * rootcontext.cs (EmitCode): Don't verify members when error
1228         occurred.
1229         
1230         * statement.cs (LocalInfo): Add reaodnly context information.
1231         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1232
1233 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1234
1235         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1236         for #74041 to initialize 'resolved' to false only for explicit
1237         blocks.  Fixes #74873.
1238
1239 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1240
1241         Fix #74920.
1242         * typemanager.cs (unmanaged_enclosing_types): New.
1243         (IsUnmanagedType): Avoid infloops by using
1244         'unmanaged_enclosing_types' to talk with recursive invocations.
1245
1246 2005-05-13  Martin Baulig  <martin@ximian.com>
1247
1248         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1249         instance variable, not a local.  Fix #74873.
1250         (Block.ResolveUnreachable): Set it to true here.
1251
1252 2005-05-11  Duncan Mak  <duncan@novell.com>
1253
1254         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1255         continuing to process for 'arg'.
1256         (handle_preprocessing_directive): Check the argument of the #endif
1257         directive and report error CS1025 if there are any trailing
1258         characters.
1259
1260         According to the C# spec, having even whitespace after the #endif
1261         directive is illegal; however, because we call arg.TrimEnd ()
1262         beforehand, we have the same behavior as csc, allowing whitespace
1263         after the directive.
1264
1265         Fixes #74892.
1266
1267 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1268
1269         Fix #74863.
1270         
1271         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1272         (Constructor.GetObsoleteAttribute): Implemented correctly.
1273
1274 2005-05-10  Martin Baulig  <martin@ximian.com>
1275
1276         * support.cs (ReflectionParameters.ParameterModifier): Use
1277         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1278         and `ParameterAttributes.In'.  Fixes #74884.
1279
1280 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1281
1282         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1283         
1284         * expression.cs (Argument.GetParameterModifier): Turned to property.
1285         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1286         
1287         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1288         its C# equivalent.
1289         
1290 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1291
1292         Fix #74852.
1293         * decl.cs (MemberCache.AddMethods): Register override methods,
1294         rather than non-override methods.
1295         * typemanager.cs (RegisterOverride): New.
1296         (IsOverride): Update.
1297
1298 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1299
1300         Fix #73105.
1301         
1302         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1303         recursive declaration.
1304         
1305         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1306         
1307 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1308
1309         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1310         
1311         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1312
1313 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1314
1315         Fix #74797.
1316         * decl.cs (DeclSpace.FamilyAccessible): 
1317         Use TypeManager.IsNestedFamilyAccessible.
1318
1319         Fix reopened #64812.
1320         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1321         internal'.
1322
1323 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1324             Abin Thomas  <projectmonokochi@rediffmail.com>
1325             Anoob V E  <projectmonokochi@rediffmail.com>
1326             Harilal P R  <projectmonokochi@rediffmail.com>
1327
1328         Fix #64812.
1329         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1330         allow access to all static members.
1331
1332 2005-05-04  Martin Baulig  <martin@ximian.com>
1333
1334         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1335
1336 2005-05-04  Martin Baulig  <martin@ximian.com>
1337
1338         Fix #74655.
1339
1340         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1341         section at the end; make things work if `default' is not the last
1342         section.        
1343
1344 2005-05-04  Martin Baulig  <martin@ximian.com>
1345
1346         Fix #70400.
1347
1348         * statement.cs (Switch): Replaced the `got_default' field with a
1349         `default_section' one.
1350         (Switch.CheckSwitch): Set `default_section' here.
1351         (Switch.Resolve): If we're a constant switch and the constant is
1352         not found, use the default section.
1353
1354 2005-05-03  Martin Baulig  <martin@ximian.com>
1355
1356         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1357
1358         * statement.cs (Foreach.ArrayForeach): New nested class.
1359         (Foreach.TemporaryVariable): New nested class.
1360         (Foreach.EmitArrayForeach): Removed; this is now in the new
1361         ArrayForeach class.
1362
1363 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1364
1365         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1366         more conservative.
1367         (VerifyPendingMethods): Revert change below.
1368
1369         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1370         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1371         that used to trigger warning -28.  Remove warning -28.
1372         * expression.cs (Invocation.OverloadResolve): Use
1373         TypeManager.IsOverride to distinguish override methods.
1374
1375         Fix #74773.
1376         * pending.cs (VerifyPendingMethods): If a base type implements the
1377         requested interface, don't bother checking individual methods of
1378         the base type.  As a side-effect, this prevents the creation of
1379         unnecessary proxies.
1380
1381 2005-05-02  Martin Baulig  <martin@ximian.com>
1382
1383         Fix #70182.
1384
1385         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1386         Also `And' the locals if the old vector is null.
1387         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1388         null; in this case we basically reset all the variables.        
1389
1390 2005-05-02  Martin Baulig  <martin@ximian.com>
1391
1392         Fix #74529.
1393
1394         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1395         Added `FlowBranching branching' argument; always `and' the
1396         variables instead of `or'ing them unless we're an infinite loop.
1397
1398         * statement.cs (While.Resolve): Create a new sibling unless we're
1399         infinite.       
1400
1401 2005-05-02  Martin Baulig  <martin@ximian.com>
1402
1403         Fix #70140.
1404
1405         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1406         arguments; use it instead of creating a new TopLevelBlock.
1407         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1408         our ConstructorInitializer.
1409
1410         * statement.cs
1411         (TopLevelBlock.TopLevelBranching): New public property.
1412         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1413         and create our `TopLevelBranching'.
1414
1415         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1416         anonymous method host, use `block.TopLevelBranching' rather than
1417         creating a new branching.
1418
1419 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1420
1421         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1422         a ScopeInfo, if any of the current children is a child of the new
1423         entry, move those children there.
1424
1425 2005-04-30  Martin Baulig  <martin@ximian.com>
1426
1427         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1428         at the beginning of a SwitchSection.  Fix #73335.
1429
1430 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1431
1432         Fix #74378
1433         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1434         
1435         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1436         (FieldExpr.DoResolve): Obsolete members are ignored for field
1437         initializers.
1438         
1439 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1440
1441         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1442         of arrays detection.
1443
1444         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1445         verification.
1446         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1447
1448         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1449         arrays report.
1450
1451 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1452
1453         * cs-parser.jay: Use the prefered version of -unsafe in error
1454         message.
1455
1456 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1457
1458         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1459         circumstances.
1460
1461 2005-04-20  John Luke  <john.luke@gmail.com>
1462
1463         * driver.cs: fix typo in error message, --outout to --output
1464
1465 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1466
1467         * codegen.cs (InRefOutArgumentResolving): New field.
1468         
1469         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1470         fields outside contructor.
1471         
1472         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1473         
1474 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1475
1476         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1477         parameter code was not completed ever, so it was not as up-to-date
1478         as local variables.  Must finish it.
1479
1480         The bug fix was to compare the Toplevel of the block, not the
1481         current block.  Thanks for Ben for pointing this out. 
1482
1483 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1484
1485         * decl.cs (AddMethods): Use the declaring type of the problem
1486         method to determine if we want to squash a warning.
1487
1488 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1489
1490         * attribute.cs: Removed debug output.
1491
1492         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1493         
1494         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1495         Report.Stderr.
1496         
1497 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1498
1499         Fix #74481.
1500         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1501         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1502         all null comparisons against reference types.
1503
1504 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1505
1506         Fix# 74565
1507         * class.cs (TypeContainer.CircularDepException) New nested
1508         exception class.
1509         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1510         (TypeContainer.DefineType): Removed error, reset InTransit before
1511         exit.
1512         (Class.DefineType): Throw exception when is in Transit.
1513         Catch exception and report error.
1514         (Struct.DefineType): Throw exception when is in Transit.
1515         Catch exception and report error.
1516         (Interface.DefineType): Throw exception when is in Transit.
1517         Catch exception and report error.
1518
1519         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1520         handle nested exception handlers.
1521
1522         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1523         a catch.
1524
1525         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1526         InFinally and InCatch storage.
1527
1528         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1529         (Catch.Resolve): Set and Restore ec.InCatch.
1530         (Try.Resolve): Set and Restore ec.InFinally.
1531         (Try.HasCatch): True when try has catch.
1532
1533 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1534
1535         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1536           for the same event member, so exclude such cases from warning 419.
1537           Fixed bug #74633.
1538
1539 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1540
1541         * expression.cs (Binary.ResolveOperator): Apply patch from John
1542         Luke to fix bug 59864: operators &, | and ^ on enumerations
1543         require that the same enum type on both sides.
1544
1545         * driver.cs: Add warnings to old flag usage, this is to assist
1546         people who produce Makefiles and hope that the Makefiles will be
1547         used on Windows.
1548
1549         * class.cs (TypeContainer.EmitType): Moved the definition of the
1550         special $PRIVATE$ field from the resolve phase to the Emit phase.
1551         During resolve we do not know if we are a struct with
1552         HasExplicitLayout, we know this only after the attributes for the
1553         type are emitted.
1554
1555         Set the FieldOffset to zero on the dummy field that we create for
1556         the class.   Fixes 74590.
1557
1558 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1559
1560         Fix #73834.
1561         * ecore.cs (PropertyExpr.resolved): New.
1562         (DoResolve): Use it to handle a case of double resolution here.
1563         Handle a case of identical-name-and-type-name.
1564         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1565         resolution by storing the results of expression resolution back
1566         into the "probes" array.
1567
1568 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1569
1570         Fix cs0208-7.cs and cs0208-8.cs.
1571         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1572         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1573         error reporting to point out the reason a struct is not unmanaged.
1574
1575 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1576
1577         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1578           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1579
1580 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1581
1582         Fix #74528.
1583         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1584         IdenticalNameAndTypeName here.
1585         (EventExpr.InstanceResolve): Likewise.
1586
1587 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1588
1589         C# 2.0 DefaultCharSetAttribute implementation
1590         
1591         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1592         which allows us to set GlobalNamespace for every resolve.
1593         (Attribute.ResolveArguments): Cut from Resolve.
1594         (Attribute.GetCharSetValue): Returns CharSet named argument.
1595         (Attribute.DefinePInvokeMethod): Gets default charset from
1596         module settings.
1597         (GlobalAttribute.ResolveAsTypeStep): Override.
1598         (GlobalAttribute.ResolveArguments): Override.
1599         
1600         * class.cs (TypeAttr): Is protected.
1601         
1602         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1603         (ModuleClass.DefaultCharSetType): New memeber.
1604         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1605         
1606         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1607         charset from module.
1608         
1609         * delegate.cs (TypeAttr): Override.
1610         (Delegate.DefineType): Use this TypeAttr.
1611         
1612         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1613         at very early stage (before types are defined) to resolve model
1614         module attributes. It will probably not work with corlib but it
1615         should be ok.
1616         
1617         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1618         charset from module.
1619         
1620         * typemanager.cs (default_charset_type): New type.
1621
1622 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1623
1624         * decl.cs (MemberCache.AddMethods): Don't warn if
1625         System.Object.Finalize has buggy MethodAttributes.
1626
1627         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1628         removed below.
1629
1630 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1631
1632         * doc.cs : detect ambiguous reference to overloaded members.
1633           Fixed bug #71603. MS 1.1 csc does not detect it.
1634
1635 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1636
1637         * doc.cs : delegates must not be referenced with parameters.
1638           Fixed bug #71605.
1639
1640 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1641
1642         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1643
1644 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1645
1646         * driver.cs (MainDriver): Stop processing if the CLS stage found
1647         errors. 
1648
1649         (CompilerCallableEntryPoint.InvokeCompiler): Always
1650         reset after execution;   Take a TextWriter argument for the
1651         output.
1652
1653         * report.cs: Use the error stream instead of hardcoding stderr. 
1654
1655 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1656
1657         * class.cs: Reduce code paths to test, too small of an
1658         optimization to make it worth the extra testing.  Always perform
1659         it. 
1660
1661 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1662
1663         Fix #74510.
1664         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1665         operators that had errors reported on them.
1666
1667 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1668
1669         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1670         argument types.
1671         (Attribute.Resolve): Add named argument type checking.
1672         
1673         * class.cs (FixedField.Define): Use IsPrimitiveType
1674         
1675         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1676         
1677         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1678         unsafe parameter types.
1679         
1680         * statement.cs (Using.ResolveExpression): Add better error description.
1681         
1682         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1683         
1684 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1685
1686         Fix #74484.
1687         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1688         AttributeUsageAttribute in the emitcontext of the attribute class,
1689         not in the emitcontext of the attributable entity it was attached to.
1690         * cs-parser.jay: Use 'current_class', not 'current_container',
1691         when creating a GlobalAttribute.
1692
1693 2005-04-08  Alp Toker  <alp@atoker.com>
1694
1695         * pending.cs: The fix to #58413 failed to compile methods implementing
1696         interfaces with/without params modifiers and vice versa, even though
1697         params modifiers aren't part of the signature. Make the modifier check
1698         less strict as in csc.
1699
1700 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1701             Anoob V E  <projectmonokochi@rediffmail.com>
1702             Harilal P R  <projectmonokochi@rediffmail.com>
1703
1704         Fix #58413.
1705         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1706         modifiers of pending methods.
1707         (PendingImplementation.PendingImplementation): Initialize it.
1708         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1709         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1710         with ParameterData.  Add check for modifiers.
1711         * class.cs (MethodData.Define): Update to changes.
1712
1713 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1714
1715         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1716
1717 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1718
1719         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1720         property.
1721         
1722         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1723         
1724         * rootcontext.cs,
1725         * typemanager.cs: Registered RequiredAttributeAttribute.
1726         
1727 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1728
1729         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1730         Warning CS0169 is back at level 3.
1731         (IMethodData.SetMemberIsUsed): New method.
1732         
1733         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1734         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1735         
1736         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1737
1738         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1739         contants.
1740         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1741         is used.
1742         
1743         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1744         is used.
1745         
1746         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1747         to avoid the problems with nested types.
1748
1749 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1750             Anoob V.E  <projectmonokochi@rediffmail.com>
1751             Harilal P.R  <projectmonokochi@rediffmail.com>
1752             Raja R Harinath  <rharinath@novell.com>
1753
1754         Fix #73820.
1755         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1756         attribute.
1757         * typemanager (GetConstructor): Make public.
1758
1759 2005-04-05  John Luke  <john.luke@gmail.com>
1760             Raja R Harinath  <rharinath@novell.com>
1761
1762         Fix #62232.
1763         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1764         struct too.  Return false quicker in a few cases.
1765         (VerifyUnManaged): Use it.
1766
1767 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1768
1769         Fix #74041.
1770         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1771         not 'unreachable_seen'.
1772
1773 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1774
1775         * attribute.cs (Attribute.GetValue): Removed unused.
1776         
1777         * codegen.cs (CodeGen.TrimExt): Removed unused.
1778         
1779         * cs-parser.jay (output): Removed unused.
1780         
1781         * cs-tokenizer.cs (hex_digits): Removed unused.
1782         
1783         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1784         
1785         * expression.cs (Indirection.LoadExprValue): Removed unused.
1786         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1787         
1788         * iterators.cs (Iterator.param_types): Removed unused.
1789         
1790         * statement.cs (Goto.block): Removed unused.
1791         (ToplevelBlock.did): Removed unused.
1792         (Switch.ResolveConstantSwitch): Removed unused.
1793
1794 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1795
1796         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1797         resetting thingy.
1798
1799 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1800
1801         Fix #74232 and cs0208-3.cs.
1802         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1803         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1804         unmanaged type.  Don't use FieldBuilders when 't' is a
1805         TypeBuilder.  Use ModFlags and MemberType fields.
1806         * class.cs (MemberBase.member_type): Rename from MemberType.
1807         (MemberBase.MemberType): New property.  Determines member_type on
1808         demand.
1809         (MemberBase.DoDefine): Don't initialize MemberType here.
1810         (FieldMember.Define): Likewise.
1811
1812 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1813
1814         Fix #74241
1815         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1816         Attributes are emitted there.
1817         
1818 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1819
1820         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1821         keyword in 'partial enum' too.
1822         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1823         is not allowed).
1824         Report from Kamil Skalski <nazgul@omega.pl>.
1825
1826         Fix #74309.
1827         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1828         have partial containers too.
1829
1830         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1831         in block' checks to Block.CheckInvariantMeaningInBlock.
1832         * statement.cs (Block.GetKnownVariableInfo): Make private.
1833         (Block.IsVariableUsedInChildBlock): Remove.
1834         (Block.IsVariableUsedInBlock): Likewise.
1835         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1836         conflicting declaration.
1837         (Block.AddVariable): Make error messages less long-winded and more
1838         specific.  Show location of conflicting declaration.
1839         * parameter.cs (Parameters.Location): New readonly property.
1840
1841 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1842
1843         Clean up semantics of invoking ResolveMemberAccess.
1844         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1845         can have an instance, ensure that we pass in a non-TypeExpression
1846         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1847         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1848         argument.  Update to changes and simplify.
1849         (FieldExpr.Emitinstance): Remove CS0120 check.
1850         (PropertyExpr.EmitInstance): Likewise.
1851         * expression.cs (Argument.Resolve): Likewise.
1852         (Invocation.DoResolve): Update to changes in semantics of
1853         InstanceExpression.
1854
1855 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1856
1857         Fix #74241
1858         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1859         customization.
1860         
1861         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1862
1863 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1864
1865         Fix difference in behaviour with commandline invocation.
1866         * driver.cs (Driver.Reset): New.
1867         (CompilerCallableEntryPoint): Call it.
1868
1869         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1870         variable" warnings if the boolean expression failed to resolve.
1871
1872 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1873
1874         * attribute.cs: Fix the union of several permissions when some of them
1875         are unrestricted (so the result isn't an unrestricted permission set).
1876         Fix #74036.
1877
1878 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1879
1880         * ecore.cs (MemberExpr): New class.  Convert from interface
1881         IMemberExpr.
1882         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1883         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1884         error checks.
1885         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1886         (MethodGroupExpr.IsExplicitImpl): Remove.
1887         (Expression.GetFieldFromEvent): Remove.
1888         (SimpleName.MemberStaticCheck): Remove.
1889         (SimpleName.DoSimpleNameResolve): Update to changes.
1890         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1891         (MemberAccess.IdenticalNameAndTypeName): Remove.
1892         (MemberAccess.error176): Move to MemberExpr.
1893         (MemberAccess.DoResolve): Update to changes.
1894         (BaseAccess.DoResolve): Likewise.
1895
1896 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1897
1898         C# 2.0 Conditional attribute class implementation
1899         
1900         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1901         Analyzes class whether it has attribute which has ConditionalAttribute
1902         and its condition is not defined.
1903         
1904         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1905         (Class.IsExcluded): New method. Search for at least one defined
1906         condition in ConditionalAttribute of attribute class.
1907
1908 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1909
1910         * ecore.cs (PropertyExpr): Derive from Expression, not
1911         ExpressionStatement.
1912         (PropertyExpr.EmitStatement): Remove.
1913
1914 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1915
1916         Fix #74060.
1917         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1918         internal field "value__" of an enum be private.  The examples for
1919         "value__" that I found on MSDN all used FieldAttributes.Private.
1920
1921         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1922         Don't mention IL method attribute names.
1923
1924         Fix #47991.  Remove a TODO.
1925         * statement.cs (Block.Toplevel): Make into a field.
1926         (Block.Parameters): Move into ToplevelBlock.
1927         (Block.known_variables): Rename from child_variable_names.
1928         (Block.Block): Remove variants that take Parameters.  Initialize
1929         'Toplevel' with the immediately surrounding toplevel block.
1930         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1931         LocalInfo parameter.
1932         (Block.GetKnownVariableInfo): New.
1933         (Block.IsVariableNameUsedInChildBlock): Update.
1934         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1935         the block, even though it may not be in scope.
1936         (Block.AddVariable): Remove Parameters parameter.  Use
1937         Toplevel.Parameters instead.
1938         (Block.AddConstant): Remove Parameters parameter.
1939         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1940         (Block.IsParamaterReference): Likewise.
1941         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1942         (ToplevelBlock.Parameters): New.  Moved from Block.
1943         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1944         initialize Parameters to a non-null value.
1945         * cs-parser.jay: Update to changes.
1946         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1947         simple names that mean different things in the same block.  Use
1948         Block.IsVariableNameUsedInBlock.
1949
1950 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1951
1952         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1953         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1954         GetTypeHandle.  It is possible for a reflected type to derive from
1955         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1956         System.Array during mscorlib compilation).
1957         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1958         contain a method_hash, don't create one either.  Don't create a
1959         deep copy of the base cache's method_hash.
1960         (MemberCache.SetupCache): Rename back from DeepCopy.
1961         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1962         already initialized.  If we see an override function, add its
1963         underlying base virtual function to the member_hash too.
1964
1965         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1966
1967 2005-03-26  Raja R Harinath  <harinath@acm.org>
1968
1969         Fix #73038.
1970         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1971         fails to resolve, ensure that the LHS is still resolved as an
1972         lvalue.
1973
1974 2005-03-25  Raja R Harinath  <harinath@acm.org>
1975
1976         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1977         ec.ContainerType.
1978         (Enum.current_ec): Remove.
1979         (Enum.LookupEnumValue): Remove EmitContext argument.
1980         Just uses the one created during DefineType.
1981         (Enum.FindMembers): Update.
1982         * expression.cs (MemberAccess.DoResolve): Update.
1983
1984 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1985
1986         * assign.cs (Assign.DoResolve): Check for CS1717 when
1987         source and target are same (uses Equals).
1988
1989         * expression.cs (LocalVariableReference, ParameterReference,
1990         This): Implemented Equals, GetHashCode.
1991
1992         * statement.cs (Block.GetParameterReference): Removed useless
1993         local variable.
1994
1995 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1996
1997         Fix cs0128.cs
1998         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1999         blocks before deciding whether the error is cs0136 or cs0128.
2000
2001         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2002         (using_alias_directive, using_namespace_directive): Pass
2003         MemberName, not an expression to Namespace.UsingAlias and
2004         Namespace.Using.
2005         (MakeName): Use the MemberName of the namespace.
2006         * namespace.cs (Namespace.MemberName): New.
2007         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2008         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2009         Likewise.
2010         * decl.cs (MemberName.Name): Make readonly.
2011         (MemberName.FromDotted): New "constructor".
2012         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2013         (MemberCore.Name): Compute from MemberName on demand.
2014         (MemberCore.SetMemberName): Provide a way to change the
2015         MemberName.
2016         (MemberCore.AddToContainer): Don't take a fullname parameter.
2017         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2018         fully qualified name of the container to the member name.
2019         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2020         only if the type is a member of the root container.
2021         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2022         MemberName.Left rather than searching for an embedded ".".
2023         (PartialContainer.CreatePart): Update to changes in RootContext.
2024         (MemberBase.ShortName): Turn into a property.  Use
2025         MemberCore.SetMemberName.
2026         (MemberBase.ExplicitInterfaceName): Remove.
2027         (MemberBase.UpdateMemberName): Remove.
2028         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2029         (PropertyBase.SetMemberName): New override.
2030         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2031         (Tree.GetDecl): New.
2032         (Tree.AllDecls): Rename from Decls.
2033         * attribute.cs, enum.cs, report.cs: Update to changes.
2034         * driver.cs (MainDriver): Use MemberName.FromDotted on
2035         RootContext.MainClass.
2036
2037 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2038
2039         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2040         checks.
2041
2042         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2043
2044 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2045
2046         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2047         property accessor modifiers.
2048
2049         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2050         fixed buffer attribute (CS1716).
2051         (PropertyMethod.HasCustomAccessModifier): When property accessor
2052         has custom modifier.
2053
2054         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2055         modifiers.
2056         (PropertyExpr.DoResolveLValue): Add CS0272.
2057
2058 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2059
2060         * convert.cs: When converting to a pointer, use the proper Conv.U
2061         or Conv.I depending on the source data type.
2062
2063         * cs-tokenizer.cs: Make the size for large decimal constants,
2064         fixes #72957.
2065
2066 2005-03-17  Martin Baulig  <martin@ximian.com>
2067
2068         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2069         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2070
2071 2005-03-17  Martin Baulig  <martin@ximian.com>
2072
2073         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2074         to bool so we can return an error condition.
2075         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2076         returned an error.
2077
2078 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2079
2080         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2081         attributes.
2082
2083 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2084
2085         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2086         Refactor to avoid traversing the list of assemblies, and to avoid
2087         string concatenation.
2088         * typemanager.cs (guid_attr_type): Remove.
2089         (negative_hits, pointers, references): Remove hashes.
2090         (type_hash): New.
2091         (GetConstructedType): New.  Uses type_hash to handle constructed
2092         types (arrays, references, pointers).
2093         (GetReferenceType, GetPointerType): Use it.
2094         (GetNestedType): New.  Uses type_hash to handle nested types of
2095         reflected types.
2096         (LookupType, LookupTypeDirect): Remove.
2097         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2098         'types' hash and LookupTypeReflection directly.
2099         (params_string, params_object): Use GetConstructedType.
2100         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2101         top-level types.
2102         (Namespace.Lookup): Use cached_types.
2103         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2104         provided by old TypeManager.LookupType.
2105         * rootcontext.cs (MakeFQN): Remove.
2106         * decl.cs (DeclSpace.MakeFQN): Likewise.
2107         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2108         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2109         TypeManager.GetConstructedType.
2110         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2111
2112 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2113
2114         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2115         indexers.
2116
2117         * cs-parser.jay: Reports CS1527 for any namespace element.
2118
2119         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2120         Added CS0407.
2121
2122         * expression.cs (ParameterReference.IsAssigned): Changed error to
2123         CS0269.
2124         (Error_WrongNumArguments): Moved CS0245 detection here.
2125
2126         * statement.cs (Return.Resolve): Add CS1622 report.
2127
2128 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2129
2130         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2131
2132 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2133
2134         * attribute.cs expression.cs: Get rid of some allocations.
2135
2136 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2137
2138         * doc.cs : just eliminate the latest change.
2139
2140 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2141
2142         * doc.cs : commented out the latest change. It breaks xml-030.cs
2143
2144 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2145
2146         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2147           fail. So invoke CreateType() in FindDocumentedType().
2148
2149 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2150
2151         * cs-tokenizer.cs : added IsKeyword().
2152         * doc.cs : Detect keyword incorrectly used as identifier.
2153           Allow identifiers prefixed by @.
2154
2155 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2156
2157         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2158         It caused exception in namespace resolving (again!).
2159         
2160         * class.cs (Class.ctor): Removed exit.
2161         (PropertyMethod.ctor): ditto.
2162         
2163         * codegen.cs (Codegen.Reset): Reset static data.
2164         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2165         
2166         * cs-tokenizer.cs (Cleanup): Removed.
2167         
2168         * driver.cs (GetSystemDir): Rewrote to one line command.
2169         It caused problem with unloaded dynamic modules.
2170         (UnixParseOption): Removed Exit.
2171         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2172         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2173         Now can be mcs used as library.
2174         
2175         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2176         empty location.
2177         
2178         * location.cs (Reset): Reset static data.
2179         
2180         * namespace.cs (Reset): Reset static data.
2181         
2182         * report.cs (Report.Reset): Reset static data.
2183         
2184         * rootcontext.cs (RootContext.Reset): Reset static data.
2185         
2186         * tree.cs (RootTypes.ctor): Use Location.Null
2187         
2188         * typemanager.cs (TypeManager.Reset): Reset static data.
2189         (CoreLookupType): Removed Exit.
2190         (TypeHandle.Reset): Reset static data.
2191         
2192 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2193
2194         Fix #73516.
2195         * typemanager.cs (ComputeNamespaces): Import namespaces from
2196         referenced modules too.
2197
2198 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2199
2200         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2201         than '.'.
2202
2203 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2204
2205         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2206         enclosing DeclSpace.  This ensures that a name-lookup populates
2207         more caches and there are fewer 'TypeExpression's.  Carve out
2208         nested type lookup into ...
2209         (LookupNestedTypeInHierarchy): ... this.
2210
2211 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2212
2213         Clean up a few partial-class semantics.  
2214         Fixes test-357.cs and cs1618-2.cs.
2215         * cs-parser.jay (struct_declaration): Use 'current_class' as
2216         parent of newly-created struct.  Remove call to Register ().
2217         Use 'pop_current_class' to complete handing the current struct.
2218         (interface_declaration): Likewise.
2219         (class_declaration): Likewise.
2220         (enum_declaration): Use 'current_class' as parent of newly created
2221         enum.
2222         (delegate_declaration): Likewise.
2223         (pop_current_class): New function.  This is used to handle closing
2224         up the 'current_class' and 'current_container', and pointing them
2225         to the enclosing class/container.
2226         (CSharpParser): Initialize 'current_class' too.
2227         * decl.cs (MemberCore): Add check for invariant: a partial
2228         container is not a parsed entity, and thus does not enclose any
2229         parsed members.
2230         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2231         (DeclSpace.BaseTypeExpr): Use it.
2232         (DeclSpace.LookupType): Add check for invariant.
2233         * class.cs (TypeContainer): Add check for invariant: a nested
2234         class should have the same NamespaceEntry as its enclosing class.
2235         (TypeContainer.EmitFieldInitializers): Make virtual.
2236         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2237         MemberCore.
2238         (TypeContainer.Register): Remove.
2239         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2240         null.  Use TypeResolveEmitContext for resolving base types and
2241         interfaces.  Move initialization of Parts.TypeBuilder here from
2242         ...
2243         (TypeContainer.DefineNestedTypes): ... here.
2244         (PartialContainer): Take a Namespace not a NamespaceEntry.
2245         (PartialContainer.Create): Don't use Register.  Call the
2246         appropriate Add... function directly.
2247         (ClassPart): Take both the PartialContainer and the enclosing
2248         class as constructor arguments.
2249         (ClassPart.EmitFieldInitializers): Override.
2250         (ClassPart.PartFindNestedTypes): Remove.
2251         (FieldBase.GetInitializerExpression): Resolve the initializer
2252         expression in the emit context of the enclosing class.
2253         * tree.cs (RootTypes): Remove Register ().
2254         
2255 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2256
2257         * cs-parser.jay: Removed CS0134.
2258         
2259         * driver.cs: Removed CS1901.
2260         
2261         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2262         for predefined types.
2263
2264 2005-03-07  Duncan Mak  <duncan@novell.com>
2265
2266         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2267         well. Fixes bug #73454.
2268
2269 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2270
2271         * cs-tokenizer.cs (xtoken): Add CS1035.
2272         
2273         * class.cs (MethodData.Define): Add CS0683.
2274         (FieldMember.ctor): Add CS0681.
2275
2276 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2277
2278         * ecore.cs (SimpleName.DoResolve): Rename from
2279         SimpleName.DoResolveAllowStatic.
2280         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2281         Pass 'intermediate' flag to MemberStaticCheck.
2282         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2283         of "intermediate" lookups via MemberAccess.
2284         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2285         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2286
2287 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2288
2289         Fix #73394.
2290         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2291         slipped in because of variable names that are identical to a
2292         builtin type's BCL equivalent ('string String;', 'int Int32;').
2293         (PropertyExpr.EmitInstance): Likewise.
2294
2295 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2296
2297         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2298         
2299         * report.cs (warning_ignore_table): Made public.
2300
2301 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2302
2303         Fix #73282.
2304         * class.cs (MethodData.Emit): Pass 'container' to
2305         container.GetObsoleteAttribute instead of 'container.Parent'.
2306
2307 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2308
2309         * cs-parser.jay: Add 1534 error test.
2310
2311         * iterators.cs (Yield.CheckContext): Add error 1629.
2312         (Iterator.ctor): Save unsafe modifier.
2313         (MoveNextMethod.DoEmit): Restore unsafe context.
2314
2315         * namespace.cs (UsingAlias): Better error message.
2316
2317 2005-03-03  Dan Winship  <danw@novell.com>
2318
2319         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2320         the warning message [#73219]
2321
2322 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2323
2324         Fix compile with MCS 1.0.0.0.
2325         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2326         w_restore to not depend on string constant folding.
2327
2328 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2329
2330         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2331         CS0246 check to users who passed 'silent = false'.
2332         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2333         check.
2334         (SimpleName.SimpleNameResolve): Update.
2335         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2336         (MemberAccess.IdenticalNameAndTypeName): Update.
2337         * doc.cs (FindDocumentedTypeNonArray): Update.
2338
2339 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2340
2341         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2342         * parameters.cs (ComputeAndDefineParameters): Remove.
2343         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2344         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2345         Use GetParameterInfo.
2346
2347 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2348
2349         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2350
2351 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2352
2353         Unify DeclSpace.LookupType and DeclSpace.FindType.
2354         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2355         is in charge of defining nested types on demand.
2356         (DeclSpace.LookupType): Use it when the current_type is a
2357         TypeBuilder.  Use LookupTypeDirect for reflected types.
2358         (DeclSpace.FindType): Remove.
2359         (DeclSpace.LookupInterfaceOrClass): Likewise.
2360         (DeclSpace.DefineTypeAndParents): Likewise.
2361         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2362         DeclSpace.LookupType.
2363         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2364         * typemanager.cs (LookupType): Simplify.
2365         (AddUserType): Remove type from negative_hits.
2366         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2367         * class.cs (TypeContainer.FindMembers): Move handling of nested
2368         types ...
2369         (TypeContainer.FindMembers_NestedTypes): ... here.
2370         (TypeContainer.FindNestedType): Implement override.
2371         (ClassPart.FindNestedType): Delegate to PartialContainer.
2372         (ClassPart.PartFindNestedType): Looks up the nested types of the
2373         part alone.
2374
2375 2005-03-02  Martin Baulig  <martin@ximian.com>
2376
2377         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2378         static constructor in static classes.
2379
2380 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2381
2382         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2383         sizeParamIndex is not specified.
2384
2385 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2386
2387         Fix #73117
2388         * report.cs (WarningMessage.IsEnabled): Missing null check.
2389
2390 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2391
2392         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2393         in the fields and not in the properties.
2394
2395 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2396
2397         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2398         fields as well.
2399
2400 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2401
2402         * attribute.cs: Small refactoring (improved robustness).
2403         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2404         (ValidateGuid): Removed.
2405         (Resolve): Removed referenced to above mentioned.
2406         (GetAttributeUsage): Made private and changed to work without
2407         class assistance.
2408         (GetIndexerAttributeValue): Don't crash.
2409         (GetConditionalAttributeValue): Ditto.
2410         (GetClsCompliantAttributeValue): Ditto.
2411         (ExtractSecurityPermissionSet): All attributes exceptions are
2412         error 648.
2413         (GetPropertyValue): New helper.
2414         (GetMethodImplOptions): New method.
2415         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2416         some missing properties.
2417         
2418         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2419         (Method.ApplyAttributeBuilder): Updated.
2420         
2421         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2422         exception.
2423
2424 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2425
2426         Fix #73052.
2427         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2428         non-simple types (array, pointer, reference).
2429
2430 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2431
2432         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2433
2434         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2435         for operators.
2436         (Method.CheckBase): Catch wrong destructor here.
2437         (MethodData.Define): Add errors 550, 668.
2438
2439         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2440
2441         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2442
2443         * pending.cs (VerifyPendingMethods): Add error 551.
2444
2445         * typemanager.cs (CSharpName): Next error report helper.
2446
2447 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2448
2449         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2450         attributes. Removed useless attribute double check.
2451         It saves almost 2MBs for corlib.
2452
2453 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2454
2455         Fix #72924.
2456         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2457         called twice in case of error.
2458
2459 2005-02-23  Chris Toshok  <toshok@ximian.com>
2460
2461         Fix compiler portions of #72827.
2462         * statement.cs (Block.Emit): call Begin/EndScope on the
2463         EmitContext instead of the ILGenerator.
2464
2465         * codegen.cs (EmitContext.BeginScope): new method, call
2466         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2467         we have one.)
2468         (EmitContext.BeginScope): same, but EndScope and CloseScope
2469
2470         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2471         offset and call the superclass's OpenScope(int) with it.
2472         (SymbolWriter.CloseScope): get the current il
2473         offset and call superclass's CloseScope(int) with it.
2474
2475 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2476
2477         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2478         CS1677 for out and ref as well.
2479
2480         * class.cs (Method.Define): Add error CS1599 detection.
2481         
2482         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2483         
2484         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2485         
2486         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2487         
2488         * support.cs.cs (ModifierDesc): New helper method.
2489
2490 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2491             Abin Thomas  <projectmonokochi@rediffmail.com>
2492             Anoob V E  <projectmonokochi@rediffmail.com>
2493             Harilal P R  <projectmonokochi@rediffmail.com>
2494
2495         Fix #57851, #72718.
2496         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2497         MemberLookup (used for error reporting) actually returns a result.
2498         Fix error report number (122, not 112).
2499
2500 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2501             Anoob V E  <projectmonokochi@rediffmail.com>
2502             Harilal P R  <projectmonokochi@rediffmail.com>
2503
2504         Fix #71134.
2505         * pending.cs (PendingImplementation.GetAbstractMethods):
2506         Find NonPublic members too.
2507
2508 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2509
2510         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2511         Fixed error 217.
2512         
2513         * class.cs (MethodCore.CheckMethodAgainstBase):
2514         Add error 239 report.
2515
2516 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2517
2518         Fix #68955.
2519         * expression.cs (Invocation.IsApplicable): Make public.
2520         (Invocation.IsParamsMethodApplicable): Likewise.
2521         * delegate.cs (Delegate.VerifyApplicability): Don't use
2522         Invocation.VerifyArgumentCompat for parameter applicability
2523         testing.  Use Invocation.IsApplicable and
2524         Invocation.IsParamsMethodApplicable.
2525
2526 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2527
2528         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2529         
2530         * class.cs (Operator.Define): Add error 217 report.
2531         
2532 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2533
2534         * namespace.cs (UsingEntry.Resolve): Undo change below.
2535
2536 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2537
2538         Fix #72756.
2539         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2540         disable the error message when the extended MemberLookup also
2541         fails.
2542         (Expression.MemberLookupFinal): Update.
2543         (SimpleName.DoSimpleNameResolve): Update.
2544         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2545         Don't use MemberLookupFinal.
2546         (New.DoResolve): Update.
2547         (BaseAccess.CommonResolve): Update.
2548
2549 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2550
2551         Fix #72732.
2552         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2553         occured previously, don't resolve again.
2554
2555 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2556
2557         Fix #69949
2558         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2559         argument. Call ResolveAttributeUsage for unresolved.
2560         when types doesn't match ctor arguments.
2561         
2562         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2563         for nested attribute classes.
2564         (Class.attribute_usage): Removed.
2565         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2566         for attribute class.
2567         
2568         * ecore.cs (IsAttribute): Removed.
2569         
2570         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2571         
2572         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2573         now normal types.
2574         (attribute_types): Removed.
2575         (EmitCode): Global attributes are emited as the latest.
2576
2577 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2578
2579         * class.cs (EmitFieldInitializers): Don't emit field initializer
2580         for default values when optimilization is on.
2581         
2582         * constant.cs (Constant.IsDefaultValue): New property.
2583         
2584         * driver.cs: Add /optimize handling.
2585         
2586         * constant.cs,
2587         * ecore.cs,
2588         * literal.cs: Implement new IsDefaultValue property.
2589         
2590         * rootcontext.cs (Optimize): New field, holds /optimize option.
2591
2592 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2593
2594         Fix crasher in re-opened #72347.
2595         * namespace.cs (Namespace.Lookup): Return null if
2596         DeclSpace.DefineType returns null.
2597
2598         Fix #72678.
2599         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2600
2601 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2602
2603         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2604         now returns null if it cannot resolve to an lvalue.
2605         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2606         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2607         returned null.  Remove check for SimpleName.
2608         (EventExpr.DoResolveLValue): New.
2609         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2610         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2611         error from ...
2612         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2613         avoid CS0131 error.
2614         (Unary.ResolveOperator): Move CS0211 check ...
2615         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2616         CS0131 error.
2617         (Unary.DoResolveLValue): Simplify.
2618         (AddressOf.DoResolveLValue): New.
2619         (ArrayAccess.DoResolveLValue): New.
2620
2621 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2622
2623         * attribute.cs (Attribute.Resolve): Add arguments casting for
2624         when types doesn't match ctor arguments.
2625
2626 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2627
2628         Fix parts of #63202.
2629         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2630         lookup of operator in base type.  Ensure that all checks happen
2631         when the operator resolves to an "op_..." method.
2632
2633 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2634
2635         Fix #71992.
2636         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2637         'ignore_cs0104' parameter.  Pass it to ...
2638         (NamespaceEntry.Lookup): ... this.
2639         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2640         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2641         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2642         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2643         Update.  Request that cs0104 errors be ignored.
2644         (ComposedCast.ResolveAsTypeStep): Update.
2645
2646 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2647
2648         Fix #59209.
2649         * expression.cs (Invocation.BetterFunction): Remove support for
2650         comparing virtual functions and their overrides.
2651         (Invocation.IsOverride): New.
2652         (Invocation.OverloadResolve): Don't consider 'override' functions
2653         during candidate selection.  Store them in a lookaside list.
2654         If the selected method is a 'virtual' function, use the list to
2655         find any overrides that are closer to the LHS type.
2656
2657 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2658
2659         * expression.cs (New.DoResolve): Add complex core type reduction.
2660         (New.Constantify): Converts complex core type syntax like 'new int ()'
2661         to simple constant.
2662         
2663 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2664
2665         * decl.cs (EntryType.EntryType): New constructor to create an
2666         updated copy of a cache entry.
2667         (MemberCache.AddMethods): Use it.
2668         (MemberCache.ClearDeclaredOnly): Remove.
2669         (MemberCache.MemberCache): Update.
2670
2671 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2672
2673         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2674         variable.  This one is represents the actual low-level declaration
2675         of the method, as opposed to the semantic level `IsStatic'.   
2676
2677         An anonymous method which is hosted into a static method might be
2678         actually an instance method.  IsStatic would reflect the
2679         container, while MethodIsStatic represents the actual code
2680         generated.
2681
2682         * expression.cs (ParameterReference): Use the new MethodIsStatic
2683         instead of IsStatic.
2684
2685         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2686         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2687         set on the current EmitContext. 
2688
2689         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2690         resolve our casted expression as an LValue.  This triggers the
2691         proper LValue processing that is later required by Assign.
2692
2693         This fixes 72347.
2694
2695         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2696
2697 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2698
2699         C# 2.0 Fixed buffer implementation
2700
2701         * anonymous.cs: Update after RegisterHelperClass renaming.
2702
2703         * attribute.cs (AttributeTester.fixed_buffer_cache):
2704         Cache of external fixed buffers.
2705         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2706         implementation if field is fixed buffer else null.
2707
2708         * class.cs
2709         (TypeContainer.AddField): Accept FieldMember instead of Field.
2710         (FieldBase.IsFieldClsCompliant): Extracted code from
2711         VerifyClsCompliance descendant customization.
2712         (FixedField): New class handles fixed buffer fields.
2713         (FixedFieldExternal): Keeps information about imported fixed
2714         buffer.
2715         (IFixedField): Make access to internal or external fixed buffer
2716         same.
2717
2718         * cs-parser.jay: Add fixed buffer parsing.
2719
2720         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2721         buffer.
2722
2723         * expression.cs (Indirection): Extended implementation to accept
2724         fixed buffer field.
2725         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2726         (ElementAccess.MakePointerAccess): Get type as parameter.
2727         (DoResolve): Add fixed buffer field expression conversion.
2728         (DoResolveLValue): Ditto.
2729         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2730         (ArrayPtr): Derives from FixedBufferPtr.
2731         (ArrayPtr.Emit): Add extra emit for array elements.
2732
2733         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2734
2735         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2736         for compiler generated types.
2737         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2738
2739         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2740         and consume less memory.
2741         (Fixed.Resolve): Add fixed buffer case.
2742
2743         * typemanager.cs (compiler_generated_attr_ctor,
2744         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2745         (HasElementType): Add our own implementation to work on every
2746         runtime.
2747
2748 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2749
2750         * anonymous.cs (CaptureContext): Track whether `this' has been
2751         referenced.   
2752
2753         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2754         only captured `this' if it was implicitly done (instance
2755         methods/variables were used). 
2756
2757         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2758         `this' must be captured.
2759
2760 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2761  
2762         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2763         is null it means that there has been no need to capture anything,
2764         so we just create a sibling.
2765
2766         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2767
2768         Just a partial fix.  The other half is fairly elusive.
2769         
2770 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2771
2772         Fix #52586, cs0121-4.cs.
2773         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2774         and return a hashtable.
2775         (MemberCache.ClearDeclaredOnly): New.
2776         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2777         the method_hash of a base type too.
2778         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2779         type methods.  Overwrite entries with the same MethodHandle so
2780         that the ReflectedType is correct.  The process leaves in base
2781         virtual functions and their overrides as distinct entries.
2782         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2783         matters since it was boxed in a ArrayList before.
2784         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2785         modifier.
2786         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2787         case of a virtual function and its override (choose the overload
2788         as better).
2789         (Invocation.OverloadResolve): Avoid 'override' members during
2790         'applicable_type' calculation.
2791
2792 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2793
2794         Combine two near-redundant caches.
2795         * typemanager.cs (method_params): Rename from method_internal_params.
2796         (TypeManager.GetParameterData): New.  Replace
2797         Invocation.GetParameterData.
2798         (TypeManager.LookupParametersByBuilder): Remove.
2799         * expression.cs (Invocation.method_parameter_cache): Remove.
2800         (Invocation.GetParameterData): Remove.
2801         Update to changes.
2802         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2803         Update to changes.
2804
2805 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2806
2807         Fix #72015.
2808         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2809         TypeManager.multicast_delegate_type is null, resolve it by looking
2810         up "System.MulticastDelegate".
2811         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2812
2813 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2814             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2815             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2816
2817         Fix cs0164.cs.
2818         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2819         (LabeledStatement.AddReference): New.  Set 'referenced'.
2820         (Goto.Resolve): Use it.
2821
2822 2005-02-05  John Luke  <john.luke@gmail.com>
2823
2824         * driver.cs: remove duplicate -doc line in Usage ()
2825
2826 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2827
2828         * location.cs (Location.AddFile): Fix CS2002 error report.
2829
2830 2005-02-02  Martin Baulig  <martin@ximian.com>
2831
2832         * delegate.cs (Delegate.DefineType): Report an internal error if
2833         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2834         details.        
2835
2836 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2837
2838         Fix a crasher in a variant of #31984.
2839         * const.cs (Constant.CheckBase): New override that defers the
2840         new-or-override check in case the base type hasn't been populated
2841         yet.
2842         (Constant.Define): Ensure the new-or-override check is performed.
2843
2844 2005-02-01  Duncan Mak  <duncan@ximian.com>
2845
2846         * const.cs (LookupConstantValue): Check that `ce' is not null
2847         before calling GetValue ().
2848
2849 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2850
2851         Fix test-334.cs (#69519).
2852         * cs-parser.jay (using_alias_directive): Pass in an expression to
2853         NamespaceEntry.UsingAlias.
2854         (using_namespace_directive): Pass in an expression to
2855         NamespaceEntry.Using.
2856         (namespace_name): Don't flatten to a string.
2857         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2858         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2859         ResolveAsTypeStep.
2860         (NamespaceEntry.UsingEntry): Likewise.
2861         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2862         changes.
2863         (NamespaceEntry.LookupForUsing): Remove.
2864         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2865         names.
2866         (NamespaceEntry.Lookup): Remove support for dotted names.
2867
2868 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2869
2870         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2871         split into two.
2872         (NamespaceEntry.ImplicitParent): Compute on demand.
2873         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2874         parallels the current.
2875         (NamespaceEntry.LookupForUsing): Use it.
2876         (NamespaceEntry.Lookup): If the current namespace-entry is
2877         implicit, don't search aliases and using tables.
2878
2879 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2880
2881         Fix #31984.
2882         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2883         BaseCache here.
2884         (TypeContainer.BaseCache): Compute on demand.
2885         (TypeContainer.FindMembers): Define constants and types if they're
2886         not already created.
2887         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2888         check.
2889         * const.cs (Constant.Define): Make idempotent.
2890
2891 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2892
2893         * pending.cs: Produce better code (no nops produced by using Ldarg
2894         + value).
2895         
2896         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2897         i - 1' it should be arg + 1.
2898
2899         Fixes bug #71819.
2900
2901 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2902
2903         * attribute.cs (Attribute.CheckAttributeType): Make private
2904         non-virtual.
2905         (Attribute.ResolveType): Make virtual.
2906         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2907         handling of RootContext.Tree.Types.
2908
2909 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2910
2911         Update attribute-handling to use the SimpleName/MemberAccess
2912         mechanisms.
2913         * cs-parser.jay (attribute): Pass in an expression to the
2914         constructors of Attribute and GlobalAttribute.
2915         * attribute.cs (Attribute): Take an expression for the name.
2916         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2917         passed in attribute name expression.
2918         (Attribute.CheckAttributeType): Use it.
2919         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2920         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2921         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2922         argument to prevent error messages if the lookup fails.
2923
2924 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2925
2926         * expression.cs (Indirection): Implemented IVariable interface
2927         to support indirection in AddressOf operator.
2928         (PointerArithmetic.Emit): Add optimalization for case where
2929         result can be precomputed.
2930
2931 2005-01-26  Martin Baulig  <martin@ximian.com>
2932
2933         * class.cs (TypeContainer.AttributeTargets): Return the correct
2934         AttributeTargets depending on our `Kind' instead of throwing an
2935         exception; fixes #71632.
2936
2937 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2938
2939         Fix #71257
2940         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2941         constant members.
2942
2943 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2944
2945         Fix #71602.
2946         * expression.cs (MemberAccess.DoResolve): Don't complain with
2947         cs0572 when the LHS of a member access has identical name and type
2948         name.
2949
2950 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2951
2952         Fix #71651, #71675
2953         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2954         CreatePermission.
2955         Create custom PermissionSet only for PermissionSetAttribute.
2956
2957 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2958
2959         Fix #71649
2960         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2961         delegates in static class.
2962
2963 2005-01-24  Martin Baulig  <martin@ximian.com>
2964
2965         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2966         merging an implicit block, just use its reachability.
2967
2968         * statement.cs (Block.Resolve): Make the unreachable code check
2969         work wrt. implicit blocks; see test-337 from #63842.
2970
2971 2005-01-21  Alp Toker  <alp@atoker.com>
2972  
2973         * cs-parser.jay: destructor_declaration's container is PartialContainer
2974         not Class when partial types are used, so use Kind prop instead of
2975         'is'.
2976         
2977 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2978
2979         * cs-parser.jay: Improve error reporting when an interface
2980         declares new types.
2981
2982 2005-01-20  Dick Porter  <dick@ximian.com>
2983
2984         * support.cs: SeekableStreamReader fix from Sandor Dobos
2985         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2986         chars are read.  Fixes bug 70369.
2987
2988 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2989
2990         * cs-parser.jay (catch_clause): Simplify current_block handling
2991         somewhat.
2992
2993 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2994
2995         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2996         code with ImplicitStandardConversion to handle the implicit
2997         conversion of method groups into valid delegate invocations. 
2998
2999         The problem is that in parameter handling we were using this code
3000         path.  Fixes bug #64698
3001
3002 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3003
3004         * cs-parser.jay: Fix several infelicities.
3005         - Avoid assigning to the parser value stack.  Code like 
3006           '$3 = null' is unclean.  Synthesize a value for the code block
3007           instead. 
3008         - Avoid using oob_stack for storing location information.  Use ...
3009         (_mark_): ... this.  New (empty) rule.  Saves the current location
3010         in $$.
3011         (foreach_statement): Avoid using oob_stack for current_block
3012         handling.  Use technique used in for_statement and
3013         using_statement.  Synthesize a value for the code block to store
3014         additional intermediate information.
3015
3016 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3017
3018         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3019         of a different type is only allowed to private fields of a
3020         containing type, not on fields of a base class.
3021
3022         See test-174.cs and error cs0122-9.cs
3023
3024 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3025
3026         Fix test-335.cs (bug #58126).
3027         * cs-parser.jay (argument): Split out non-expression parts of the
3028         rule into 'non_simple_argument'.
3029         (invocation_expression): Support parenthesized invocations with
3030         multiple arguments, and with single non-simple arguments.
3031
3032 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3033
3034         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3035         places.
3036
3037 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3038
3039         Fix cs0038-1.cs, cs1640-6.cs.
3040         * ecore.cs (Expression.Resolve): Remove special-case for
3041         SimpleName in error-handling.
3042         (Expression.almostMatchedMembers): Relax access permission to
3043         protected.
3044         (Expression.MemberLookupFailed): Handle duplicates in
3045         almostMatchedMembers list.
3046         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3047         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3048         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3049         overload if the passed in MemberInfo is a MethodBase.
3050
3051 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3052
3053         Fix #70749
3054         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3055         for non-CAS & merge permission sets properly.
3056
3057 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3058
3059         Improve standard-compliance of simple name and member access 
3060         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3061         * ecore.cs (FullNamedExpression): New abstract base class 
3062         for Namespaces and TypeExpressions.
3063         (ResolveFlags.SimpleName): Remove.
3064         (SimpleName): Remove support for dotted names.
3065         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3066         DeclSpace.FindType and DeclSpace.LookupType.
3067         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3068         (Expression.ExprClassName): Make member function.
3069         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3070         a namespace.  Remove creation of dotted "SimpleName"s.
3071         (MemberAccess.DoResolve): Likewise.
3072         * decl.cs (DeclSpace.Cache): Make private.
3073         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3074         (DeclSpace.FindType): Update.
3075         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3076         FullNamedExpression.
3077         * namespace.cs (Namespace): Derive from FullNamedExpression
3078         so that it can be part of expression resolution.
3079         (Namespace.Lookup): Return an FullNamedExpression.
3080         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3081         namespace.
3082         * rootcontext.cs (NamespaceLookup): Remove.
3083         (LookupType): Move to DeclSpace.
3084         * attribute.cs (CheckAttributeType): Update.
3085         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3086         (FindDocumentedTypeNonArray): Likewise.
3087
3088 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3089
3090         Fix cs0509.cs, cs1632.cs.
3091         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3092         is the same as IsInterface.
3093         (TypeContainer.GetClassBases): Likewise.
3094         * statement.cs (LabeledStatement.ig): New field.
3095         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3096         label.
3097         (LabeledStatement.DoEmit): Check that the label was created with
3098         the same ILGenerator.
3099
3100 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3101
3102         Fix #71058
3103         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3104         accessors to its properties.
3105
3106         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3107         from accessors to property.
3108         
3109 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3110
3111         Fix #70722
3112         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3113         only for overrides.
3114         
3115 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3116
3117         * attribute.cs: Check for null and empty strings.  
3118
3119         I have lost another battle to Paolo.
3120
3121 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3122
3123         Fix #70942
3124         * class.cs (PropertyMethod): Set Parent field in ctors.
3125         (SetMethod.InternalParameters): Add unsafe switch hack.
3126         Override MarkForDuplicationCheck where it is appropriate.
3127
3128         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3129         It says whether container allows members with the same name.
3130         Base default is no.
3131         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3132         Removed is_method parameter.
3133
3134 2005-01-06  Duncan Mak  <duncan@ximian.com>
3135
3136         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3137         because the previous change led to incorrect reporting of CS1032
3138         ("Cannot define/undefine preprocessor symbols after first token in
3139         file"). Instead of using `tokens_seen' as the only flag that
3140         triggers CS1040, introduce `comments_seen'. This new flag is used
3141         to signify having seen comments on the current line, so it is
3142         unset after a newline.
3143
3144 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3145
3146         * doc.cs : When searching for a type, find nested type too.
3147           This fixes bug #71040.
3148
3149 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3150
3151         * doc.cs :
3152           - Warn missing member comment on those classes which also does not
3153             have doc comments. Fixed bug #71041.
3154           - Don't warn missing doc comment on default constructor.
3155             Fixed bug #71042.
3156
3157 2005-01-06  Duncan Mak  <duncan@ximian.com>
3158
3159         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3160         comments, set `tokens_seen' to true. This allows us to detect
3161         misplaced preprocessor directives (i.e. not at the beginning of
3162         the a line, nor after whitespaces). In that case, report error
3163         CS1040. This fixes bug #56460.
3164
3165         * cs-parser.jay (interface_member_declaration): Add checks for
3166         IsExplicitImpl, and report CS0541 error if an interface member is
3167         defined as an explicit interface declaration.
3168
3169 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3170
3171         Fix #70817
3172         * class.cs (PropertyMethod): Set Parent field in ctors.
3173         (SetMethod.InternalParameters): Add unsafe switch hack.
3174         
3175         * decl.cs (MemberCore.Parent): Cannot be readonly.
3176
3177 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3178
3179         * decl.cs (DeclSpace.ResolveType): Remove.
3180         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3181         Merge in code from ...
3182         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3183         * class.cs, enum.cs: Update to changes.
3184
3185 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3186
3187         * anonymous.cs: Ensure that we init the scope of our parent if it
3188         has not been initialized yet.
3189
3190 2004-12-30  Duncan Mak  <duncan@ximian.com>
3191
3192         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3193         if field.FieldBuilder is null. Fixes #70758.
3194
3195         * convert.cs: Fixed some typos and updated some of the comments.
3196         (ImplicitStandardConversionExists):
3197         (TryImplicitIntConversion): If `target_type' is an interface and
3198         the type of `ic' implements this interface, return true or a new
3199         BoxedCast instead of null. This fixes #70468.
3200
3201 2004-12-29  Duncan Mak  <duncan@ximian.com>
3202
3203         * expression.cs (Argument.Emit): Check that Expr is
3204         IMemoryLocation before casting to it, and report CS1510 otherwise.
3205
3206         This fixes #70402.
3207
3208 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3209
3210         * statement.cs (Block.ThisVariable): remove the recursion here, to
3211         make the --profile more sane.
3212
3213 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3214
3215         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3216         assembly, by JB Evain.
3217
3218 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3219
3220         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3221           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3222         "parent" refers to enclosing type/class.  "base" refers to superclass.
3223
3224 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3225
3226         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3227         Ensure that we only have GlobalAttributes.
3228         * attribute.cs (Attribute.Emit): Make non-virtual.
3229         (GlobalAttribute.Emit): Remove.
3230         (Attribute.Resolve): Make virtual.
3231         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3232         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3233         the argument. Don't create one.
3234         (Attribute.GetObsoleteAttribute): Likewise.
3235         (Attribute.GetClsCompliantAttributeValue): Likewise.
3236         * class.cs, decl.cs: Update to changes.
3237
3238 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3239
3240         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3241         
3242         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3243         
3244         * statement.cs (Foreach.Resolve): Add error 186 report.
3245
3246 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3247
3248         * expression.cs (Conditional.DoResolve): Add warning 429.
3249         
3250         * statement.cs (If.Resolve): Add warning 665.
3251
3252 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3253
3254         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3255         except when in the parser, and in GlobalAttribute.
3256         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3257         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3258         RootContext.Tree.Types.NamespaceEntry once work is done.
3259         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3260         and resets RootContext.Tree.Types.NamespaceEntry.
3261
3262 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3263
3264         * cs-parser.jay: Don't create a block for every variable.
3265
3266 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3267
3268         * location.cs: Provide extra information.
3269
3270         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3271         variables from the captured environment, it is the ldarg_0.
3272
3273 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3274
3275         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3276         find a conclusion.
3277         
3278         * class.cs: Changed warning level for 169 to avoid developer
3279         displeasure from warning flooding. It will be changed back when they
3280         fix most of current BCL warnings.
3281         
3282         * RootContext.cs: Pushed default WarningLevel to 3.
3283         
3284         * statement.cs: Removed unused variable.
3285
3286 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3287
3288         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3289         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3290         Add error 502 report.
3291         (StaticClass.DefineType): Add error 441 report.
3292         (Class.AllowedModifiersProp): New virtual property as temporary
3293         extension to AllowedModifiers.
3294         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3295         to share implementation with StaticClass and don't call virtual
3296         methods from ctor.
3297         
3298         * driver.cs (MainDriver): Add error 1558 test.
3299
3300         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3301         report. Moved error 36 test here.
3302
3303         * statement.cs (Throw.Resolve): Add error 724 report.
3304
3305         * typemanager.cs: Add out_attribute_type core type.
3306         
3307 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3308
3309         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3310         3018 report.
3311         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3312
3313         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3314         3017 report.
3315         
3316         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3317
3318         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3319         Add error 3023 report.
3320         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3321
3322         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3323         implementation.
3324
3325 2004-12-12  John Luke  <john.luke@gmail.com>
3326
3327         * driver.cs (AddArgs): take -- into account when
3328         adding arguments, fixes bug 65710 
3329
3330 2004-12-12  Martin Baulig  <martin@ximian.com>
3331
3332         * expression.cs (Unary.TryReduceNegative): Added support for
3333         SByteConstant and ByteConstant.
3334         (Unary.Reduce): Check error values from TryReduceNegative().
3335
3336 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3337
3338         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3339         and report exception as error 182.
3340
3341 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3342
3343         * driver.cs (Main): Fix message when there are warnings.
3344
3345 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3346
3347         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3348
3349 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3350
3351         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3352         Reduced number of warnings.
3353         
3354         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3355
3356 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3357
3358         * driver.cs: Removed message.
3359
3360         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3361
3362 2004-12-08    <vargaz@freemail.hu>
3363
3364         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3365
3366 2004-12-08  Martin Baulig  <martin@ximian.com>
3367
3368         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3369         instead of a CS3002 for properties and indexer.
3370
3371 2004-12-08  Martin Baulig  <martin@ximian.com>
3372
3373         * decl.cs (MemberName.ToString): Make this work again.
3374
3375 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3376
3377         * attribute.cs (Resolve): Add error 591 detection.
3378
3379         * class.cs (FieldMember.Define): Add error 1547 detection.
3380         (Indexer.Define): Add error 620 detection.
3381         (Operator.Define): Add error 590 detection.
3382
3383         * ecore.cs: Missing argument for error 79.
3384
3385         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3386         detection.
3387
3388 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3389
3390         Fix #70106
3391         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3392         only.
3393
3394 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3395
3396         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3397           Some operator comments were suppressed.
3398         * doc.cs : Implicit/explicit operator name in doc comments are like
3399           "op_Explicit(type)~returnType", so added suffix handling.
3400
3401 2004-12-07  Martin Baulig  <martin@ximian.com>
3402
3403         * decl.cs
3404         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3405         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3406         (DeclSpace.ec): New protected field; store the EmitContext here.
3407         (DeclSpace.EmitContext): New public property; moved here from
3408         `TypeContainer'.
3409         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3410         EmitContext.
3411
3412         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3413         (Enum.Emit): Don't create a new EmitContext.
3414
3415         * delegate.cs (Delegate.DefineType): Always create the
3416         EmitContext.
3417
3418         * iterators.cs (Iterators.DefineIterator): Create a new
3419         EmitContext and store it in `ec'.
3420
3421 2004-08-24  Martin Baulig  <martin@ximian.com>
3422
3423         * typemanager.cs
3424         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3425         this for accessibility checks.
3426         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3427         IsNestedFamilyAccessible.
3428         (TypeManager.IsSubclassOf): New method, do what the name actually
3429         says.   
3430
3431 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3432
3433         Fix crash on cs0657-17.cs.
3434         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3435         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3436         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3437         the case where the NamespaceEntry gets overwritten.
3438
3439 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3440
3441         Fixed #69195, #56821
3442         * ecore.cs (ResolveBoolean): Tiny refactoring.
3443
3444         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3445         of right expression resolving when left is false constant and
3446         operator is LogicalAnd OR true constant and operator is LogicalOr.
3447
3448         * statement.cs (ResolveUnreachable): Always reports warning.
3449
3450 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3451
3452         * class.cs: Distinguish between 1721 and 1722 (just a little help
3453         for the programmer).
3454
3455 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3456
3457         * delegate.cs: Only allow this on new versions of the language. 
3458
3459 2004-12-02  Duncan Mak  <duncan@ximian.com>
3460
3461         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3462         Expression class.
3463         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3464         here as a static method. Take an additional bool out parameter
3465         `must_do_cs1540_check' for signaling to InstanceResolve.
3466         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3467         member field from PropertyExpr class and made it an argument of
3468         the method instead.
3469         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3470         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3471         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3472         and `remove_accessor' as well as InstanceResolve: report CS0122
3473         where applicable.
3474
3475         Fixes #70129.
3476
3477 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3478
3479         Fix test-327.cs, test-328.cs, and put in early infrastructure
3480         for eventually fixing #52697.
3481         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3482         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3483         from other methods.
3484         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3485         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3486         (VerifyUsing, error246): Update.
3487         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3488         'NamespaceEntry.LookupNamespaceOrType'.
3489
3490 2004-12-03  Martin Baulig  <martin@ximian.com>
3491
3492         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3493         method as our child, call AnonymousMethod.Compatible() on it.
3494
3495 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3496
3497         Disable XML documentation support in 'basic' profile.
3498         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3499         Redirect XmlElement to System.Object.
3500         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3501         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3502         * mcs.exe.sources: Add doc-bootstrap.cs.
3503         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3504         of doc.cs.
3505
3506 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3507
3508         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3509           comments are allowed.
3510
3511 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3512
3513         * delegate.cs: Add checks for subtypes in paramaters and return values
3514         in VerifyMethod () to add support for Covariance/Contravariance
3515         in delegates.
3516         
3517 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3518
3519         * report.cs: Remove extra closing parenthesis.
3520
3521         * convert.cs (Error_CannotImplicitConversion): If the name of the
3522         types are the same, provide some extra information.
3523
3524         * class.cs (FieldBase): Use an unused bit field from the field to
3525         encode the `has_offset' property from the FieldMember.  This saves
3526         a couple of Ks on bootstrap compilation.
3527
3528         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3529         method as our child, return the AnonymousMethod resolved
3530         expression.
3531
3532         * expression.cs (New.DoResolve): Allow return values from
3533         NewDelegate to also include AnonymousMethods.
3534
3535         Fixes #70150.
3536
3537 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3538
3539         Fix bug #70102
3540         * attribute.cs (Resolve): Improved implementation of params
3541         attribute arguments.
3542
3543         * support.cs (ParameterData): Add HasParams to be faster.
3544
3545 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3546
3547         all things are for /doc support:
3548
3549         * doc.cs: new file that supports XML documentation generation.
3550         * mcs.exe.sources: added doc.cs.
3551         * driver.cs:
3552           Handle /doc command line option.
3553           Report error 2006 instead of 5 for missing file name for /doc.
3554           Generate XML documentation when required, after type resolution.
3555         * cs-tokenizer.cs:
3556           Added support for picking up documentation (/// and /** ... */),
3557           including a new XmlCommentState enumeration.
3558         * cs-parser.jay:
3559           Added lines to fill Documentation element for field, constant,
3560           property, indexer, method, constructor, destructor, operator, event
3561           and class, struct, interface, delegate, enum.
3562           Added lines to warn incorrect comment.
3563         * rootcontext.cs :
3564           Added Documentation field (passed only when /doc was specified).
3565         * decl.cs:
3566           Added DocComment, DocCommentHeader, GenerateDocComment() and
3567           OnGenerateDocComment() and some supporting private members for
3568           /doc feature to MemberCore.
3569         * class.cs:
3570           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3571         * delegate.cs:
3572           Added overriden DocCommentHeader.
3573         * enum.cs:
3574           Added overriden DocCommentHeader and GenerateDocComment().
3575
3576 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3577
3578         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3579         unwrapping the enumeration values, chain to
3580         DoConstantNumericPromotions again, so we can promote things to the
3581         fundamental types (takes care of enums that are bytes, sbytes).
3582
3583         Fixes bug #62054.
3584
3585 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3586
3587         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3588         Fix long-standing bug in type-lookup.  Use FindType instead of
3589         LookupType when ec.ResolvingTypeTree.
3590         (Attribute.ResolveType, Attribute.Resolve)
3591         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3592         Update to changes.
3593         (Attributes.Search): Remove internal version.  Update.
3594         (Attributes.SearchMulti): Update.
3595         (Attributes.GetClsCompliantAttribute): Remove.
3596         (Attributes.GetIndexerNameAttribute): Remove.
3597         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3598         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3599         * class.cs (Indexer.Define): Likewise.
3600
3601 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3602
3603         Fix bug #68790
3604         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3605         MarshallByReference members access.
3606
3607         * expression.cs: Use CheckMarshallByRefAccess;
3608         Better error CS0197 message.
3609
3610         * report.cs: Print whole related error message.
3611
3612 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3613
3614         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3615         the current directory to help debugging.
3616
3617 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3618
3619         * class (GetClassBases): Better error 60 report.
3620         (EventProperty): Disabled warning 67 detection.
3621
3622 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3623
3624         Fix bug #60324
3625         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3626
3627         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3628         precise values.
3629
3630 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3631
3632         Fix bug #49488
3633         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3634
3635         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3636
3637 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3638
3639         * attribute.cs (Attribute.Resolve): Refine error reporting and
3640         report a cs0117 if the identifier does not exist, to distinguish
3641         from 0617 which is a miss-use of the actual identifier.
3642
3643         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3644         between cs0070 and cs0079.
3645
3646         * class.cs (MemberBase.DoDefine): When reporting a wrong
3647         accessibility level, we use MethodCore to compare instead of
3648         Method (this was a regression in some refactoring effort).
3649
3650         So now we correctly report cs0056 again.
3651
3652         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3653         testing the target_type (which was known to be object_type) and
3654         not the source type (which is anonymous_method).
3655
3656         Fixed reporting of error cs1660.
3657
3658         * expression.cs (UserCast.Source): Expose the underlying cast.
3659
3660         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3661         allowed types to find a match to int32 first (most common).
3662
3663         In addition, it ignores any ImplicitUserConversions that did an
3664         internal implicit conversion (as the switch statement allows only
3665         one integral conversion to exist).
3666
3667         * class.cs (PartialContainer.Create): rename `name' to
3668         `member_name' for clarity.  Then replace the string calls with a
3669         call to MemberName.GetPartialName, as now using
3670         MemberName.ToString is an error (this is due to the side effects
3671         it had, that were fixed in the past).
3672
3673         This will restore the error reporting on a number of partial class
3674         errors that were missusing this (and getting an exception as a
3675         results, which is now just a plain textual warning, because
3676         yyparse debug output would crash otherwise).
3677
3678 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3679
3680         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3681
3682 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3683
3684         * rootcontext.cs (LookupType): Make sure to cache lookups that
3685         don't give us a negative result. This saves about 5% of corlib
3686         compilation time.
3687
3688 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3689
3690         * report.cs (AbstractMessage.Print): messages are sent to stderr
3691
3692         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3693         non-interface in the list of interfaces (at this point, either
3694         parent was properly set, or a base class is being listed in the
3695         interfaces section).
3696
3697         This flags error 1722, and resolves the crash from bug 69259.
3698
3699 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3700
3701         * statement.cs (Using.EmitExpressionFinally): make this work right
3702         for valuetypes. Fixes 69926.
3703
3704 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3705
3706         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3707         converted to an enum" here, before we try to change the underlying
3708         type.  This code exists, but it is a different code path than the
3709         one used while encoding constants.
3710
3711         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3712         old bug: when converting from the null literal to a pointer,
3713         return an EmptyCast, not the NullLiteral.
3714
3715         This fixes #69921, the recent null_type changes probably made this
3716         bug more prominent.
3717
3718         (ImplicitReferenceConversionExists): In addition, resynchronized
3719         the code here, so it matches the same code in
3720         ImplicitReferenceConversionExists for the `from any class-type S
3721         to any interface-type T'.
3722         
3723
3724 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3725
3726         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3727
3728 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3729
3730         * cs-parser.jay: Use verbosity accordingly. 
3731
3732 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3733
3734         * expression.cs (Unary.ResolveOperator): Do not report warning;
3735         AddressOf reads from variable.
3736         
3737         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3738
3739 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3740
3741         Fix bug #69462
3742
3743         * attribute.cs (Attributable): Removed CheckTargets.
3744         (Attributes.Emit): Explicit attribute targets are tested here.
3745
3746         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3747         not enabled for interfaces.
3748
3749         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3750         (GetAssemblyName): Ouch next bug there.
3751
3752 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3753
3754         * expression.cs: Error 275 added.
3755         
3756 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3757
3758         Fix bug #69177 (Implemented decimal constant support)
3759
3760         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3761         (BinaryFold): Add DecimalConstant.
3762
3763         * const.cs (Define): Decimal constant 
3764         (is not constant.
3765         (ChangeType): Add decimal type handling.
3766         (LookupConstantValue): Don't set value for decimal type but
3767         emit DecimalConstantAttribute. Needed for constant optimization.
3768
3769         * constant.cs (ToDecimal): New method.
3770         (ConvertToDecimal): New method.
3771         (IntConstant): Implemented ConvertToDecimal.
3772         (DecimalConstant.Emit): Emit optimized version for decimals in
3773         int range.
3774
3775         * expression.cs (ResolveOperator): Changed order of constant
3776         reduction to work correctly with native types which have
3777         overloaded operators.
3778         (ResolveMemberAccess): Extract constant value from attribute
3779         for decimal type.
3780
3781         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3782
3783         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3784         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3785         (ChangeType): Decimal is special.
3786         (TypeToCoreType): Add decimal type.
3787
3788 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3789
3790         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3791         decimal types.
3792
3793 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3794
3795         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3796         test cs1667-5.cs.
3797
3798 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3799
3800         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3801
3802         * pending.cs (PendingImplementation): Grab only interfaces.
3803
3804 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3805
3806         * statement.cs (ForeachHelperMethods): Add location member and
3807         error 202 detection.
3808
3809 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3810
3811         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3812         automatically handled by executable.make.
3813         (PROGRAM): Make profile-specific.
3814
3815 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3816
3817         * expression.cs (DoResolveBase): Fixed wrong warning for out
3818         variables.
3819
3820 2004-11-18  Martin Baulig  <martin@ximian.com>
3821
3822         Merged latest changes into gmcs.  Please keep this comment in
3823         here, it makes it easier for me to see what changed in MCS since
3824         the last time I merged.
3825
3826 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3827
3828         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3829         (TypeHandle.GetMemberCache): New.
3830         (TypeHandle.TypeHandle): Update.
3831         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3832         (TypeManager.LookupParentInterfacesCache):
3833         Rename from LookupInterfaceCache.  Optimize slightly.
3834         (TypeManager.MemberLookup_FindMembers): Update.
3835         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3836         multi-type variant.
3837         (AddCacheContents): Rename from AddHashtable.
3838         * class.cs (TypeContainer.parent_container): Remove.
3839         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3840         (TypeContainer.DoDefineMembers): Don't initialize it.
3841         Update to name changes.
3842         
3843 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3844
3845         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3846         that factors the code to check access modifiers on override.  
3847
3848         (PropertyBase): Use the code here.
3849
3850         Patch from Lluis S'anchez, fixes bug #69361.
3851
3852 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3853
3854         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3855         routine that is used to report the use of a captured variable
3856         whose address has been taken.
3857
3858         There are two checks: one when variables are being captured and
3859         the other check is when the address of a variable is taken. 
3860         
3861         (because an anonymous methods might be resolved before *or* after
3862         the address has been taken) and 
3863
3864         * expression.cs (Conditional.DoResolve): Remove the special
3865         casing that Martin added to trueExpr and falseExpr being both
3866         NullLiteral.  We get the right behavior now just by introducing
3867         the null_type into the compiler. 
3868
3869         * convert.cs (ExplicitConversion): Change the code to use
3870         null_type instead of testing `expr is NullLiteral'.
3871         (ImplicitConversionStandard): use null_type too.
3872         (ImplicitReferenceConversionExists): use null_type too.
3873         (ImplicitReferenceConversion): use null_type too.
3874
3875         * literal.cs: The type of `NullLiteral' is now null_type instead
3876         of object_type. 
3877         (Resolve): Set the type here.
3878
3879         * typemanager.cs: Introduce null_type.
3880
3881 2004-11-17  Martin Baulig  <martin@ximian.com>
3882
3883         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3884         direction, like FindMembers() does.  Fixes #69546, testcase is in
3885         test-315.cs.    
3886
3887 2004-11-16  Martin Baulig  <martin@ximian.com>
3888
3889         This is based on a patch from Marek Safar, see bug #69082.
3890         Fixes bugs #63705 and #67130.
3891
3892         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3893         method; create a MemberCache for an interface type and cache the
3894         result.
3895
3896         * decl.cs (IMemberContainer.ParentContainer): Removed.
3897         (IMemberContainer.ParentCache): New property.
3898         (MemberCache.SetupCacheForInterface): Removed.
3899         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3900         to create a cache for an interface's "parent".
3901
3902         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3903         interfaces too.
3904
3905 2004-11-16  Martin Baulig  <martin@ximian.com>
3906
3907         Merged back from gmcs; these changes already went into gmcs a
3908         couple of weeks ago.
3909
3910         * typemanager.cs
3911         (TypeManager.AddUserType): Removed the `ifaces' argument.
3912         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3913         `TypeExpr []'.
3914         (TypeManager.AddUserInterface): Removed.
3915         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3916         `TypeExpr []'.
3917         (TypeManager.GetInterfaces): Likewise.
3918         (TypeManager.GetExplicitInterfaces): Likewise.
3919
3920         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3921
3922         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3923         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3924
3925 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3926
3927         * statement.cs: Avoid adding bools to a hashtable.
3928
3929 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3930
3931         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3932         calling an unsafe method from a safe location.
3933
3934 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3935
3936         Fix #69167
3937         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3938
3939 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3940
3941         * namespace.cs (VerifyUsing): use GetPartialName instead of
3942         ToString. 
3943
3944 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3945
3946         * statement.cs (Return.Resolve): Fix regression in typo: if
3947         `in_exc', we have to request a NeedReturnLabel, this was a typo
3948         introduced in the anonymous method check-in.  Fixes #69131.
3949
3950         * Indexers were using the ShortName when defining themselves,
3951         causing a regression in the compiler bootstrap when applying the
3952         patch from 2004-11-02 (first part), now they use their full name
3953         and the bug is gone.
3954
3955 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3956
3957         * driver.cs: Strip the path from the names of embedded resources. Fixes
3958         #68519.
3959
3960 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3961
3962         Fix error message regression: cs0104-2.cs.
3963         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3964         (AliasEntry.Resolve): Update.
3965         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3966         'silent' flag.
3967         (RootContext.LookupType): Update.
3968
3969 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3970
3971         * cs-parser.jay: Add support for handling accessor modifiers
3972         * class: Add support port accessor modifiers and error checking,
3973         define PropertyMethod.Define as virtual (not abstract anymore)
3974         * ecore.cs: Add checking for proeprties access with access modifiers
3975         * iterators.cs: Modify Accessor constructor call based in the modified
3976         constructor
3977 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3978
3979         * expression.cs (StringConcat): Handle being called twice,
3980         as when we have a concat in a field init with more than two
3981         ctors in the class
3982
3983 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3984
3985         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3986         special case explicit implementations, we should always produce
3987         the .property or .event declaration.
3988         
3989         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3990         since it will not return correct data if people use this
3991         unresolved in the presence of using statements (see test-313).
3992
3993         * class.cs (MethodData.Define): If we are an explicit interface
3994         implementation, set the method name to the full name of the
3995         interface plus the name of the method.  
3996
3997         Notice that using the method.MethodName.GetFullName() does not
3998         work, as it will only contain the name as declared on the source
3999         file (it can be a shorthand in the presence of using statements)
4000         and not the fully qualifed type name, for example:
4001
4002         using System;
4003
4004         class D : ICloneable {
4005                 object ICloneable.Clone ()  {
4006                 }
4007         }
4008
4009         Would produce a method called `ICloneable.Clone' instead of
4010         `System.ICloneable.Clone'.
4011
4012         * namespace.cs (Alias.Resolve): Use GetPartialName.
4013         
4014 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4015
4016         * cs-parser.jay: Add error 1055 report.
4017
4018 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4019
4020         * assign.cs (Assign.DoResolve): Only do the transform of
4021         assignment into a New if the types are compatible, if not, fall
4022         through and let the implicit code deal with the errors and with
4023         the necessary conversions. 
4024
4025 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4026
4027         * cs-parser.jay: Add error 1031 report.
4028
4029         * cs-tokenizer.cs: Add location for error 1038.
4030
4031 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4032
4033         * cs-parser.jay: Add error 1016 report.
4034
4035 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4036
4037         * cs-parser.jay: Add errors 1575,1611 report.
4038
4039 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4040
4041         * cs-parser.jay: Add error 1001 report.
4042
4043 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4044
4045         Fix #68850
4046         * attribute.cs (GetMarshal): Add method argument for
4047         caller identification.
4048
4049         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4050         agument for GetMarshal and RuntimeMissingSupport.
4051
4052 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4053
4054         * attribute.cs (ExtractSecurityPermissionSet): Removed
4055         TypeManager.code_access_permission_type.
4056
4057         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4058
4059 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4060
4061         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4062         for obsolete use of a variable here.   Fixes regression on errors
4063         cs0619-25 and cs0619-26.
4064
4065 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4066
4067         Fix #62358, implemented security attribute encoding.
4068
4069         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4070         Tests permitted SecurityAction for assembly or other types.
4071         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4072         data from SecurityPermissionAttribute to PermisionSet class.
4073
4074         * class.cs (ApplyAttributeBuilder): Added special handling
4075         for System.Security.Permissions.SecurityAttribute based types.
4076
4077         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4078         special handling for System.Security.Permissions.SecurityAttribute
4079         based types.
4080
4081         * enum.cs (ApplyAttributeBuilder): Added special handling
4082         for System.Security.Permissions.SecurityAttribute based types.
4083
4084         * parameter.cs (ApplyAttributeBuilder): Added special handling
4085         for System.Security.Permissions.SecurityAttribute based types.
4086
4087         * rootcontext.cs: Next 2 core types.
4088
4089         * typemanager.cs (TypeManager.security_permission_attr_type):
4090         Built in type for the SecurityPermission Attribute.
4091         (code_access_permission_type): Build in type.
4092
4093 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4094
4095         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4096         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4097         all of this information into
4098         EmitContext.EmitCapturedVariableInstance.
4099         
4100         * codegen.cs (EmitCapturedVariableInstance): move here the
4101         funcionality of emitting an ldarg.0 in the presence of a
4102         remapping.   This centralizes the instance emit code.
4103
4104         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4105         then emit a load of this: it means that we have reached the
4106         topmost ScopeInfo: the one that contains the pointer to the
4107         instance of the class hosting the anonymous method.
4108
4109         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4110         captures to the topmost CaptureContext.
4111
4112 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4113
4114         * expression.cs (LocalVariableReference): Move the knowledge about
4115         the iterators into codegen's EmitCapturedVariableInstance.
4116
4117 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4118
4119         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4120         all code paths return a value from an anonymous method (it is the
4121         same as the 161 error, but for anonymous methods).
4122
4123 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4124
4125         The introduction of anonymous methods in the compiler changed
4126         various ways of doing things in the compiler.  The most
4127         significant one is the hard split between the resolution phase
4128         and the emission phases of the compiler.
4129
4130         For instance, routines that referenced local variables no
4131         longer can safely create temporary variables during the
4132         resolution phase: they must do so from the emission phase,
4133         since the variable might have been "captured", hence access to
4134         it can not be done with the local-variable operations from the runtime.
4135         
4136         * statement.cs 
4137
4138         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4139         is a toplevel block.
4140
4141         (ToplevelBlock): A new kind of Block, these are the blocks that
4142         are created by the parser for all toplevel method bodies.  These
4143         include methods, accessors and anonymous methods.
4144
4145         These contain some extra information not found in regular blocks:
4146         A pointer to an optional CaptureContext (for tracking captured
4147         local variables and parameters).  A pointer to the parent
4148         ToplevelBlock.
4149         
4150         (Return.Resolve): Catch missmatches when returning a value from an
4151         anonymous method (error 1662).
4152         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4153         phase.
4154
4155         (Break.Resolve): ditto.
4156
4157         (SwitchLabel): instead of defining the labels during the
4158         resolution phase, we now turned the public ILLabel and ILLabelCode
4159         labels into methods called GetILLabelCode() and GetILLabel() that
4160         only define the label during the Emit phase.
4161
4162         (GotoCase): Track the SwitchLabel instead of the computed label
4163         (its contained therein).  Emit the code by using
4164         SwitchLabel.GetILLabelCode ().
4165
4166         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4167         whether the Local has been captured or not.
4168
4169         (LocalInfo.IsCaptured): New property, used to tell whether the
4170         local has been captured.
4171         
4172         * anonymous.cs: Vastly updated to contain the anonymous method
4173         support.
4174
4175         The main classes here are: CaptureContext which tracks any
4176         captured information for a toplevel block and ScopeInfo used to
4177         track the activation frames for various local variables.   
4178
4179         Each toplevel block has an optional capture context associated
4180         with it.  When a method contains an anonymous method both the
4181         toplevel method and the anonymous method will create a capture
4182         context.   When variables or parameters are captured, they are
4183         recorded on the CaptureContext that owns them, for example:
4184
4185         void Demo () {
4186              int a;
4187              MyDelegate d = delegate {
4188                  a = 1;
4189              }
4190         }
4191
4192         Here `a' will be recorded as captured on the toplevel
4193         CapturedContext, the inner captured context will not have anything
4194         (it will only have data if local variables or parameters from it
4195         are captured in a nested anonymous method.
4196
4197         The ScopeInfo is used to track the activation frames for local
4198         variables, for example:
4199
4200         for (int i = 0; i < 10; i++)
4201                 for (int j = 0; j < 10; j++){
4202                    MyDelegate d = delegate {
4203                         call (i, j);
4204                    }
4205                 }
4206
4207         At runtime this captures a single captured variable `i', but it
4208         captures 10 different versions of the variable `j'.  The variable
4209         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4210         recorded on a child.  
4211
4212         The toplevel ScopeInfo will also track information like the `this'
4213         pointer if instance variables were referenced (this is necessary
4214         as the anonymous method lives inside a nested class in the host
4215         type of the method). 
4216
4217         (AnonymousMethod): Expanded to track the Toplevel, implement
4218         `AnonymousMethod.Compatible' to tell whether an anonymous method
4219         can be converted to a target delegate type. 
4220
4221         The routine now also produces the anonymous method content
4222
4223         (AnonymousDelegate): A helper class that derives from
4224         DelegateCreation, this is used to generate the code necessary to
4225         produce the delegate for the anonymous method that was created. 
4226
4227         * assign.cs: API adjustments for new changes in
4228         Convert.ImplicitStandardConversionExists.
4229
4230         * class.cs: Adjustments to cope with the fact that now toplevel
4231         blocks are of type `ToplevelBlock'. 
4232
4233         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4234         insteda of standard blocks.
4235
4236         Flag errors if params arguments are passed to anonymous methods.
4237
4238         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4239         `CurrentAnonymousMethod' which points to the current Anonymous
4240         Method.  The variable points to the AnonymousMethod class that
4241         holds the code being compiled.  It is set in the new EmitContext
4242         created for the anonymous method.
4243
4244         (EmitContext.Phase): Introduce a variable and an enumeration to
4245         assist in enforcing some rules about when and where we are allowed
4246         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4247         only one that enfonces this right now).
4248
4249         (EmitContext.HaveCaptureInfo): new helper method that returns
4250         whether we have a CapturedContext initialized.
4251
4252         (EmitContext.CaptureVariable): New method used to register that a
4253         LocalInfo must be flagged for capturing. 
4254
4255         (EmitContext.CapturedParameter): New method used to register that a
4256         parameters must be flagged for capturing. 
4257         
4258         (EmitContext.CapturedField): New method used to register that a
4259         field must be flagged for capturing. 
4260
4261         (EmitContext.HaveCapturedVariables,
4262         EmitContext.HaveCapturedFields): Return whether there are captured
4263         variables or fields. 
4264
4265         (EmitContext.EmitMethodHostInstance): This is used to emit the
4266         instance for the anonymous method.  The instance might be null
4267         (static methods), this (for anonymous methods that capture nothing
4268         and happen to live side-by-side with the current method body) or a
4269         more complicated expression if the method has a CaptureContext.
4270
4271         (EmitContext.EmitTopBlock): Routine that drives the emission of
4272         code: it will first resolve the top block, then emit any metadata
4273         and then emit the code.  The split is done so that we can extract
4274         any anonymous methods and flag any captured variables/parameters.
4275         
4276         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4277         during this phase, the ILGenerator should not be used as labels
4278         and local variables declared here might not be accessible to any
4279         code that is part of an anonymous method.  
4280
4281         Exceptions to this include the temporary variables that are
4282         created by some statements internally for holding temporary
4283         variables. 
4284         
4285         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4286         metadata for a cb
4287
4288         (EmitContext.TemporaryReturn): This method is typically called
4289         from the Emit phase, and its the only place where we allow the
4290         ReturnLabel to be defined other than the EmitMeta.  The reason is
4291         that otherwise we would have to duplicate a lot of logic in the
4292         Resolve phases of various methods that today is on the Emit
4293         phase. 
4294
4295         (EmitContext.NeedReturnLabel): This no longer creates the label,
4296         as the ILGenerator is not valid during the resolve phase.
4297
4298         (EmitContext.EmitThis): Extended the knowledge in this class to
4299         work in anonymous methods in addition to iterators. 
4300
4301         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4302         code is necessary on the stack to access the instance to a local
4303         variable (the variable will be accessed as a field).
4304
4305         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4306         EmitContext.EmitAddressOfParameter): Routines to support
4307         parameters (not completed at this point). 
4308         
4309         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4310         will also remove the parameters.
4311
4312         * convert.cs (Convert): Define a `ConstantEC' which points to a
4313         null.  This is just to prefity some code that uses
4314         ImplicitStandardConversion code and do not have an EmitContext
4315         handy.
4316
4317         The idea is to flag explicitly that at that point in time, it is
4318         known that the conversion will not trigger the delegate checking
4319         code in implicit conversions (which requires a valid
4320         EmitContext). 
4321
4322         Everywhere: pass new EmitContext parameter since
4323         ImplicitStandardConversionExists now requires it to check for
4324         anonymous method conversions. 
4325
4326         (Convert.ImplicitStandardConversionExists): If the type of an
4327         expression is the anonymous_method_type, and the type is a
4328         delegate, we invoke the AnonymousMethod.Compatible method to check
4329         whether an implicit conversion is possible. 
4330
4331         (Convert.ImplicitConversionStandard): Only do implicit method
4332         group conversions if the language level is not ISO_1.
4333
4334         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4335         MethodInfo for the Invoke method.  used by Delegate and
4336         AnonymousDelegate.
4337
4338         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4339         method conversions if the target type is a delegate.
4340
4341         Removed extra debugging nops.
4342
4343         (LocalVariableReference): Turn the `local_info' into a public
4344         field. 
4345
4346         Add `prepared' field, the same hack used for FieldExprs to cope
4347         with composed assignments, as Local variables do not necessarily
4348         operate purely on the stack as they used to: they can be captured
4349         fields. 
4350
4351         Add `temp' for a temporary result, like fields.
4352
4353         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4354
4355         It now copes with Local variables that are captured and emits the
4356         proper instance variable to load it from a field in the captured
4357         case. 
4358
4359         (ParameterReference.DoResolveBase): During the resolve phase,
4360         capture parameters if we are in an anonymous method.
4361
4362         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4363         anonymous method, use the EmitContext helper routines to emit the
4364         parameter reference.
4365
4366         * iterators.cs: Set RemapToProxy to true/false during the
4367         EmitDispose class.
4368
4369         * parameters.cs (GetParameterByName): New helper method. 
4370
4371         * typemanager.cs (anonymous_method_type) a new type that
4372         represents an anonyous method.  This is always an internal type,
4373         used as a fencepost to test against the anonymous-methodness of an
4374         expression. 
4375         
4376 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4377
4378         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4379         561 report.
4380         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4381
4382 2004-10-18  Martin Baulig  <martin@ximian.com>
4383
4384         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4385         `Type' directly, but call ResolveType() on it.
4386         (Catch.Resolve): Likewise.
4387         (Foreach.Resolve): Likewise.
4388
4389 2004-10-18  Martin Baulig  <martin@ximian.com>
4390
4391         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4392         `Type' directly, but call ResolveType() on it.
4393         (Probe.DoResolve): Likewise.
4394         (ArrayCreation.LookupType): Likewise.
4395         (TypeOf.DoResolve): Likewise.
4396         (SizeOf.DoResolve): Likewise.
4397
4398 2004-10-18  Martin Baulig  <martin@ximian.com>
4399
4400         * expression.cs (Invocation.BetterFunction): Put back
4401         TypeManager.TypeToCoreType().
4402
4403 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4404
4405         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4406         the ResolveType.
4407
4408 2004-10-18  Martin Baulig  <martin@ximian.com>
4409
4410         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4411         `Type' directly, but call ResolveType() on it.
4412
4413 2004-10-18  Martin Baulig  <martin@ximian.com>
4414
4415         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4416         `Type' directly, but call ResolveType() on it.
4417         (MemberBase.DoDefine): Likewise.
4418
4419         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4420         `Type' directly, but call ResolveType() on it.
4421         (ComposedCast.DoResolveAsTypeStep): Likewise.
4422
4423         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4424         `Type' directly, but call ResolveType() on it.
4425
4426 2004-10-17  John Luke  <john.luke@gmail.com>
4427
4428         * class.cs (Operator.GetSignatureForError): use CSharpName
4429
4430         * parameter.cs (Parameter.GetSignatureForError): Returns
4431         correct name even if was not defined.
4432
4433 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4434
4435         Fix #65816.
4436         * class.cs (TypeContainer.EmitContext): New property.
4437         (DefineNestedTypes): Create an emitcontext for each part.
4438         (MethodCore.DoDefineParameters): Use container's emitcontext.
4439         Pass type array to InternalParameters.
4440         (MemberBase.DoDefine): Use container's emitcontext.
4441         (FieldMember.Define): Likewise.
4442         (Event.Define): Likewise.
4443         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4444         Pass type array to InternalParameters.
4445         (SetIndexerMethod.GetParameterInfo): Likewise.
4446         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4447         * delegate.cs (Define): Pass emitcontext to
4448         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4449         array to InternalParameters.
4450         * expression.cs (ParameterReference.DoResolveBase): Pass
4451         emitcontext to GetParameterInfo.
4452         (ComposedCast.DoResolveAsTypeStep): Remove check on
4453         ec.ResolvingTypeTree.
4454         * parameter.cs (Parameter.Resolve): Change argument to
4455         EmitContext.  Use ResolveAsTypeTerminal.
4456         (Parameter.GetSignature): Change argument to EmitContext.
4457         (Parameters.ComputeSignature): Likewise.
4458         (Parameters.ComputeParameterTypes): Likewise.
4459         (Parameters.GetParameterInfo): Likewise.
4460         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4461         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4462         * support.cs (InternalParameters..ctor): Remove variant that takes
4463         a DeclSpace.
4464         * typemanager.cs (system_intptr_expr): New.
4465         (InitExpressionTypes): Initialize it.
4466
4467 2004-10-12  Chris Toshok  <toshok@ximian.com>
4468
4469         * cs-parser.jay: fix location for try_statement and catch_clause.
4470
4471 2004-10-11  Martin Baulig  <martin@ximian.com>
4472
4473         * report.cs: Don't make --fatal abort on warnings, we have
4474         -warnaserror for that.
4475
4476 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4477
4478         More DeclSpace.ResolveType avoidance.
4479         * decl.cs (MemberCore.InUnsafe): New property.
4480         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4481         with newly created EmitContext.
4482         (FieldMember.Define): Likewise.
4483         * delegate.cs (Delegate.Define): Likewise.
4484         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4485         only if normal name-lookup fails.
4486         (TypeExpr.DoResolve): Enable error-checking.
4487         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4488         (SizeOf.DoResolve): Likewise.
4489         (ComposedCast.DoResolveAsTypeStep): Likewise.
4490         (StackAlloc.DoResolve): Likewise.
4491         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4492         (Block.Unsafe): New property.
4493         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4494         (Unsafe): Set 'unsafe' flag of contained block.
4495         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4496         (Fixed.Resolve): Likewise.
4497         (Catch.Resolve): Likewise.
4498         (Using.ResolveLocalVariableDecls): Likewise.
4499         (Foreach.Resolve): Likewise.
4500
4501 2004-10-05  John Luke <john.luke@gmail.com>
4502
4503         * cs-parser.jay: add location to error CS0175
4504
4505 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4506
4507         * ecore.cs (Expression.Constantity): Add support for turning null
4508         into a constant.
4509
4510         * const.cs (Const.Define): Allow constants to be reference types
4511         as long as the value is Null.
4512
4513 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4514
4515         * namespace.cs (NamespaceEntry.Using): No matter which warning
4516         level is set, check if this namespace name has already been added.
4517
4518 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4519
4520         * expression.cs: reftype [!=]= null should always use br[true,false].
4521         # 67410
4522
4523 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4524
4525         Fix #67108
4526         * attribute.cs: Enum conversion moved to 
4527         GetAttributeArgumentExpression to be applied to the all
4528         expressions.
4529
4530 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4531
4532         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4533         * class.c (TypeContainer.DefineType): Flag error if
4534         base types aren't accessible due to access permissions.
4535         * decl.cs (DeclSpace.ResolveType): Move logic to
4536         Expression.ResolveAsTypeTerminal.
4537         (DeclSpace.ResolveTypeExpr): Thin layer over
4538         Expression.ResolveAsTypeTerminal.
4539         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4540         Refactor code into NestedAccess.  Use it.
4541         (DeclSpace.NestedAccess): New.
4542         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4543         argument to silence errors.  Check access permissions.
4544         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4545         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4546         (Cast.DoResolve): Likewise.
4547         (New.DoResolve): Likewise.
4548         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4549         (TypeOf.DoResolve): Likewise.
4550
4551         * expression.cs (Invocation.BetterConversion): Return the Type of
4552         the better conversion.  Implement section 14.4.2.3 more faithfully.
4553         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4554         section 14.4.2.2 explicit.
4555         (Invocation.OverloadResolve): Update.
4556         (Invocation): Remove is_base field.
4557         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4558         (Invocation.Emit): Likewise.
4559
4560 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4561
4562         * README: Update to changes.
4563
4564 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4565
4566         * cs-parser.jay: Reverted 642 warning fix.
4567
4568 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4569
4570         Fix bug #66615
4571         * decl.cs (FindMemberWithSameName): Indexer can have more than
4572         1 argument.
4573
4574 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4575
4576         * expression.cs (LocalVariableReference.DoResolveLValue):
4577         Do not report warning 219 for out values.
4578         (EmptyExpression.Null): New member to avoid extra allocations.
4579
4580 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4581
4582         * cs-parser.jay: Fix wrong warning 642 report.
4583
4584         * cs-tokenizer.cs (CheckNextToken): New helper;
4585         Inspect next character if is same as expected.
4586
4587 2004-09-23  Martin Baulig  <martin@ximian.com>
4588
4589         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4590         (Convert.ImplicitReferenceConversionExists): Likewise.
4591
4592 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4593
4594         * class.cs (Operator.Define): Add error 448 and 559 report.
4595
4596 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4597
4598         * class.cs (MemberBase.IsTypePermitted): New protected
4599         method for checking error CS0610.
4600
4601 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4602
4603         * class.cs (TypeContainer.HasExplicitLayout): New property
4604         Returns whether container has StructLayout attribute set Explicit.
4605         (FieldMember): New abstract class for consts and fields.
4606         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4607         (Field): Reuse FieldMember.
4608
4609         * const.cs (Const): Reuse FieldMember.
4610
4611         * rootcontext.cs: EmitConstants call moved to class.
4612
4613 2004-09-22  Martin Baulig  <martin@ximian.com>
4614
4615         Thanks to Peter Sestoft for this bug report.
4616
4617         * expression.cs (Conditional): If both the `trueExpr' and the
4618         `falseExpr' is a NullLiteral, return a NullLiteral.
4619
4620 2004-09-22  Martin Baulig  <martin@ximian.com>
4621
4622         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4623         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4624         for the "get_Current" call.
4625
4626 2004-09-22  Martin Baulig  <martin@ximian.com>
4627
4628         Marek and me just fixed one of our oldest bugs: #28562 :-)
4629
4630         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4631
4632         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4633         we're an EnumConstant, just return that.
4634         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4635         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4636         to get the value which'll actually be written into the attribute.
4637         However, we have to use GetValue() to access the attribute's value
4638         in the compiler.        
4639
4640 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4641
4642         * constant.cs (Constant.IsNegative): New abstract property
4643         IsNegative.
4644
4645         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4646         (StackAlloc.DoResolve): Reused IsNegative.
4647
4648 2004-09-21  Martin Baulig  <martin@ximian.com>
4649
4650         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4651         if we're used in an iterator, we may be called from different
4652         methods.
4653
4654         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4655         we actually have an exception block.
4656
4657 2004-09-20  John Luke <jluke@cfl.rr.com>
4658
4659         * class.cs, cs-parser.jay: Improve the error report for 1520:
4660         report the actual line where the error happens, not where the
4661         class was declared.
4662
4663         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4664         Pass location information that was available elsewhere.
4665
4666 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4667
4668         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4669         runtime to delay sign assemblies.
4670
4671 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4672
4673         * cs-parser.jay: Do not report the stack trace, this is barely
4674         used nowadays.
4675
4676 2004-08-22  John Luke  <john.luke@gmail.com>
4677  
4678         * driver.cs : check that a resource id is not already used
4679         before adding it, report CS1508 if it is, bug #63637
4680
4681 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4682
4683         * ecore.cs: Removed dead code.
4684
4685 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4686
4687         * class.cs: Do not report warning CS0067 on the interfaces.
4688
4689 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4690
4691         * cs-parser.jay: Add error 504 report.
4692
4693 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4694
4695         * rootcontext.cs: WarningLevel is 4 by default now.
4696
4697         * statement.cs (Fixed.Resolve): Do not null
4698         VariableInfo.
4699
4700 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4701
4702         Fixed bug #55780
4703         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4704         deep search when property is not virtual.
4705         (PropertyExpr.ResolveAccessors): Make one call for both
4706         accessors.
4707
4708 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4709
4710         Fixed bug #65766
4711         * statement.cs: Error 152 report constains also location.
4712
4713 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4714
4715         Fixed bug #65766
4716         * const.cs: Explicitly set constant as static.
4717
4718 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4719
4720         Fixed bug #64226
4721         * cs-parser.jay: Add error 1017 report.
4722
4723 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4724
4725         Fixed bug #59980, #64224
4726         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4727
4728         * typemanager.cs (IsSpecialMethod): Simplified
4729
4730 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4731
4732         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4733         condition with better params.
4734
4735 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4736
4737         Fixed bug #65238
4738         * attribute.cs (Resolve): Property has to have both
4739         accessors.
4740
4741 2004-09-14  Martin Baulig  <martin@ximian.com>
4742
4743         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4744
4745 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4746
4747         Fixed bug #61902
4748         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4749         called and is obsolete then this member suppress message
4750         when call is inside next [Obsolete] method or type.
4751
4752         * expression.cs: Use TestObsoleteMethodUsage member.
4753
4754 2004-09-14  Martin Baulig  <martin@ximian.com>
4755
4756         * cs-parser.jay: Sync a bit with the GMCS version.
4757
4758 2004-09-14  Martin Baulig  <martin@ximian.com>
4759
4760         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4761         (CSharpParser.yacc_verbose_flag): New public field.
4762
4763         * genericparser.cs: Removed.
4764
4765 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4766
4767         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4768
4769 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4770
4771         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4772
4773 2004-09-10  Martin Baulig  <martin@ximian.com>
4774
4775         Backported my MemberName changes from GMCS into MCS.
4776
4777         - we are now using a special `MemberName' class instead of using
4778         strings; in GMCS, the `MemberName' also contains the type
4779         arguments.
4780
4781         - changed the grammar rules a bit:
4782           * the old `member_name' is now a `namespace_or_type_name':
4783             The rule is that we use `namespace_or_type_name' everywhere
4784             where we expect either a "member name" (GetEnumerator) or a
4785             "member name" with an explicit interface name
4786             (IEnumerable.GetEnumerator).
4787             In GMCS, the explicit interface name may include type arguments
4788             (IEnumerable<T>.GetEnumerator).
4789           * we use `member_name' instead of just `IDENTIFIER' for
4790             "member names":
4791             The rule is that we use `member_name' wherever a member may
4792             have type parameters in GMCS.       
4793
4794         * decl.cs (MemberName): New public class.
4795         (MemberCore.MemberName): New public readonly field.
4796         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4797         (DeclSpace): Likewise.
4798
4799         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4800         * enum.cs (Enum.ctor): Likewise.
4801
4802         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4803         MemberName.     
4804         (AliasEntry.ctor): Take a MemberName, not an Expression.
4805         (AliasEntry.UsingAlias): Likewise.
4806
4807         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4808         (IMethodData.MemberName): Changed type from string to MemberName.
4809         (MemberBase.ExplicitInterfaceName): Likewise.
4810         (AbstractPropertyEventMethod.SetupName): Make this private.
4811         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4812         argument; compute the member name here.
4813         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4814         on the `member.MemberName' and the `prefix'.
4815
4816         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4817         not `type_name'.
4818         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4819         thus, we get a `MemberName' instead of a `string'.  These
4820         declarations may have type parameters in GMCS.
4821         (interface_method_declaration, delegate_declaration): Likewise.
4822         (class_declaration, interface_declaration): Likewise.
4823         (method_header): Use `namespace_or_type_name' instead of
4824         `member_name'.  We may be an explicit interface implementation.
4825         (property_declaration, event_declaration): Likewise.
4826         (member_name): This is now just an `IDENTIFIER', not a
4827         `namespace_or_type_name'.
4828         (type_name, interface_type): Removed.
4829         (namespace_or_type_name): Return a MemberName, not an Expression.
4830         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4831         call GetTypeExpression() on the MemberName to get an expression.
4832         (IndexerDeclaration.interface_type): Changed type from string to
4833         MemberName.
4834         (MakeName): Operate on MemberName's instead of string's.
4835
4836 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4837
4838         Fix bug #55770.
4839         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4840         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4841         lookup to avoid symbols introduced by 'using'.
4842         * rootcontext.cs (NamespaceLookup): Update.
4843
4844 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4845
4846         * class.cs (TypeContainer.DoDefineMembers): Do not call
4847         DefineDefaultConstructor for static classes.
4848
4849 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4850
4851         * attribute.cs (Attribute.Resolve): Add error 653 report.
4852
4853         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4854         report.
4855         (Method.ApplyAttributeBuilder): Add error 685 report.
4856         (Operator.Define): Add error 564 report.
4857
4858         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4859
4860         * expression.cs (Invocation.DoResolve): Add error
4861         245 and 250 report.
4862
4863         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4864         error 674 report.
4865
4866 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4867
4868         * class.cs (ConstructorInitializer.Resolve):
4869         Wrong error number (515->516).
4870
4871 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4872
4873         * class.cs (Indexer.Define): Add error 631 report.
4874
4875 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4876
4877         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4878
4879 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4880
4881         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4882
4883 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4884
4885         * cs-parser.jay: Added error CS0241 report.
4886
4887 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4888
4889         * cs-parser.jay (fixed_statement): Introduce a scope for the
4890         declaration in the 'fixed' statement.
4891
4892 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4893
4894         * cs-parser.jay: Added CS0230 error report.
4895
4896 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4897
4898         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4899
4900 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4901
4902         * expression.cs (Argument.Resolve): Added error CS0192 and
4903         CS0199 report.
4904
4905 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4906
4907         C# 2.0 #pragma warning feature
4908
4909         * cs-tokenizer.cs (PreProcessPragma): New method; 
4910         Handles #pragma directive.
4911
4912         * report.cs (WarningRegions): New class; Support
4913         class for #pragma warning directive. It tests whether
4914         warning is enabled for a given line.
4915
4916 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4917
4918         * const.cs: Add more descriptive error report, tahnks to
4919         Sebastien. 
4920
4921 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4922
4923         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4924
4925 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4926
4927         * expression.cs: Apply patch from Ben: Remove dead code from
4928         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4929         as that code just threw an exception anwyays.
4930
4931         * const.cs: Remove the call to the turnintoconstant, for details
4932         see bug: #63144
4933         
4934         * literal.cs: The type of the null-literal is the null type;  So
4935         we use a placeholder type (literal.cs:System.Null, defined here)
4936         for it.
4937
4938         * expression.cs (Conditional.DoResolve): Remove some old code that
4939         is no longer needed, conversions have been fixed.
4940
4941         (ArrayCreationExpression.DoResolve): Return false if we fail to
4942         resolve the inner expression.
4943
4944 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4945
4946         Fix test-290.cs.
4947         * cs-parser.jay (delegate_declaration): Record a delegate
4948         declaration as a type declaration.
4949         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4950
4951 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4952
4953         * parameter.cs: Do not crash if the type can not be resolved. 
4954
4955         * expression.cs: Report errors with unsafe pointers, fixes #64896
4956
4957 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4958
4959         * expression.cs: Pointer arith always needs to do a conv.i
4960         if the operand is a long. fix 65320
4961
4962 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4963
4964         Fixed cs0619-37.cs, cs0619-38.cs
4965
4966         * enum.cs (GetObsoleteAttribute): Removed.
4967
4968         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4969         on Enum member is double staged. The first is tested member
4970         and then enum.
4971
4972 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4973
4974         Fixed #56986, #63631, #65231
4975
4976         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4977         adds member to name container.
4978         (TypeContainer.AddToTypeContainer): New method, adds type to
4979         name container.
4980         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4981         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4982         AddOperator): Simplified by reusing AddToMemberContainer.
4983         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4984         instead of field.
4985         (Method.CheckForDuplications): Fixed implementation to test all
4986         possibilities.
4987         (MemberBase): Detection whether member is explicit interface
4988         implementation is now in constructor.
4989         (MemberBase.UpdateMemberName): Handles IndexerName.
4990         (Accessor): Changed to keep also location information.
4991         (AbstractPropertyEventMethod): Is derived from MemberCore.
4992         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4993         will be emited or not.
4994         (PropertyBase.AreAccessorsDuplicateImplementation):
4995         Tests whether accessors are not in collision with some method.
4996         (Operator): Is derived from MethodCore to simplify common
4997         operations.
4998
4999         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5000         must be performed.
5001         (DeclSpace.AddToContainer): Adds the member to defined_names
5002         table. It tests for duplications and enclosing name conflicts.
5003
5004         * enum.cs (EnumMember): Clean up to reuse the base structures
5005
5006 2004-09-03  Martin Baulig  <martin@ximian.com>
5007
5008         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5009         into TypeContainer, to make partial classes work again.
5010
5011 2004-09-03  Martin Baulig  <martin@ximian.com>
5012
5013         * rootcontext.cs (RootContext.V2): Removed.
5014
5015 2004-03-23  Martin Baulig  <martin@ximian.com>
5016
5017         * expression.cs (Invocation.OverloadResolve): Added `bool
5018         may_fail' argument and use it instead of the Location.IsNull() hack.
5019
5020 2004-09-03  Martin Baulig  <martin@ximian.com>
5021
5022         Merged latest changes into gmcs.  Please keep this comment in
5023         here, it makes it easier for me to see what changed in MCS since
5024         the last time I merged.
5025
5026 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5027
5028         Fix #61128.
5029         * expression.cs (BetterConversion): Don't allow either conversion 
5030         to be null.  Remove redundant implicit conversion test when 'q ==
5031         null' -- when this function is invoked, we already know that the
5032         implicit conversion exists.
5033         (BetterFunction): Assume that 'best' is non-null.  Remove
5034         redundant reimplementation of IsApplicable when 'best' is null.
5035         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5036         number of arguments.
5037         (IsAncestralType): Extract from OverloadResolve.
5038         (OverloadResolve): Make robust to the MethodGroupExpr being
5039         unsorted.  Implement all the logic of Section 14.5.5.1, and
5040         support overloading of methods from multiple applicable types.
5041         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5042
5043         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5044         (RealError, Warning): Append type of report to related symbol.
5045
5046 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5047
5048         * enum.cs: Fixed CLS-Compliance checks for enum members.
5049         Error tests cs3008-8.cs, cs3014-8.cs
5050
5051 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5052
5053         Fixed bug #62342, #63102
5054         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5055         like ImplementMethod.
5056
5057 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5058
5059         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5060         Fixed bug #65170.
5061
5062 2004-09-02  Martin Baulig  <martin@ximian.com>
5063
5064         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5065         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5066         on the MethodBase.
5067
5068 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5069
5070         C# 2.0 Static classes implemented
5071
5072         * class.cs (TypeContainer): instance_constructors,
5073         initialized_fields, initialized_static_fields,
5074         default_constructor, base_inteface_types are protected to be
5075         accessible from StaticClass.
5076         (TypeContainer.DefineDefaultConstructor): New virtual method
5077         for custom default constructor generating
5078         (StaticClass): New class to handle "Static classes" feature.
5079
5080         * cs-parser.jay: Handle static keyword on class like instance
5081         of StaticClass.
5082
5083         * driver.cs: Added "/langversion" command line switch with two
5084         options (iso-1, default).
5085
5086 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5087
5088         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5089
5090 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5091
5092         * delegate.cs: Style.
5093
5094 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5095
5096         * delegate.cs: Add seperate instance expr field for miguel.
5097
5098 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5099
5100         * PointerArithmetic (Resolve): make sure we are not doing
5101         pointer arith on void*. Also, make sure we are resolved
5102         by not setting eclass until resolve.
5103
5104         All callers: Make sure that PointerArithmetic gets resolved.
5105
5106 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5107
5108         * ArrayCreation (LookupType): If the type does not resolve 
5109         to an array, give an error.
5110
5111 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5112
5113         * statement.cs (Try.Resolve): Fixed bug #64222
5114
5115 2004-08-27  Martin Baulig  <martin@ximian.com>
5116
5117         * class.cs
5118         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5119         crash here.     
5120
5121 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5122
5123         * ecore.cs (Constantify): Get underlying type via
5124         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5125         Windows in special cases.
5126
5127 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5128
5129         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5130         for obtaining also private methods.
5131         (GetRemoveMethod): Used GetRemoveMethod (true)
5132         for obtaining also private methods.
5133
5134 2004-08-24  Martin Baulig  <martin@ximian.com>
5135
5136         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5137         MethodAttributes.HideBySig for operators.
5138
5139 2004-08-23  Martin Baulig  <martin@ximian.com>
5140
5141         Back to the old error reporting system :-)
5142
5143         * report.cs (Message): Removed.
5144         (Report.MessageData, ErrorData, WarningData): Removed.
5145         (Report.Error, Warning): Back to the old system.
5146
5147 2004-08-23  Martin Baulig  <martin@ximian.com>
5148
5149         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5150
5151         * class.cs (TypeContainer.ParentContainer): New public virtual
5152         method; replaces the explicit interface implementation.
5153         (ClassPart.ParentContainer): Override.
5154
5155 2004-08-23  Martin Baulig  <martin@ximian.com>
5156
5157         * statement.cs (Switch): Added support for constant switches; see
5158         #59428 or test-285.cs.
5159
5160 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5161
5162         Fixed bug #62740.
5163         * statement.cs (GetEnumeratorFilter): Removed useless
5164         logic because C# specs is strict. GetEnumerator must be
5165         public.
5166
5167 2004-08-22  Martin Baulig  <martin@ximian.com>
5168
5169         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5170         a switch and may break, reset the barrier.  Fixes #59867.
5171
5172 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5173
5174         CLS-Compliance speed up (~5% for corlib)
5175
5176         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5177         New method. Tests container for CLS-Compliant names
5178
5179         * class.cs (TypeContainer.VerifyClsName): New method.
5180         Checks whether container name is CLS Compliant.
5181         (Constructor): Implements IMethodData.
5182
5183         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5184         low-case table for CLS Compliance test.
5185         (MemberCache.VerifyClsParameterConflict): New method.
5186         Checks method parameters for CS3006 error.
5187
5188         * enum.cs (EnumMember): Is derived from MemberCore.
5189         (Enum.VerifyClsName): Optimized for better performance.
5190
5191 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5192
5193         * report.cs: Renamed Error_T to Error and changed all
5194         references.
5195
5196 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5197
5198         * class.cs (TypeContainer.IndexerArrayList): New inner class
5199         container for indexers.
5200         (TypeContainer.DefaultIndexerName): New constant for default
5201         indexer name. Replaced all "Item" with this constant.
5202         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5203
5204         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5205         DefaultMemberAttribute constructor.
5206
5207 2004-08-05  Martin Baulig  <martin@ximian.com>
5208
5209         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5210         Fix bug #59429.
5211
5212 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5213
5214         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5215         multi platforms problem.
5216
5217         * compiler.csproj: Included shared files.
5218
5219 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5220
5221         Fix bug 60333, 55971 in the more general way
5222         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5223         Added arg_type argument for constant conversion.
5224         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5225
5226 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5227
5228         Fix bug #59760
5229         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5230         OperatorArrayList, MethodCoreArrayList for typecontainer
5231         containers. Changed class member types to these new types.
5232         (MethodArrayList.DefineMembers): Added test for CS0659.
5233
5234 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5235
5236         * cfold.cs: Synchronize the folding with the code in expression.cs
5237         Binary.DoNumericPromotions for uint operands.
5238
5239         * attribute.cs: Revert patch from Raja, it introduced a regression
5240         while building Blam-1.2.1 (hard to isolate a test case).
5241
5242 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5243
5244         Fix for #55382
5245         * class.cs:
5246         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5247         name collision.
5248         (MethodCore.parent_method): New member. The method we're overriding
5249         if this is an override method.
5250         (MethodCore.CheckBase): Moved from Method class and made common.
5251         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5252         private.
5253         (MethodCore.CheckForDuplications): New abstract method. For custom
5254         member duplication search in a container
5255         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5256         method and its return type.
5257         (Event.conflict_symbol): New member. Symbol with same name in the
5258         parent class.
5259
5260         * decl.cs:
5261         (MemberCache.FindMemberWithSameName): New method. The method
5262         is looking for conflict with inherited symbols.
5263
5264 2004-08-04  Martin Baulig  <martin@ximian.com>
5265
5266         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5267
5268         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5269
5270 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5271
5272         * report.cs (Message): New enum for better error, warning reference in
5273         the code.
5274         (MessageData): New inner abstract class. It generally handles printing of
5275         error and warning messages.
5276         Removed unused Error, Warning, Message methods.
5277
5278 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5279
5280         Fix for cs0592-8.cs test
5281         * attribute.cs
5282         (Attributable.ValidAttributeTargets): Made public.
5283         (Attribute.ExplicitTarget): New member for explicit target value.
5284         (Attribute.CheckTargets): Now we translate explicit attribute
5285         target to Target here.
5286
5287 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5288
5289         * ecore.cs (MethodGroupExpr): new IsBase property.
5290
5291         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5292
5293         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5294         rather than an instance expr.
5295
5296         (DelegateCreation.Emit): Use the method group rather than
5297         the instance expression. Also, if you have base.Foo as the
5298         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5299
5300         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5301
5302         (NewDelegate.DoResolve): Only check for the existance of Invoke
5303         if the method is going to be needed. Use MethodGroupExpr.
5304
5305         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5306
5307         * expression.cs: For pointer arith., make sure to use
5308         the size of the type, not the size of the pointer to
5309         the type.
5310
5311 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5312
5313         Fix for #60722
5314         * class.cs (Class): Added error CS0502 test.
5315
5316 2004-08-03  John Luke  <jluke@cfl.rr.com>
5317             Raja R Harinath  <rharinath@novell.com>
5318
5319         Fix for #60997.
5320         * attribute.cs (Attribute.complained_before): New flag.
5321         (Attribute.ResolveType, Attribute.Resolve),
5322         (Attribute.DefinePInvokeMethod): Set it.
5323         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5324         
5325 2004-08-03  Martin Baulig  <martin@ximian.com>
5326
5327         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5328         use a user-defined operator; we still need to do numeric
5329         promotions in case one argument is a builtin type and the other
5330         one has an implicit conversion to that type.  Fixes #62322.
5331
5332 2004-08-02  Martin Baulig  <martin@ximian.com>
5333
5334         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5335         (LocalInfo.IsThis): New public property.
5336         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5337
5338 2004-08-01  Martin Baulig  <martin@ximian.com>
5339
5340         * class.cs (TypeContainer.GetClassBases): Don't set the default
5341         here since we may get called from GetPartialBases().
5342         (TypeContainer.DefineType): If GetClassBases() didn't return a
5343         parent, use the default one.
5344
5345 2004-07-30  Duncan Mak  <duncan@ximian.com>
5346
5347         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5348
5349 2004-07-30  Martin Baulig  <martin@ximian.com>
5350
5351         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5352
5353         * class.cs (SourceMethod): New public class, derive from the
5354         symbol writer's ISourceMethod.
5355         (Method): Use the new symbol writer API.
5356
5357         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5358         as argument and use the new symbol writer.
5359
5360         * location.cs
5361         (SourceFile): Implement the symbol writer's ISourceFile.
5362         (Location.SymbolDocument): Removed.
5363         (Location.SourceFile): New public property.
5364
5365         * symbolwriter.cs: Use the new symbol writer API.
5366
5367 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5368
5369         * Makefile (install-local): Remove.  Functionality moved to
5370         executable.make.
5371
5372 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5373
5374         * Makefile: Install mcs.exe.config file together with mcs.exe.
5375         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5376         correct runtime version.
5377         
5378 2004-07-25  Martin Baulig  <martin@ximian.com>
5379
5380         * class.cs
5381         (TypeContainer.RegisterOrder): Removed, this was unused.
5382         (TypeContainer, interface_order): Removed.
5383         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5384         TypeContainer as argument since we can also be called with a
5385         `PartialContainer' for a partial class/struct/interface.
5386         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5387         of checking whether we're an `Interface' - we could be a
5388         `PartialContainer'.
5389         (PartialContainer.Register): Override; call
5390         AddClass()/AddStruct()/AddInterface() on our parent.
5391
5392         * cs-parser.jay (interface_member_declaration): Add things to the
5393         `current_container', not the `current_class'.
5394
5395         * rootcontext.cs (RegisterOrder): The overloaded version which
5396         takes an `Interface' was unused, removed.
5397
5398         * typemanager.cs (TypeManager.LookupInterface): Return a
5399         `TypeContainer', not an `Interface'.
5400         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5401         contain a `PartialContainer' for an interface, so check it's
5402         `Kind' to figure out what it is.
5403
5404 2004-07-25  Martin Baulig  <martin@ximian.com>
5405
5406         * class.cs (Class.DefaultTypeAttributes): New public constant.
5407         (Struct.DefaultTypeAttributes): Likewise.
5408         (Interface.DefaultTypeAttributes): Likewise.
5409         (PartialContainer.TypeAttr): Override this and add the
5410         DefaultTypeAttributes.
5411
5412 2004-07-25  Martin Baulig  <martin@ximian.com>
5413
5414         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5415         we can just use the `Parent' field instead.
5416
5417 2004-07-25  Martin Baulig  <martin@ximian.com>
5418
5419         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5420
5421 2004-07-25  Martin Baulig  <martin@ximian.com>
5422
5423         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5424         our parts before defining any methods.
5425         (TypeContainer.VerifyImplements): Make this virtual.
5426         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5427         on our PartialContainer.
5428
5429 2004-07-25  Martin Baulig  <martin@ximian.com>
5430
5431         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5432
5433         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5434         argument, we can just use the `Parent' field instead.
5435
5436         * class.cs
5437         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5438         (MemberBase.DoDefine): Likewise.
5439
5440 2004-07-24  Martin Baulig  <martin@ximian.com>
5441
5442         * decl.cs (MemberCore.Parent): New public field.
5443         (DeclSpace.Parent): Moved to MemberCore.
5444
5445         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5446         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5447         parent's .ctor.
5448         (FieldBase, Field, Operator): Likewise.
5449         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5450         (EventField, Event): Likewise.
5451
5452 2004-07-23  Martin Baulig  <martin@ximian.com>
5453
5454         * class.cs (PartialContainer): New public class.
5455         (ClassPart): New public class.
5456         (TypeContainer): Added support for partial classes.
5457         (TypeContainer.GetClassBases): Splitted some of the functionality
5458         out into GetNormalBases() and GetPartialBases().
5459
5460         * cs-tokenizer.cs (Token.PARTIAL): New token.
5461         (Tokenizer.consume_identifier): Added some hacks to recognize
5462         `partial', but only if it's immediately followed by `class',
5463         `struct' or `interface'.
5464
5465         * cs-parser.jay: Added support for partial clases.
5466
5467 2004-07-23  Martin Baulig  <martin@ximian.com>
5468
5469         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5470         a `DeclSpace' and also made it readonly.
5471         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5472         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5473         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5474
5475         * cs-parser.jay: Pass the `current_class', not the
5476         `current_container' (at the moment, this is still the same thing)
5477         to a new Method, Property, Event, Indexer or Constructor.
5478
5479 2004-07-23  Martin Baulig  <martin@ximian.com>
5480
5481         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5482         and removed the `current_interface' one.
5483         (struct_declaration, class_declaration, interface_declaration):
5484         Set `current_class' to the newly created class/struct/interface;
5485         set their `Bases' and call Register() before parsing their body.
5486
5487 2004-07-23  Martin Baulig  <martin@ximian.com>
5488
5489         * class.cs (Kind): New public enum.
5490         (TypeContainer): Made this class abstract.
5491         (TypeContainer.Kind): New public readonly field.
5492         (TypeContainer.CheckDef): New public method; moved here from
5493         cs-parser.jay.
5494         (TypeContainer.Register): New public abstract method.
5495         (TypeContainer.GetPendingImplementations): New public abstract
5496         method.
5497         (TypeContainer.GetClassBases): Removed the `is_class' and
5498         `is_iface' parameters.
5499         (TypeContainer.DefineNestedTypes): Formerly known as
5500         DoDefineType().
5501         (ClassOrStruct): Made this class abstract.
5502
5503         * tree.cs (RootTypes): New public type. 
5504
5505 2004-07-20  Martin Baulig  <martin@ximian.com>
5506
5507         * tree.cs (Tree.RecordNamespace): Removed.
5508         (Tree.Namespaces): Removed.
5509
5510         * rootcontext.cs (RootContext.IsNamespace): Removed.
5511
5512         * cs-parser.jay (namespace_declaration): Just create a new
5513         NamespaceEntry here.
5514
5515 2004-07-20  Martin Baulig  <martin@ximian.com>
5516
5517         * statement.cs (ExceptionStatement): New abstract class.  This is
5518         now used as a base class for everyone who's using `finally'.
5519         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5520         our local variables before using them.
5521
5522         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5523         virtual method.  This is used by Yield.Resolve() to "steal" an
5524         outer block's `finally' clauses.
5525         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5526         argument.
5527
5528         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5529         version which takes an ExceptionStatement.  This version must be
5530         used to create exception branchings.
5531
5532         * iterator.cs
5533         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5534         (Iterator.EmitMoveNext): Added exception support; protect the
5535         block with a `fault' clause, properly handle 'finally' clauses.
5536         (Iterator.EmitDispose): Run all the `finally' clauses here.
5537
5538 2004-07-20  Martin Baulig  <martin@ximian.com>
5539
5540         * iterator.cs: This is the first of a set of changes in the
5541         iterator code.  Match the spec more closely: if we're an
5542         IEnumerable, then GetEnumerator() must be called.  The first time
5543         GetEnumerator() is called, it returns the current instance; all
5544         subsequent invocations (if any) must create a copy.
5545
5546 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5547
5548         * expression.cs: Resolve the constant expression before returning
5549         it. 
5550
5551 2004-07-19  Martin Baulig  <martin@ximian.com>
5552
5553         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5554         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5555         the return type of the new EmitContext.
5556
5557 2004-07-18  Martin Baulig  <martin@ximian.com>
5558
5559         * class.cs (Property.Define): Fix iterators.
5560
5561         * iterators.cs (Iterator.Define): Moved the
5562         `container.AddInterator (this)' call here from the .ctor; only do
5563         it if we resolved successfully.
5564
5565 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5566
5567         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5568         `true' for preprocessing directives that we parse.  The return
5569         value indicates whether we should return to regular tokenizing or
5570         not, not whether it was parsed successfully.
5571
5572         In the past if we were in: #if false ... #line #endif, we would
5573         resume parsing after `#line'.  See bug 61604.
5574
5575         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5576         building: IsEnumType should return true only for enums, not for
5577         enums or System.Enum itself.  This fixes #61593.
5578
5579         Likely what happened is that corlib was wrong: mcs depended on
5580         this bug in some places.  The bug got fixed, we had to add the
5581         hack, which caused bug 61593.
5582
5583         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5584         that was a workaround for the older conditions.
5585
5586 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5587
5588         * assign.cs: IAssignMethod has a new interface, as documented
5589         inline. All assignment code now uses this new api.
5590
5591         * ecore.cs, expression.cs: All classes which implement
5592         IAssignMethod now use the new interface.
5593
5594         * expression.cs (Invocation): add a hack to EmitCall so that
5595         IndexerAccess can be the target of a compound assignment without
5596         evaluating its arguments twice.
5597
5598         * statement.cs: Handle changes in Invocation api.
5599
5600 2004-07-16  Martin Baulig  <martin@ximian.com>
5601
5602         * iterators.cs: Rewrote this.  We're now using one single Proxy
5603         class for both the IEnumerable and the IEnumerator interface and
5604         `Iterator' derives from Class so we can use the high-level API.
5605
5606         * class.cs (TypeContainer.AddIterator): New method.
5607         (TypeContainer.DoDefineType): New protected virtual method, which
5608         is called from DefineType().
5609         (TypeContainer.DoDefineMembers): Call DefineType() and
5610         DefineMembers() on all our iterators.
5611         (TypeContainer.Emit): Call Emit() on all our iterators.
5612         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5613
5614         * codegen.cs (EmitContext.CurrentIterator): New public field.
5615
5616 2004-07-15  Martin Baulig  <martin@ximian.com>
5617
5618         * typemanager.cs
5619         (TypeManager.not_supported_exception_type): New type.   
5620
5621 2004-07-14  Martin Baulig  <martin@ximian.com>
5622
5623         * iterators.cs: Use real error numbers.
5624
5625 2004-07-14  Martin Baulig  <martin@ximian.com>
5626
5627         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5628         requires this to be a System.Collection.IEnumerable and not a
5629         class implementing that interface.
5630         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5631
5632 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5633
5634         * class.cs: Fixed previous fix, it broke some error tests.
5635
5636 2004-07-12  Martin Baulig  <martin@ximian.com>
5637
5638         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5639         Fixes #61293.
5640
5641 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5642
5643         * assign.cs (LocalTemporary): Add new argument: is_address,If
5644         `is_address' is true, then the value that we store is the address
5645         to the real value, and not the value itself.
5646         
5647         * ecore.cs (PropertyExpr): use the new local temporary
5648         stuff to allow us to handle X.Y += z (where X is a struct)
5649
5650 2004-07-08  Martin Baulig  <martin@ximian.com>
5651
5652         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5653         not always return, just like we're doing in Using.Resolve().
5654
5655 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5656
5657         * cs-parser.jay (fixed_statement): flag this as Pinned.
5658
5659 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5660
5661         * typemanager.cs (TypeManager): Removed MakePinned method, this
5662         mechanism is replaced with the .NET 2.x compatible mechanism of
5663         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5664
5665         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5666         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5667         `IsFixed' property which has a different meaning.
5668
5669 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5670
5671         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5672         visible from inside a nested class, not just the names of the
5673         immediately enclosing class.
5674         Fix for bug #60730.
5675
5676 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5677
5678         * expression.cs (BetterConversion): Remove buggy special-case
5679         handling of "implicit constant expression conversions".  At this
5680         point, we already know that the conversion is possible -- we're
5681         only checking to see which is better.
5682
5683 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5684
5685         * cs-parser.jay: Added error CS0210 test.
5686
5687 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5688
5689         * cs-parser.jay: Added error CS0134 test.
5690
5691 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5692
5693         Fix bug #52507
5694         * cs-parser.jay: Added error CS0145 test.
5695
5696 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5697
5698         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5699
5700 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5701         
5702         * expression.cs (StackAlloc.Resolve): The argument may not
5703         be a constant; deal with this case.
5704         
5705 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5706
5707         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5708         GetIndexerAttributeValue.
5709         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5710
5711         * class.cs (Indexer.Define): Added error tests for CS0415,
5712         CS0609.
5713
5714 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5715
5716         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5717         property code.
5718
5719 2004-06-23  Martin Baulig  <martin@ximian.com>
5720
5721         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5722         neither return nor throw, reset the barrier as well.  Fixes #60457.
5723
5724 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5725
5726         * class.cs : EventAttributes is now set to None by default.
5727           This fixes bug #60459.
5728
5729 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5730
5731         Fix bug #60219
5732         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5733         Don't throw exception but return null (it's sufficient now).
5734
5735 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5736
5737         * typemanager.cs (GetArgumentTypes): Faster implementation.
5738
5739 2004-06-18  Martin Baulig  <martin@ximian.com>
5740
5741         * attribute.cs (Attribute.Resolve): Check whether we're an
5742         EmptyCast which a Constant child.  Fixes #60333.
5743
5744 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5745
5746         * statement.cs (EmitCollectionForeach): Account for the fact that
5747         not all valuetypes are in areas which we can take the address of.
5748         For these variables, we store to a temporary variable. Also, make
5749         sure that we dont emit a `callvirt' on a valuetype method.
5750
5751 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5752
5753         * expression.cs (StackAlloc.DoReSolve): Added test for
5754         negative parameter (CS0247).
5755
5756 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5757
5758         Fix bug #59792
5759         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5760
5761 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5762
5763         Fix bug #59781
5764         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5765         ulong.
5766
5767 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5768
5769         Fix bug #58254 & cs1555.cs, cs1556.cs
5770         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5771
5772 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5773
5774         * cs-parser.jay: Added error CS1669 test for indexers.
5775
5776 2004-06-11  Martin Baulig  <martin@ximian.com>
5777
5778         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5779         call this twice: for params and varargs methods.
5780
5781 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5782
5783         * class.cs:
5784         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5785
5786 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5787
5788         * attribute.cs (Attribute.GetValidTargets): Made public.
5789
5790         * class.cs: 
5791         (AbstractPropertyEventMethod): New class for better code sharing.
5792         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5793         CS1667 report.
5794         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5795
5796 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5797
5798         Fix bug #59477.
5799         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5800         that the call to Resolve is part of a MemberAccess.
5801         (Expression.Resolve): Use it for SimpleName resolution.
5802         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5803         Add 'intermediate' boolean argument.
5804         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5805         error message when the SimpleName can be resolved ambiguously
5806         between an expression and a type.
5807         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5808         public.
5809         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5810         call on the left-side.
5811
5812 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5813
5814         * class.cs:
5815         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5816
5817 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5818
5819         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5820
5821 2004-06-11  Martin Baulig  <martin@ximian.com>
5822
5823         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5824         varargs methods if applicable.
5825
5826 2004-06-11  Martin Baulig  <martin@ximian.com>
5827
5828         * expression.cs (Invocation.EmitCall): Don't use
5829         `method.CallingConvention == CallingConventions.VarArgs' since the
5830         method could also have `CallingConventions.HasThis'.
5831
5832 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5833
5834         * class.cs (Event.GetSignatureForError): Implemented.
5835         Fixed crash in error test cs3010.cs
5836
5837 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5838
5839         * cs-tokenizer.cs: Change the way we track __arglist to be
5840         consistent with the other keywords.
5841
5842 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5843
5844         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5845         tomorrow.
5846
5847 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5848
5849         * codegen.cs: Check that all referenced assemblies have a strongname
5850         before strongnaming the compiled assembly. If not report error CS1577.
5851         Fix bug #56563. Patch by Jackson Harper.
5852         * typemanager.cs: Added a method to return all referenced assemblies.
5853         Fix bug #56563. Patch by Jackson Harper.
5854
5855 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5856
5857         * class.cs:
5858         (Method.ApplyAttributeBuilder): Moved and added conditional
5859         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5860
5861         * delegate.cs:
5862         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5863
5864 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5865
5866         Fixed #59640
5867         * class.cs: (EventField.attribute_targets): Changed default target.
5868
5869 2004-06-08  Martin Baulig  <martin@ximian.com>
5870
5871         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5872
5873 2004-06-08  Martin Baulig  <martin@ximian.com>
5874
5875         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5876
5877 2004-06-07  Martin Baulig  <martin@ximian.com>
5878
5879         Added support for varargs methods.
5880
5881         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5882         keyword.
5883
5884         * cs-parser.jay: Added support for `__arglist'.
5885
5886         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5887
5888         * expression.cs (Argument.AType): Added `ArgList'.
5889         (Invocation): Added support for varargs methods.
5890         (ArglistAccess): New public class.
5891         (Arglist): New public class.
5892
5893         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5894
5895         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5896         a method's top-level block if the method has varargs.
5897
5898         * support.cs (ReflectionParameters, InternalParameters): Added
5899         support for varargs methods.    
5900
5901 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5902
5903         * class.cs: Provide location in indexer error report.
5904
5905         * driver.cs: Use standard names.
5906
5907         * namespace.cs: Catch the use of using after a namespace has been
5908         declared also on using aliases.
5909
5910 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5911
5912         Bug #50820.
5913         * typemanager.cs (closure_private_ok, closure_invocation_type)
5914         (closure_qualifier_type, closure_invocation_assembly)
5915         (FilterWithClosure): Move to ...
5916         (Closure): New internal nested class.
5917         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5918         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5919         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5920         (MemberLookup, MemberLookupFailed): Use it.
5921         * expression.cs (New.DoResolve): Treat the lookup for the
5922         constructor as being qualified by the 'new'ed type.
5923         (Indexers.GetIndexersForTypeOrInterface): Update.
5924
5925 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5926
5927         * attribute.cs
5928         (GetConditionalAttributeValue): New method. Returns
5929         condition of ConditionalAttribute.
5930         (SearchMulti): New method.  Returns all attributes of type 't'.
5931         Use it when attribute is AllowMultiple = true.
5932         (IsConditionalMethodExcluded): New method.
5933
5934         * class.cs
5935         (Method.IsExcluded): Implemented. Returns true if method has conditional
5936         attribute and the conditions is not defined (method is excluded).
5937         (IMethodData): Extended interface for ConditionalAttribute support.
5938         (PropertyMethod.IsExcluded): Implemented.
5939
5940         * decl.cs
5941         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5942
5943         * expression.cs
5944         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5945         on the method.
5946
5947 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5948
5949         * expression.cs (ArrayCreationExpression): Make this just an
5950         `expression'. It can't be a statement, so the code here was
5951         dead.
5952
5953 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5954
5955         Fixed #59072
5956         * typemanager.cs (GetFullNameSignature): New method for
5957         MethodBase types.
5958
5959 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5960
5961         Fixed #56452
5962         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5963         Use this method when MethodBuilder is null.
5964         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5965         Added test for error CS0626 (MONO reports error for this situation).
5966         (IMethodData.GetSignatureForError): Extended interface.
5967
5968 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5969
5970         * attribute.cs
5971         (AttributeTester.GetObsoleteAttribute): Returns instance of
5972         ObsoleteAttribute when type is obsolete.
5973
5974         * class.cs
5975         (TypeContainer.VerifyObsoleteAttribute): Override.
5976         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5977         (MethodCode.VerifyObsoleteAttribute): Override.
5978         (MemberBase.VerifyObsoleteAttribute): Override.
5979
5980         * decl.cs
5981         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5982         and report proper error.
5983
5984         *delegate.cs
5985         Delegate.VerifyObsoleteAttribute): Override.
5986
5987         * ecore.cs
5988         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5989         and report proper error.
5990         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5991
5992         * enum.cs
5993         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5994         and enum member.
5995
5996         * expression.cs
5997         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5998         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5999         Added test for ObsoleteAttribute.
6000
6001         * statement.cs
6002         (Catch): Derived from Statement.
6003
6004 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6005  
6006         Fixed bug #59071 & cs0160.cs
6007  
6008         * statement.cs (Try.Resolve): Check here whether order of catch
6009         clauses matches their dependencies.
6010
6011 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6012
6013         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6014         caused a regression: #59343.  Referencing nested classes from an
6015         assembly stopped working.
6016
6017 2004-05-31  Martin Baulig  <martin@ximian.com>
6018
6019         MCS is now frozen for beta 2.
6020
6021 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6022
6023         * convert.cs: add a trivial cache for overload operator resolution.
6024
6025 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6026
6027         * decl.cs: If possible, use lookuptypedirect here. We can only do
6028         this if there is no `.' after the namespace. Avoids using
6029         LookupType, which does lots of slow processing.
6030         (FindNestedType) New method, does what it says :-).
6031         * namespace.cs: use LookupTypeDirect.
6032         * rootcontext.cs: use membercache, if possible.
6033         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6034
6035 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6036
6037         * expression.cs:
6038         According to the spec, 
6039
6040         In a member access of the form E.I, if E is a single identifier,
6041         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6042         field, property, localvariable, or parameter with the same type as
6043         the meaning of E as a type-name (§3.8), then both possible
6044         meanings of E are permitted.
6045
6046         We did not check that E as a simple-name had the same type as E as
6047         a type name.
6048
6049         This trivial check gives us 5-7% on bootstrap time.
6050
6051 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6052
6053         * expression.cs (Invocation.OverloadResolve): Avoid the
6054         use of hashtables and boxing here by allocating on demand.
6055
6056 2004-05-30  Martin Baulig  <martin@ximian.com>
6057
6058         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6059         we're doing a silent lookup.  Don't try to lookup nested types in
6060         TypeManager.object_type (thanks to Ben Maurer).
6061
6062 2004-05-30  Martin Baulig  <martin@ximian.com>
6063
6064         Committing a patch from Ben Maurer.
6065
6066         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6067
6068 2004-05-29  Martin Baulig  <martin@ximian.com>
6069
6070         * class.cs (IMethodData.ShouldIgnore): New method.
6071
6072         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6073         `Location' argument, we don't need it anywhere.  Use
6074         `IMethodData.ShouldIgnore ()' instead of
6075         `MethodData.GetMethodFlags ()'.
6076         (TypeManager.AddMethod): Removed.
6077         (TypeManager.AddMethod2): Renamed to AddMethod.
6078
6079 2004-05-29  Martin Baulig  <martin@ximian.com>
6080
6081         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6082
6083         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6084         converting from a class type S to an interface type and we already
6085         have an object on the stack, don't box it again.  Fixes #52578.
6086
6087 2004-05-29  Martin Baulig  <martin@ximian.com>
6088
6089         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6090         Added support for `params' parameters.  Fixes #59267.
6091
6092 2004-05-29  Martin Baulig  <martin@ximian.com>
6093
6094         * literal.cs (NullPointer): Provide a private .ctor which sets
6095         `type' to TypeManager.object_type.  Fixes #59048.
6096
6097 2004-05-29  Martin Baulig  <martin@ximian.com>
6098
6099         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6100         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6101
6102         * ecore.cs (EventExpr.instance_expr): Make the field private.
6103
6104 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6105
6106         Fixed bug #50080 & cs0214-2.cs
6107         * expression.cs (Cast.DoResolve): Check unsafe context here.
6108         
6109         * statement.cs (Resolve.DoResolve): Likewise.
6110
6111 2004-05-26  Martin Baulig  <martin@ximian.com>
6112
6113         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6114
6115         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6116         (RootContext.LookupType): Pass down the `silent' flag.
6117
6118 2004-05-25  Martin Baulig  <martin@ximian.com>
6119
6120         * expression.cs
6121         (MethodGroupExpr.IdenticalTypeName): New public property.
6122         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6123         expression actually refers to a type.
6124
6125 2004-05-25  Martin Baulig  <martin@ximian.com>
6126
6127         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6128         for #56176 and made it actually work.
6129
6130 2004-05-25  Martin Baulig  <martin@ximian.com>
6131
6132         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6133         (FieldExpr, PropertyExpr): Override and implement
6134         CacheTemporaries.  Fixes #52279.
6135
6136 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6137
6138         * location.cs: In the new compiler listing a file twice is a
6139         warning, not an error.
6140
6141 2004-05-24  Martin Baulig  <martin@ximian.com>
6142
6143         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6144         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6145
6146 2004-05-24  Martin Baulig  <martin@ximian.com>
6147
6148         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6149         walking the `using' list.  Fixes #53921.
6150
6151 2004-05-24  Martin Baulig  <martin@ximian.com>
6152
6153         * const.cs (Const.LookupConstantValue): Added support for
6154         EmptyCast's; fixes #55251.
6155
6156 2004-05-24  Martin Baulig  <martin@ximian.com>
6157
6158         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6159         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6160         which does the CS0135 check.  The reason is that we first need to
6161         check whether the variable actually exists.
6162
6163 2004-05-24  Martin Baulig  <martin@ximian.com>
6164
6165         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6166         than RootContext.LookupType() to find the explicit interface
6167         type.  Fixes #58584.
6168
6169 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6170
6171         * Makefile: Simplify.  Use executable.make.
6172         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6173
6174 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6175
6176         * decl.cs:
6177         * enum.cs:
6178         Use the invariant culture when doing String.Compare for CLS case
6179         sensitivity.
6180         
6181 2004-05-23  Martin Baulig  <martin@ximian.com>
6182
6183         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6184         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6185
6186         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6187         
6188 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6189
6190         * class.cs (MemberBase.Define): Reuse MemberType member for 
6191         resolved type. Other methods can use it too.
6192
6193 2004-05-23  Martin Baulig  <martin@ximian.com>
6194
6195         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6196         the variable also exists in the current block (otherwise, we need
6197         to report a CS0103).  Fixes #58670.
6198
6199 2004-05-23  Martin Baulig  <martin@ximian.com>
6200
6201         * flowanalysis.cs (Reachability.Reachable): Compute this
6202         on-the-fly rather than storing it as a field.
6203
6204 2004-05-23  Martin Baulig  <martin@ximian.com>
6205
6206         * flowanalysis.cs (Reachability.And): Manually compute the
6207         resulting `barrier' from the reachability.      
6208        
6209 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6210
6211         Fix bug #57835
6212         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6213         instance of ObsoleteAttribute when symbol is obsolete.
6214
6215         * class.cs
6216         (IMethodData): Extended interface for ObsoleteAttribute support.
6217
6218 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6219
6220         * attribute.cs: Fix bug #55970
6221
6222 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6223
6224         Fix bug #52705
6225         * attribute.cs
6226         (GetObsoleteAttribute): New method. Creates the instance of
6227         ObsoleteAttribute.
6228         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6229         ObsoleteAttribute when member is obsolete.
6230         (AttributeTester.Report_ObsoleteMessage): Common method for
6231         Obsolete error/warning reporting.
6232
6233         * class.cs
6234         (TypeContainer.base_classs_type): New member for storing parent type.
6235
6236         * decl.cs
6237         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6238         for this MemberCore.
6239
6240 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6241
6242         * attribute.cs, const.cs: Fix bug #58590
6243
6244 2004-05-21  Martin Baulig  <martin@ximian.com>
6245
6246         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6247         out parameters if the end of the method is unreachable.  Fixes
6248         #58098. 
6249
6250 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6251
6252         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6253         Hari was right, why extra method.
6254
6255 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6256
6257         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6258
6259 2004-05-20  Martin Baulig  <martin@ximian.com>
6260
6261         Merged this back from gmcs to keep the differences to a minumum.
6262
6263         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6264         instead of a Declspace.
6265         (Attribute.ResolveType): Likewise.
6266         (Attributes.Search): Likewise.
6267         (Attributes.Contains): Likewise.
6268         (Attributes.GetClsCompliantAttribute): Likewise.
6269
6270         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6271         argument.
6272         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6273         DeclSpace.
6274
6275 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6276
6277         Fix bug #58688 (MCS does not report error when the same attribute
6278         is assigned twice)
6279
6280         * attribute.cs (Attribute.Emit): Distinction between null and default.
6281
6282 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6283
6284         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6285         of a top-level attribute without an attribute target.
6286         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6287         Make non-static.
6288         (Attribute.Conditional_GetConditionName), 
6289         (Attribute.Obsolete_GetObsoleteMessage): Update.
6290         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6291         part of ScanForIndexerName.
6292         (Attribute.CanIgnoreInvalidAttribute): New function.
6293         (Attribute.ScanForIndexerName): Move to ...
6294         (Attributes.ScanForIndexerName): ... here.
6295         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6296         (Attributes.Search): New internal variant that can choose not to
6297         complain if types aren't resolved.  The original signature now
6298         complains.
6299         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6300         complaints suppressed.
6301         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6302         only if it not useful.
6303         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6304         top-level for attributes that are shared between the assembly
6305         and a top-level class.
6306         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6307         * class.cs: Update to reflect changes.
6308         (DefineIndexers): Fuse loops.
6309         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6310         a couple more variants of attribute names.
6311
6312 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6313
6314         Fix bug #52585 (Implemented explicit attribute declaration)
6315
6316         * attribute.cs:
6317         (Attributable.ValidAttributeTargets): New abstract method. It gets
6318         list of valid attribute targets for explicit target declaration.
6319         (Attribute.Target): It holds target itself.
6320         (AttributeSection): Removed.
6321         (Attribute.CheckTargets): New method. It checks whether attribute
6322         target is valid for the current element.
6323
6324         * class.cs:
6325         (EventProperty): New class. For events that are declared like
6326         property (with add and remove accessors).
6327         (EventField): New class. For events that are declared like field.
6328         class.cs
6329
6330         * cs-parser.jay: Implemented explicit attribute target declaration.
6331
6332         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6333         Override ValidAttributeTargets.
6334
6335         * parameter.cs:
6336         (ReturnParameter): Class for applying custom attributes on 
6337         the return type.
6338         (ParameterAtribute): New class. Class for applying custom
6339         attributes on the parameter type.
6340
6341 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6342
6343         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6344         definitions. 
6345
6346         (Method): Allow UNSAFE here.
6347
6348         * modifiers.cs: Support unsafe reporting.
6349
6350 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6351
6352         * decl.cs: Fix bug #58478.
6353
6354 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6355
6356         * statement.cs: When checking for unreachable code on an EmptyStatement,
6357         set the location. Fixes bug #58488.
6358
6359 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6360
6361         * driver.cs: Add -pkg handling.
6362
6363         From Gonzalo: UseShelLExecute=false
6364
6365 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6366
6367         * attribute.cs:
6368         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6369         for attribute.
6370         (Attribute.IsClsCompliaceRequired): Moved to base for better
6371         accesibility.
6372         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6373         when attribute is AttributeUsageAttribute.
6374         (Attribute.GetValidTargets): Simplified.
6375         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6376         attribute for this type.
6377         (Attribute.ApplyAttributes): Method renamed to Emit and make
6378         non-static.
6379         (GlobalAttributeSection): New class for special handling of global
6380         attributes (assembly, module).
6381         (AttributeSection.Emit): New method.
6382
6383         * class.cs: Implemented Attributable abstract methods.
6384         (MethodCore.LabelParameters): Moved to Parameter class.
6385         (Accessor): Is back simple class.
6386         (PropertyMethod): Implemented Attributable abstract class.
6387         (DelegateMethod): Implemented Attributable abstract class.
6388         (Event): New constructor for disctintion between normal Event
6389         and Event with accessors.
6390
6391         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6392
6393         * codegen.cs, const.cs, decl.cs, delegate.cs:
6394         (CommonAssemblyModulClass): Implemented Attributable abstract class
6395         and simplified.
6396
6397         * enum.cs: Implement IAttributeSupport interface.
6398         (EnumMember): New class for emum members. Implemented Attributable
6399         abstract class
6400
6401         * parameter.cs:
6402         (ParameterBase): Is abstract.
6403         (ReturnParameter): New class for easier [return:] attribute handling.
6404
6405         * typemanager.cs: Removed builder_to_attr.
6406
6407 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6408
6409         Fix bug #57151.
6410         * attribute.cs (Attribute.GetPositionalValue): New function.
6411         * class.cs (TypeContainer.VerifyMembers): New function.
6412         (TypeContainer.Emit): Use it.
6413         (ClassOrStruct): New base class for Class and Struct.
6414         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6415         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6416         class.
6417         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6418         then each non-static field should have a FieldOffset attribute.
6419         Otherwise, none of the fields should have a FieldOffset attribute.
6420         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6421         and FieldOffset attributes.
6422         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6423         (TypeManager.field_offset_attribute_type): New core types.
6424         (TypeManager.InitCoreTypes): Initialize them.
6425
6426 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6427
6428         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6429         Return correct type.
6430         From bug #58270.
6431
6432 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6433
6434         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6435         be implicitly converted to ulong.
6436         
6437         * expression.cs: The logic for allowing operator &, | and ^ worked
6438         was wrong, it worked before because we did not report an error in
6439         an else branch.  Fixes 57895.
6440
6441         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6442         allow volatile fields to be reference types.
6443
6444 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6445
6446         * driver.cs: Add support for /debug-
6447
6448 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6449
6450         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6451         Add a 'complain' parameter to silence errors.
6452         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6453         silently overlooked type-resolutions.
6454         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6455         to reflect changes.
6456         (Attributes.Search): New function.
6457         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6458         (Attributes.GetAttributeFullName): Remove hack.
6459         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6460         Update to reflect changes.
6461         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6462         Use Attributes.Search instead of nested loops.
6463
6464 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6465
6466         * decl.cs:
6467         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6468         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6469         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6470
6471         * report.cs: (Report.Warning): Renamed to Warning_T because of
6472         parameter collision.
6473
6474 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6475
6476         * expression.cs (MemberAccess.ResolveMemberAccess):
6477         Exit with non-zero status after Report.Error.
6478         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6479         Likewise.
6480         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6481
6482 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6483
6484         * support.cs: Don't hang when the file is empty.
6485
6486 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6487
6488         * support.cs: In SeekableStreamReader, compute the preamble size of the
6489           underlying stream. Position changes should take into account that initial
6490           count of bytes.
6491
6492 2004-05-03  Todd Berman  <tberman@sevenl.net>
6493
6494         * driver.cs: remove unused GetSysVersion function.
6495
6496 2004-05-03  Todd Berman  <tberman@sevenl.net>
6497
6498         * driver.cs: Remove the hack from saturday, as well as the hack
6499         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6500         link_paths to get that bit proper.
6501
6502 2004-05-01  Todd Berman  <tberman@sevenl.net>
6503
6504         * driver.cs: Try a LoadFrom before a Load, this checks the current
6505         path. This is currently a bug in mono that is be fixed, however, this
6506         provides a workaround for now. This will be removed when the bug
6507         is fixed.
6508
6509 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6510
6511         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6512         incomplete key pairs (#57941).
6513
6514 2004-05-01  Todd Berman  <tberman@sevenl.net>
6515
6516         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6517         from the GAC
6518
6519 2004-04-30  Jackson Harper  <jackson@ximian.com>
6520
6521         * codegen.cs: Open keys readonly.
6522         
6523 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6524
6525         * typemanager.cs: don't report cyclic struct layout when a struct
6526         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6527         which has 2 Pango.Rectangle fields.
6528
6529 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6530
6531         * expression.cs: Handle IntPtr comparisons with IL code
6532         rather than a method call.
6533
6534 2004-04-29  Martin Baulig  <martin@ximian.com>
6535
6536         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6537         the list of PropertyInfo's in class hierarchy and find the
6538         accessor.  Fixes #56013.
6539
6540 2004-04-29  Martin Baulig  <martin@ximian.com>
6541
6542         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6543
6544 2004-04-29  Martin Baulig  <martin@ximian.com>
6545
6546         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6547
6548         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6549
6550 2004-04-29  Martin Baulig  <martin@ximian.com>
6551
6552         * class.cs (ConstructorInitializer.Resolve): Check whether the
6553         parent .ctor is accessible.  Fixes #52146.
6554
6555 2004-04-29  Martin Baulig  <martin@ximian.com>
6556
6557         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6558
6559         * statement.cs (Using.EmitLocalVariableDecls): Use
6560         TypeManager.idisposable_type, not typeof (IDisposable).
6561         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6562
6563 2004-04-29  Martin Baulig  <martin@ximian.com>
6564
6565         * class.cs (Event.Define): Don't emit the field and don't set
6566         RTSpecialName and SpecialName for events on interfaces.  Fixes
6567         #57703. 
6568
6569 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6570
6571         Refactor Attribute.ApplyAttributes.
6572         * attribute.cs (Attributable): New base class for objects that can
6573         have Attributes applied on them.
6574         (Attribute): Make AttributeUsage fields public.
6575         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6576         (Attribute.IsInternalCall): New property.
6577         (Attribute.UsageAttr): Convert to a public read-only property.
6578         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6579         (Attribute.ResolveType, Attribute.Resolve)
6580         (Attribute.ScanForIndexerName): Update to reflect changes.
6581         (Attribute.CheckAttributeTarget): Re-format.
6582         (Attribute.ApplyAttributes): Refactor, to various
6583         Attributable.ApplyAttributeBuilder methods.
6584         * decl.cs (MemberCore): Make Attributable.
6585         * class.cs (Accessor): Make Attributable.
6586         (MethodData.ApplyAttributes): Use proper attribute types, not
6587         attribute names.
6588         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6589         (TypeContainer.ApplyAttributeBuilder)
6590         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6591         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6592         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6593         (Operator.ApplyAttributeBuilder): New factored-out methods.
6594         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6595         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6596         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6597         * parameter.cs (ParameterBase): New Attributable base class
6598         that can also represent Return types.
6599         (Parameter): Update to the changes.
6600
6601 2004-04-29  Jackson Harper  <jackson@ximian.com>
6602
6603         * driver.cs: Prefer the corlib system version when looking for
6604         assemblies in the GAC. This is still a hack, but its a better hack
6605         now.
6606         
6607 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6608
6609         * decl.cs, enum.cs: Improved error 3005 reporting.
6610   
6611         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6612         (related_symbols): New private member for list of symbols
6613         related to reported error/warning.
6614         
6615         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6616
6617 2004-04-29  Martin Baulig  <martin@ximian.com>
6618
6619         * ecore.cs (Expression.Constantify): If we're an enum and
6620         TypeManager.TypeToCoreType() doesn't give us another type, use
6621         t.UnderlyingSystemType.  Fixes #56178.  
6622
6623 2004-04-29  Martin Baulig  <martin@ximian.com>
6624
6625         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6626         interfaces and for each interface, only add members directly
6627         declared in that interface.  Fixes #53255.
6628
6629 2004-04-28  Martin Baulig  <martin@ximian.com>
6630
6631         * expression.cs (ConditionalLogicalOperator): Use a temporary
6632         variable for `left' to avoid that we evaluate it more than once;
6633         bug #52588.
6634
6635 2004-04-28  Martin Baulig  <martin@ximian.com>
6636
6637         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6638         `void[]' (CS1547).
6639
6640 2004-04-28  Martin Baulig  <martin@ximian.com>
6641
6642         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6643         void (CS1547).
6644
6645         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6646         whether the type is not void (CS1547).
6647
6648 2004-04-28  Martin Baulig  <martin@ximian.com>
6649
6650         * expression.cs (Unary.DoResolveLValue): Override this and report
6651         CS0131 for anything but Operator.Indirection.
6652
6653 2004-04-28  Martin Baulig  <martin@ximian.com>
6654
6655         Committing a patch from Ben Maurer; see bug #50820.
6656
6657         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6658         check for classes.
6659
6660         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6661         classes.        
6662
6663 2004-04-28  Martin Baulig  <martin@ximian.com>
6664
6665         Committing a patch from Ben Maurer; see bug #50820.
6666
6667         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6668         check for classes.
6669
6670         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6671         classes.        
6672
6673 2004-04-28  Martin Baulig  <martin@ximian.com>
6674
6675         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6676         (Block.AddLabel): Call DoLookupLabel() to only search in the
6677         current block.
6678
6679 2004-04-28  Martin Baulig  <martin@ximian.com>
6680
6681         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6682         comparing StringConstants and NullLiterals in Equality and Inequality.
6683
6684 2004-04-28  Jackson Harper  <jackson@ximian.com>
6685
6686         * driver.cs: Attempt to load referenced assemblies from the
6687         GAC. This is the quick and dirty version of this method that
6688         doesnt take into account versions and just takes the first
6689         canidate found. Will be good enough for now as we will not have more
6690         then one version installed into the GAC until I update this method.
6691
6692 2004-04-28  Martin Baulig  <martin@ximian.com>
6693
6694         * typemanager.cs (TypeManager.CheckStructCycles): New public
6695         static method to check for cycles in the struct layout.
6696
6697         * rootcontext.cs (RootContext.PopulateTypes): Call
6698         TypeManager.CheckStructCycles() for each TypeContainer.
6699         [Note: We only need to visit each type once.]
6700
6701 2004-04-28  Martin Baulig  <martin@ximian.com>
6702
6703         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6704
6705         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6706         success and added `out object value'.  Use a `bool resolved' field
6707         to check whether we've already been called rather than
6708         `ConstantValue != null' since this breaks for NullLiterals.
6709
6710 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6711
6712         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6713         setting of this flag, since the 'set' method may be non-public.
6714
6715 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6716
6717         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6718         check on current_vector.Block.
6719
6720 2004-04-27  Martin Baulig  <martin@ximian.com>
6721
6722         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6723         a field initializer.  Fixes #56459.
6724
6725 2004-04-27  Martin Baulig  <martin@ximian.com>
6726
6727         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6728         we're not attempting to use an indexer.  Fixes #52154.
6729
6730 2004-04-27  Martin Baulig  <martin@ximian.com>
6731
6732         * statement.cs (Return): Don't create a return label if we don't
6733         need it; reverts my change from January 20th.  Thanks to Ben
6734         Maurer for this.
6735
6736 2004-04-27  Martin Baulig  <martin@ximian.com>
6737
6738         According to the spec, `goto' can only leave a nested scope, but
6739         never enter it.
6740
6741         * statement.cs (Block.LookupLabel): Only lookup in the current
6742         block, don't recurse into parent or child blocks.
6743         (Block.AddLabel): Check in parent and child blocks, report
6744         CS0140/CS0158 if we find a duplicate.
6745         (Block): Removed this indexer for label lookups.
6746         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6747         this already does the error reporting for us.
6748
6749         * flowanalysis.cs
6750         (FlowBranching.UsageVector.Block): New public variable; may be null.
6751         (FlowBranching.CreateSibling): Added `Block' argument.
6752         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6753         label for the target of a `goto' and check whether we're not
6754         leaving a `finally'.
6755
6756 2004-04-27  Martin Baulig  <martin@ximian.com>
6757
6758         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6759         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6760         just for returns).
6761
6762 2004-04-27  Martin Baulig  <martin@ximian.com>
6763
6764         * statement.cs (Block.AddLabel): Also check for implicit blocks
6765         and added a CS0158 check.
6766
6767 2004-04-27  Martin Baulig  <martin@ximian.com>
6768
6769         * flowanalysis.cs (FlowBranchingLoop): New class.
6770         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6771         UsageVector's instead of an ArrayList.
6772         (FlowBranching.Label): Likewise.
6773         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6774         (FlowBranching.AddBreakVector): New method.
6775
6776 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6777
6778         * attribute.cs: Small regression fix: only convert the type if we
6779         the type is different, fixes System.Drawing build.
6780
6781 2004-04-27  Martin Baulig  <martin@ximian.com>
6782
6783         * attribute.cs (Attribute.Resolve): If we have a constant value
6784         for a named field or property, implicity convert it to the correct
6785         type.
6786
6787 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6788
6789         * statement.cs (Block.Block): Implicit blocks share
6790         'child_variable_names' fields with parent blocks.
6791         (Block.AddChildVariableNames): Remove.
6792         (Block.AddVariable): Mark variable as "used by a child block" in
6793         every surrounding block.
6794         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6795         been used in a child block, complain about violation of "Invariant
6796         meaning in blocks" rule.
6797         * cs-parser.jay (declare_local_variables): Don't use
6798         AddChildVariableNames.
6799         (foreach_statement): Don't create an implicit block: 'foreach'
6800         introduces a scope.
6801
6802 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6803
6804         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6805         converting from 0L to ulong.  Fixes 57522.
6806
6807 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6808
6809         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6810         derived class hides via 'new' keyword field from base class (test-242.cs).
6811         TODO: Handle this in the more general way.
6812         
6813         * class.cs (CheckBase): Ditto.
6814
6815 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6816
6817         * decl.cs (caching_flags): New member for storing cached values
6818         as bit flags.
6819         (MemberCore.Flags): New enum where bit flags for caching_flags
6820         are defined.
6821         (MemberCore.cls_compliance): Moved to caching_flags.
6822         (DeclSpace.Created): Moved to caching_flags.
6823
6824         * class.cs: Use caching_flags instead of DeclSpace.Created
6825         
6826 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6827
6828         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6829         if we are only a derived class, not a nested class.
6830
6831         * typemanager.cs: Same as above, but do this at the MemberLookup
6832         level (used by field and methods, properties are handled in
6833         PropertyExpr).   Allow for the qualified access if we are a nested
6834         method. 
6835
6836 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6837
6838         * class.cs: Refactoring.
6839         (IMethodData): New inteface; Holds links to parent members
6840         to avoid member duplication (reduced memory allocation).
6841         (Method): Implemented IMethodData interface.
6842         (PropertyBase): New inner classes for get/set methods.
6843         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6844         (Event): New inner classes for add/remove methods.
6845         (Event.DelegateMethod): Implemented IMethodData interface.
6846
6847         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6848         EmitContext (related to class.cs refactoring).
6849
6850 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6851
6852         * delegate.cs (Delegate.VerifyApplicability): If the number of
6853         arguments are the same as the number of parameters, first try to
6854         verify applicability ignoring  any 'params' modifier on the last
6855         parameter.
6856         Fixes #56442.
6857
6858 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6859
6860         * class.cs (TypeContainer.AddIndexer): Use
6861         'ExplicitInterfaceName' to determine if interface name was
6862         explicitly specified.  'InterfaceType' is not initialized at this time.
6863         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6864         Indexers array is already in the required order.  Initialize
6865         'IndexerName' only if there are normal indexers.
6866         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6867         (TypeContainer.Emit): Emit DefaultMember attribute only if
6868         IndexerName is initialized.
6869         Fixes #56300.
6870
6871 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6872
6873         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6874         Fixes #57007
6875
6876 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6877
6878         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6879         attributes.
6880         Fix for #56456.
6881
6882         * attribute.cs (Attribute.Resolve): Check for duplicate named
6883         attributes.
6884         Fix for #56463.
6885
6886 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6887
6888         * iterators.cs (MarkYield): track whether we are in an exception,
6889         and generate code accordingly.  Use a temporary value to store the
6890         result for our state.
6891
6892         I had ignored a bit the interaction of try/catch with iterators
6893         since their behavior was not entirely obvious, but now it is
6894         possible to verify that our behavior is the same as MS .NET 2.0
6895
6896         Fixes 54814
6897
6898 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6899
6900         * iterators.cs: Avoid creating temporaries if there is no work to
6901         do. 
6902
6903         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6904         Enumerations, use TypeManager.EnumToUnderlying and call
6905         recursively. 
6906
6907         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6908         bug #57013
6909
6910         (This.Emit): Use EmitContext.EmitThis to emit our
6911         instance variable.
6912
6913         (This.EmitAssign): Ditto.
6914
6915         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6916         codepaths, we will move all the functionality into
6917         Mono.CSharp.This 
6918
6919         (FieldExpr.EmitAssign): Ditto.
6920
6921         This fixes several hidden bugs that I uncovered while doing a code
6922         review of this today.
6923
6924         * codegen.cs (EmitThis): reworked so the semantics are more clear
6925         and also support value types "this" instances.
6926
6927         * iterators.cs: Changed so that for iterators in value types, we
6928         do not pass the value type as a parameter.  
6929
6930         Initialization of the enumerator helpers is now done in the caller
6931         instead of passing the parameters to the constructors and having
6932         the constructor set the fields.
6933
6934         The fields have now `assembly' visibility instead of private.
6935
6936 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6937
6938         * expression.cs (Argument.Resolve): Check if fields passed as ref
6939         or out are contained in a MarshalByRefObject.
6940
6941         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6942         another compiler type.
6943
6944 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6945
6946         * class.cs (Indexer.Define): use the new name checking method.
6947         Also, return false on an error.
6948         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6949         (is_identifier_[start/part]_character): make static.
6950
6951 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6952
6953         * expression.cs (Binary.ResolveOperator): Do no append strings
6954         twice: since we can be invoked more than once (array evaluation)
6955         on the same concatenation, take care of this here.  Based on a fix
6956         from Ben (bug #56454)
6957
6958 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6959
6960         * codegen.cs: Fix another case where CS1548 must be reported (when 
6961         delay-sign isn't specified and no private is available #56564). Fix
6962         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6963         error when MCS is used on the MS runtime and we need to delay-sign 
6964         (which seems unsupported by AssemblyBuilder - see #56621).
6965
6966 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6967
6968         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6969         (TypeManager.ComputeNamespaces): Faster implementation for
6970         Microsoft runtime.
6971
6972         * compiler.csproj: Updated AssemblyName to mcs.
6973
6974 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6975
6976         * rootcontext.cs: Add new types to the boot resolution.
6977
6978         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6979         MulticastDelegate is not allowed.
6980
6981         * typemanager.cs: Add new types to lookup: System.TypedReference
6982         and ArgIterator.
6983
6984         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6985         check for TypedReference or ArgIterator, they are not allowed. 
6986
6987         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6988         makes us properly catch 1510 in some conditions (see bug 56016 for
6989         details). 
6990
6991 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6992
6993         * CryptoConvert.cs: update from corlib version
6994         with endian fixes.
6995
6996 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6997
6998         * class.cs (Indexer.Define): Check indexername declaration
6999
7000 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7001
7002         * attribute.cs (IsClsCompliant): Fixed problem with handling
7003         all three states (compliant, not-compliant, undetected).
7004
7005 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7006
7007         * attribute.cs (Attribute): Location is now public.
7008         (Resolve): Store resolved arguments (pos_values) in attribute class.
7009         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7010         (GetClsCompliantAttributeValue): New method that gets
7011         CLSCompliantAttribute value.
7012         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7013         if exists else null.
7014         (AttributeTester): New class for CLS-Compliant verification routines.
7015
7016         * class.cs (Emit): Add CLS-Compliant verification.
7017         (Method.GetSignatureForError): Implemented.
7018         (Constructor.GetSignatureForError): Implemented
7019         (Constructor.HasCompliantArgs): Returns if constructor has
7020         CLS-Compliant arguments.
7021         (Constructor.Emit): Override.
7022         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7023         is needed to test only parameters.
7024         (FieldBase.GetSignatureForError): Implemented.
7025         (TypeContainer): New member for storing base interfaces.
7026         (TypeContainer.FindMembers): Search in base interfaces too.
7027
7028         * codegen.cs (GetClsComplianceAttribute): New method that gets
7029         assembly or module CLSCompliantAttribute value.
7030         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7031         for assembly.
7032         (ModuleClass.Emit): Add error 3012 test.
7033
7034         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7035
7036         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7037         state for all decl types.
7038         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7039         if CLS-Compliant tests are required.
7040         (IsClsCompliaceRequired): New method. Analyze whether code
7041         must be CLS-Compliant.
7042         (IsExposedFromAssembly): New method. Returns true when MemberCore
7043         is exposed from assembly.
7044         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7045         value or gets cached value.
7046         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7047         is explicitly marked with CLSCompliantAttribute.
7048         (IsIdentifierClsCompliant): New abstract method. This method is
7049         used to testing error 3005.
7050         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7051         for identifier and parameters CLS-Compliant testing.
7052         (VerifyClsCompliance): New method. The main virtual method for
7053         CLS-Compliant verifications.
7054         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7055         null. I don't know why is null (too many public members !).
7056         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7057         and get value of first CLSCompliantAttribute that found.
7058
7059         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7060         (VerifyClsCompliance): Override and add extra tests.
7061
7062         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7063         clscheck- disable CLS-Compliant verification event if assembly is has
7064         CLSCompliantAttribute(true).
7065
7066         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7067         ApllyAttribute is now called in emit section as in the other cases.
7068         Possible future Emit integration.
7069         (IsIdentifierClsCompliant): New override.
7070         (VerifyClsCompliance): New override.
7071         (GetEnumeratorName): Returns full enum name.
7072
7073         * parameter.cs (GetSignatureForError): Implemented.
7074
7075         * report.cs (WarningData): New struct for Warning message information.
7076         (LocationOfPreviousError): New method.
7077         (Warning): New method. Reports warning based on the warning table.
7078         (Error_T): New method. Reports error based on the error table.
7079
7080         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7081         verifications are done here.
7082
7083         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7084
7085         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7086         CLSCompliantAttribute.
7087         (all_imported_types): New member holds all imported types from other
7088         assemblies.
7089         (LoadAllImportedTypes): New method fills static table with exported types
7090         from all referenced assemblies.
7091         (Modules): New property returns all assembly modules.
7092
7093 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7094
7095         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7096         throwing a parser error.
7097
7098         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7099         which removes the hardcoded get_/set_ prefixes for properties, as
7100         IL allows for the properties to be named something else.  
7101
7102         Bug #56013
7103
7104         * expression.cs: Do not override operand before we know if it is
7105         non-null.  Fix 56207
7106
7107 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7108
7109         * typemanager.cs: support for pinned variables.
7110
7111 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7112
7113         * decl.cs, typemanager.cs: Avoid using an arraylist
7114         as a buffer if there is only one result set.
7115
7116 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7117
7118         * expression.cs: Make sure you cant call a static method
7119         with an instance expression, bug #56174.
7120
7121 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7122
7123         * class.cs (IsDuplicateImplementation): Improve error reporting to
7124         flag 663 (method only differs in parameter modifier).
7125
7126         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7127         in preprocessor directives.
7128
7129         * location.cs (LookupFile): Allow for the empty path.
7130
7131         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7132         better approach for some of that patch, but its failing with the
7133         CharSet enumeration.  For now try/catch will do.
7134
7135         * typemanager.cs: Do not crash if a struct does not have fields.
7136         Fixes 56150.
7137
7138 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7139
7140         * expression.cs: cs0213, cant fix a fixed expression.
7141         fixes 50231.
7142
7143 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7144
7145         * cs-parser.jay: detect invalid embeded statements gracefully.
7146         bug #51113.
7147
7148 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7149
7150         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7151         As a regex:
7152         s/
7153         the invocation type may not be a subclass of the tye of the item/
7154         The type of the item must be a subclass of the invocation item.
7155         /g
7156
7157         Fixes bug #50820.
7158
7159 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7160
7161         * attribute.cs: Added methods to get a string and a bool from an
7162         attribute. Required to information from AssemblyKeyFileAttribute,
7163         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7164         * codegen.cs: Modified AssemblyName creation to include support for
7165         strongnames. Catch additional exceptions to report them as CS1548.
7166         * compiler.csproj: Updated include CryptoConvert.cs.
7167         * compiler.csproj.user: Removed file - user specific configuration.
7168         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7169         Mono.Security assembly. The original class is maintained and tested in
7170         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7171         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7172         like CSC 8.0 (C# v2) supports.
7173         * Makefile: Added CryptoConvert.cs to mcs sources.
7174         * rootcontext.cs: Added new options for strongnames.
7175
7176 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7177
7178         * driver.cs: For --expect-error, report error code `2'
7179         if the program compiled with no errors, error code `1' if
7180         it compiled with an error other than the one expected.
7181
7182 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7183
7184         * compiler.csproj: Updated for Visual Studio .NET 2003.
7185         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7186         * compiler.sln: Updated for Visual Studio .NET 2003.
7187
7188 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7189
7190         * expression.cs: Fix bug #47234. We basically need to apply the
7191         rule that we prefer the conversion of null to a reference type
7192         when faced with a conversion to 'object' (csc behaviour).
7193
7194 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7195
7196         * statement.cs: Shorter form for foreach, eliminates
7197         a local variable. r=Martin.
7198
7199 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7200
7201         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7202         checks if we can use brtrue/brfalse to test for 0.
7203         * expression.cs: use the above in the test for using brtrue/brfalse.
7204         cleanup code a bit.
7205
7206 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7207
7208         * expression.cs: Rewrite string concat stuff. Benefits:
7209
7210         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7211         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7212         rather than a concat chain.
7213
7214         * typemanager.cs: Add lookups for more concat overloads.
7215
7216 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7217
7218         * expression.cs: Emit shorter il code for array init.
7219
7220         newarr
7221         dup
7222         // set 1
7223
7224         // set 2
7225
7226         newarr
7227         stloc.x
7228
7229         ldloc.x
7230         // set 1
7231
7232         ldloc.x
7233         // set 2
7234
7235 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7236
7237         * statement.cs: Before, two switch blocks would be merged if the
7238         total size of the blocks (end_item - begin_item + 1) was less than
7239         two times the combined sizes of the blocks.
7240
7241         Now, it will only merge if after the merge at least half of the
7242         slots are filled.
7243
7244         fixes 55885.
7245
7246 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7247
7248         * class.cs : csc build fix for GetMethods(). See bug #52503.
7249
7250 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7251
7252         * expression.cs: Make sure fp comparisons work with NaN.
7253         This fixes bug #54303. Mig approved this patch a long
7254         time ago, but we were not able to test b/c the runtime
7255         had a related bug.
7256
7257 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7258
7259         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7260
7261 2004-03-19  Martin Baulig  <martin@ximian.com>
7262
7263         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7264         error here and not in our caller.
7265
7266 2004-03-19  Martin Baulig  <martin@ximian.com>
7267
7268         * interface.cs: Completely killed this file.
7269         (Interface): We're now a TypeContainer and live in class.cs.
7270
7271         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7272         argument; we're now also called for interfaces.
7273         (TypeContainer.DefineMembers): Allow this method being called
7274         multiple times.
7275         (TypeContainer.GetMethods): New public method; formerly known as
7276         Interface.GetMethod().  This is used by PendingImplementation.
7277         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7278         it's now private and non-static.
7279         (Interface): Moved this here; it's now implemented similar to
7280         Class and Struct.
7281         (Method, Property, Event, Indexer): Added `bool is_interface'
7282         argument to their .ctor's.
7283         (MemberBase.IsInterface): New public field.
7284
7285         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7286         instances instead of InterfaceMethod, InterfaceProperty, etc.
7287         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7288         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7289
7290 2004-03-19  Martin Baulig  <martin@ximian.com>
7291
7292         * class.cs (MethodCore.IsDuplicateImplementation): New private
7293         method which does the CS0111 checking.
7294         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7295         Use IsDuplicateImplementation().
7296
7297 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7298
7299         * decl.cs (FindMemberToOverride): New method to find the correct
7300         method or property to override in the base class.
7301         * class.cs
7302             - Make Method/Property use the above method to find the
7303               version in the base class.
7304             - Remove the InheritableMemberSignatureCompare as it is now
7305               dead code.
7306
7307         This patch makes large code bases much faster to compile, as it is
7308         O(n) rather than O(n^2) to do this validation.
7309
7310         Also, it fixes bug 52458 which is that nested classes are not
7311         taken into account when finding the base class member.
7312
7313         Reviewed/Approved by Martin.
7314
7315 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7316
7317         * interface.cs: In all interface classes removed redundant
7318         member initialization.
7319
7320 2004-03-16  Martin Baulig  <martin@ximian.com>
7321
7322         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7323
7324 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7325
7326         * decl.cs (DefineTypeAndParents): New helper method to define a
7327         type's containers before the type itself is defined;  This is a
7328         bug exposed by the recent changes to Windows.Forms when an
7329         implemented interface was defined inside a class that had not been
7330         built yet.   
7331
7332         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7333
7334         (Check): Loop correctly to report errors modifiers
7335         (UNSAFE was not in the loop, since it was the same as TOP).
7336
7337         * interface.cs: Every interface member now takes a ModFlags,
7338         instead of a "is_new" bool, which we set on the base MemberCore. 
7339
7340         Every place where we called "UnsafeOk" in the interface, now we
7341         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7342         the unsafe settings from the member declaration instead of the
7343         container interface. 
7344
7345         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7346
7347         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7348         `set_indexer_name' to the pending bits (one per type).
7349
7350         We fixed a bug today that was picking the wrong method to
7351         override, since for properties the existing InterfaceMethod code
7352         basically ignored the method name.  Now we make sure that the
7353         method name is one of the valid indexer names.
7354
7355 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7356  
7357         * support.cs (SeekableStreamReader): Keep track of stream byte
7358         positions and don't mix them with character offsets to the buffer.
7359
7360         Patch from Gustavo Giráldez
7361
7362 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7363
7364         * interface.cs (InterfaceSetGetBase): Removed double member
7365         initialization, base class does it as well.
7366
7367 2004-03-13  Martin Baulig  <martin@ximian.com>
7368
7369         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7370         when compiling corlib.
7371
7372 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7373
7374         * convert.cs (ExplicitConversion): We were reporting an error on
7375         certain conversions (object_type source to a value type, when the
7376         expression was `null') before we had a chance to pass it through
7377         the user defined conversions.
7378
7379         * driver.cs: Replace / and \ in resource specifications to dots.
7380         Fixes 50752
7381
7382         * class.cs: Add check for duplicate operators.  Fixes 52477
7383
7384 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7385
7386         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7387         that are in the middle of the statements, not only at the end.
7388         Fixes #54987
7389
7390         * class.cs (TypeContainer.AddField): No longer set the
7391         `HaveStaticConstructor' flag, now we call it
7392         `UserDefineStaticConstructor' to diferentiate the slightly
7393         semantic difference.
7394
7395         The situation is that we were not adding BeforeFieldInit (from
7396         Modifiers.TypeAttr) to classes that could have it.
7397         BeforeFieldInit should be set to classes that have no static
7398         constructor. 
7399
7400         See:
7401
7402         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7403
7404         And most importantly Zoltan's comment:
7405
7406         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7407
7408         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7409          before its static fields are used', i.e. initialization does not need
7410          to be triggered by the first access to the type. Setting this flag
7411          helps the JIT to compile better code, since it can run the static
7412          constructor at JIT time, and does not need to generate code to call it
7413          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7414          this flag for lots of classes like String. 
7415          
7416          csc sets this flag if the type does not have an explicit static 
7417          constructor. The reasoning seems to be that if there are only static
7418          initalizers for a type, and no static constructor, then the programmer
7419          does not care when this initialization happens, so beforefieldinit
7420          can be used.
7421          
7422          This bug prevents the AOT compiler from being usable, since it 
7423          generates so many calls to mono_runtime_class_init that the AOT code
7424          is much slower than the JITted code. The JITted code is faster, 
7425          because it does not generate these calls if the vtable is type is
7426          already initialized, which is true in the majority of cases. But the
7427          AOT compiler can't do this."
7428
7429 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7430
7431         * class.cs (MethodData.Emit): Refactor the code so symbolic
7432         information is generated for destructors;  For some reasons we
7433         were taking a code path that did not generate symbolic information
7434         before. 
7435
7436 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7437
7438         * class.cs: Create a Constructor.CheckBase method that
7439         takes care of all validation type code. The method
7440         contains some code that was moved from Define.
7441
7442         It also includes new code that checks for duplicate ctors.
7443         This fixes bug #55148.
7444
7445 2004-03-09  Joshua Tauberer <tauberer@for.net>
7446
7447         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7448         a { ... }-style array creation invokes EmitStaticInitializers
7449         which is not good for reference-type arrays.  String, decimal
7450         and now null constants (NullCast) are not counted toward
7451         static initializers.
7452
7453 2004-03-05  Martin Baulig  <martin@ximian.com>
7454
7455         * location.cs (SourceFile.HasLineDirective): New public field;
7456         specifies whether the file contains or is referenced by a "#line"
7457         directive.
7458         (Location.DefineSymbolDocuments): Ignore source files which
7459         either contain or are referenced by a "#line" directive.        
7460
7461 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7462
7463         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7464         direct access to our parent, so check the method inline there.
7465
7466 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7467
7468         * expression.cs (Invocation.EmitCall): Miguel's last commit
7469         caused a regression. If you had:
7470
7471             T t = null;
7472             t.Foo ();
7473
7474         In Foo the implict this would be null.
7475
7476 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7477
7478         * expression.cs (Invocation.EmitCall): If the method is not
7479         virtual, do not emit a CallVirt to it, use Call.
7480
7481         * typemanager.cs (GetFullNameSignature): Improve the method to
7482         cope with ".ctor" and replace it with the type name.
7483
7484         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7485         as an argument the ConstructorBuilder where it is being defined,
7486         to catch the recursive constructor invocations.
7487
7488 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7489
7490         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7491         routines to check if a type is an enumerable/enumerator allow
7492         classes that implement the IEnumerable or IEnumerator interfaces.
7493
7494         * class.cs (Property, Operator): Implement IIteratorContainer, and
7495         implement SetYields.
7496
7497         (Property.Define): Do the block swapping for get_methods in the
7498         context of iterators.   We need to check if Properties also
7499         include indexers or not.
7500
7501         (Operator): Assign the Block before invoking the
7502         OperatorMethod.Define, so we can trigger the Iterator code
7503         replacement. 
7504
7505         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7506         Property and Operator classes are not created when we parse the
7507         declarator but until we have the block completed, so we use a
7508         singleton SimpleIteratorContainer.Simple to flag whether the
7509         SetYields has been invoked.
7510
7511         We propagate this setting then to the Property or the Operator to
7512         allow the `yield' to function.
7513
7514 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7515
7516         * codegen.cs: Implemented attribute support for modules.
7517         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7518         Assembly/Module functionality.
7519
7520         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7521         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7522         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7523
7524 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7525
7526         * interface.cs (FindMembers): The operation is performed on all base
7527         interfaces and not only on the first. It is required for future CLS Compliance patch.
7528
7529 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7530
7531         * statement.cs, codegen.cs:
7532         This patch deals with patterns such as:
7533
7534         public class List : IEnumerable {
7535
7536                 public MyEnumerator GetEnumerator () {
7537                         return new MyEnumerator(this);
7538                 }
7539
7540                 IEnumerator IEnumerable.GetEnumerator () {
7541                         ...
7542                 }
7543                 
7544                 public struct MyEnumerator : IEnumerator {
7545                         ...
7546                 }
7547         }
7548
7549         Before, there were a few things we did wrong:
7550         1) we would emit callvirt on a struct, which is illegal
7551         2) we emited ldarg when we needed to emit ldarga
7552         3) we would mistakenly call the interface methods on an enumerator
7553         type that derived from IEnumerator and was in another assembly. For example:
7554
7555         public class MyEnumerator : IEnumerator
7556
7557         Would have the interface methods called, even if there were public impls of the
7558         method. In a struct, this lead to invalid IL code.
7559
7560 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7561
7562         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7563           renamed to Emit.
7564
7565         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7566
7567 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7568
7569         * cs-parser.jay: Fix small regression: we were not testing V2
7570         compiler features correctly.
7571
7572         * interface.cs: If the emit context is null, then create one
7573
7574 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7575
7576         * decl.cs (GetSignatureForError): New virtual method to get full name
7577           for error messages.
7578
7579         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7580           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7581
7582         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7583           Duplicated members and code in these classes has been removed.
7584           Better encapsulation in these classes.
7585
7586 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7587
7588         * assign.cs (Assign.DoResolve): When dealing with compound
7589         assignments, there is a new rule in ECMA C# 2.4 (might have been
7590         there before, but it is documented here) that states that in:
7591
7592         a op= b;
7593
7594         If b is of type int, and the `op' is a shift-operator, then the
7595         above is evaluated as:
7596
7597         a = (int) a op b 
7598
7599         * expression.cs (Binary.ResolveOperator): Instead of testing for
7600         int/uint/long/ulong, try to implicitly convert to any of those
7601         types and use that in pointer arithmetic.
7602
7603         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7604         method to print information for from the type, not from the
7605         null-method we were given.
7606
7607 2004-02-01  Duncan Mak  <duncan@ximian.com>
7608
7609         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7610         parsing for cmd, fixes bug #53694.
7611
7612 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7613
7614         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7615         in the member name duplication tests. Property and operator name duplication
7616         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7617
7618 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7619
7620         * interface.cs (PopulateMethod): Fixed crash when interface method
7621         returns not existing type (error test cs0246-3.cs).
7622
7623 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7624
7625         * cs-parser.jay (interface_accessors): Re-write actions to also
7626         store attributes attached to get and set methods. Fix spelling
7627         while at it.
7628
7629         (inteface_property_declaration): Modify accordingly.
7630
7631         (InterfaceAccessorInfo): New helper class to store information to pass
7632         around between rules that use interface_accessors.
7633
7634         * interface.cs (Emit): Apply attributes on the get and set
7635         accessors of properties and indexers too.
7636
7637         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7638         right MethodBuilder when applying attributes to the get and set accessors.
7639
7640 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7641
7642         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7643
7644 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7645
7646         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7647
7648 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7649
7650         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7651         changes that treat `yield' specially when present before `break'
7652         or `return' tokens.
7653
7654         * cs-tokenizer.cs: yield is no longer a keyword.
7655
7656 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7657
7658         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7659         setting for default constructors.
7660         For default constructors are almost every time set wrong Modifier. The
7661         generated IL code has been alright. But inside mcs this values was
7662         wrong and this was reason why several of my CLS Compliance tests
7663         failed.
7664
7665 2004-01-22  Martin Baulig  <martin@ximian.com>
7666
7667         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7668         not a QualifiedIdentifier.  This is what `type_name_expression'
7669         was previously doing.
7670         (type_name_expression): Removed; the code is now in
7671         `namespace_or_type_name'.
7672         (qualified_identifier): Removed, use `namespace_or_type_name'
7673         instead.
7674         (QualifiedIdentifier): Removed this class.      
7675
7676 2004-01-22  Martin Baulig  <martin@ximian.com>
7677
7678         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7679         not a string as alias name.
7680
7681 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7682
7683         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7684         #52730 bug, and instead compute correctly the need to use a
7685         temporary variable when requesting an address based on the
7686         static/instace modified of the field and the constructor.
7687  
7688 2004-01-21  Martin Baulig  <martin@ximian.com>
7689
7690         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7691         class and namespace before looking up aliases.  Fixes #52517.
7692
7693 2004-01-21  Martin Baulig  <martin@ximian.com>
7694
7695         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7696         assinged in a 'try'; fixes exception4.cs.
7697
7698 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7699         * class.cs : Implemented parameter-less constructor for TypeContainer
7700
7701         * decl.cs: Attributes are now stored here. New property OptAttributes
7702
7703         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7704
7705         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7706
7707 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7708
7709         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7710           (CSharpSignature): New method for indexer and property signature.
7711
7712 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7713
7714         * pending.cs (IsVirtualFilter): Faster implementation.
7715
7716 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7717
7718         * typemanager.cs: Avoid inclusion of same assembly more than once.
7719
7720 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7721
7722         * cs-parser.jay: Fixed problem where the last assembly attribute
7723           has been applied also to following declaration (class, struct, etc.)
7724           
7725 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7726
7727         * class.cs: Added error CS0538, CS0539 reporting.
7728         Fixed crash on Microsoft runtime when field type is void.
7729
7730         * cs-parser.jay: Added error CS0537 reporting.
7731
7732         * pending.cs: Added error CS0535 reporting.
7733         Improved error report for errors CS0536, CS0534.
7734
7735 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7736
7737         Merge a few bits from the Anonymous Method MCS tree.
7738
7739         * statement.cs (ToplevelBlock): New class for toplevel methods,
7740         will hold anonymous methods, lifted variables.
7741
7742         * cs-parser.jay: Create toplevel blocks for delegates and for
7743         regular blocks of code. 
7744
7745 2004-01-20  Martin Baulig  <martin@ximian.com>
7746
7747         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7748         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7749         and `NeedExplicitReturn'; added `IsLastStatement'.
7750         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7751         have a `ReturnLabel' or we're not unreachable.
7752
7753         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7754         child's reachability; don't just override ours with it.  Fixes
7755         #58058 (lluis's example).
7756         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7757         InFinally(), InLoop(), InSwitch() and
7758         BreakCrossesTryCatchBoundary() methods.
7759
7760         * statement.cs (Return): Do all error checking in Resolve().
7761         Unless we are the last statement in a top-level block, always
7762         create a return label and jump to it.
7763         (Break, Continue): Do all error checking in Resolve(); also make
7764         sure we aren't leaving a `finally'.
7765         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7766         statement in a top-level block.
7767         (Block.Flags): Added `IsDestructor'.
7768         (Block.IsDestructor): New public property.
7769
7770 2004-01-20  Martin Baulig  <martin@ximian.com>
7771
7772         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7773
7774 2004-01-20  Martin Baulig  <martin@ximian.com>
7775
7776         * statement.cs (Statement.ResolveUnreachable): New public method.
7777         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7778         (Block.Resolve): Resolve unreachable statements.
7779
7780 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7781
7782         * expression.cs: We need to fix the case where we do
7783         not have a temp variable here.
7784
7785         * assign.cs: Only expression compound assignments need
7786         temporary variables.
7787
7788 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7789
7790         * flowanalysis.cs: Reduce memory allocation in a few ways:
7791           - A block with no variables should not allocate a bit
7792             vector for itself.
7793           - A method with no out parameters does not need any tracking
7794             for assignment of the parameters, so we need not allocate
7795             any data for it.
7796           - The arrays:
7797                 public readonly Type[] VariableTypes;
7798                 public readonly string[] VariableNames;
7799             Are redundant. The data is already stored in the variable
7800             map, so we need not allocate another array for it.
7801           - We need to add alot of checks for if (params | locals) == null
7802             due to the first two changes.
7803
7804 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7805
7806         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7807         implement IMemoryLocation, we store a copy on a local variable and
7808         take the address of it.  Patch from Benjamin Jemlich
7809
7810         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7811         to use a special "type_name_expression" rule which reduces the
7812         number of "QualifiedIdentifier" classes created, and instead
7813         directly creates MemberAccess expressions.
7814
7815 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7816
7817         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7818         that fixes #52853.  Null literal assignment to ValueType
7819
7820         * class.cs (MethodData.Emit): Instead of checking the name of the
7821         method to determine if its a destructor, create a new derived
7822         class from Method called Destructor, and test for that.  
7823
7824         * cs-parser.jay: Create a Destructor object instead of a Method.  
7825
7826         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7827
7828         Fixes: 52933
7829
7830 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7831
7832         * expression.cs (Binary.ResolveOperator): Perform an implicit
7833         conversion from MethodGroups to their delegate types on the
7834         Addition operation.
7835
7836         * delegate.cs: Introduce a new class DelegateCreation that is the
7837         base class for `NewDelegate' and `ImplicitDelegateCreation',
7838         factor some code in here.
7839
7840         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7841         conversion from MethodGroups to compatible delegate types. 
7842
7843         * ecore.cs (Expression.Resolve): Do not flag error 654
7844         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7845         we allow conversions from MethodGroups to delegate types now.
7846
7847         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7848         assignments in v2 either.
7849
7850 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7851
7852         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7853         static read-only fields in ctors.
7854
7855         Applied patch from Benjamin Jemlich 
7856
7857         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7858
7859 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7860
7861         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7862         here to return true, as they can be used like this:
7863
7864                 (XXX) int.MEMBER ()
7865
7866         Fixed 49836 and all the other dups
7867
7868 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7869
7870         * driver.cs: Implement /win32res and /win32icon.
7871
7872 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7873
7874         * cs-parser.jay: Add a rule to improve error handling for the
7875         common mistake of placing modifiers after the type.
7876
7877 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7878
7879         * cs-parser.jay (interface_event_declaration): Catch
7880         initialization of events on interfaces, and report cs0068
7881
7882         * cs-parser.jay (interface_event_declaration): Catch
7883         initialization of events. 
7884
7885         * ecore.cs: Better report missing constructors.
7886
7887         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7888         the error reporting done in the wrong place.  Fix.
7889
7890         * expression.cs (Binary.ResolveOperator): Catch the 
7891         operator + (E x, E y) error earlier, and later allow for implicit
7892         conversions in operator +/- (E e, U x) from U to the underlying
7893         type of E.
7894
7895         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7896         52596, if the container class is abstract, the default constructor
7897         is protected otherwise its public (before, we were always public).
7898
7899         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7900         fixed statement.
7901
7902         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7903         Jemlich that fixes bug #52597, MCS was generating invalid code for
7904         idisposable structs.   Thanks to Ben for following up with this
7905         bug as well.
7906
7907 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7908
7909         * driver.cs: Allow assemblies without code to be generated, fixes
7910         52230.
7911
7912 2004-01-07  Nick Drochak <ndrochak@gol.com>
7913
7914         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7915
7916 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7917
7918         * cs-parser.jay: Add rules to improve error reporting if fields or
7919         methods are declared at the namespace level (error 116)
7920
7921         * Add rules to catch event add/remove
7922
7923 2004-01-04  David Sheldon <dave-mono@earth.li>
7924
7925   * expression.cs: Added matching ")" to error message for 
7926   CS0077
7927
7928 2004-01-03 Todd Berman <tberman@gentoo.org>
7929
7930         * ecore.cs, attribute.cs:
7931         Applying fix from #52429.
7932
7933 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7934
7935         * ecore.cs, expression.cs, statement.cs:
7936         Total rewrite of how we handle branching. We
7937         now handle complex boolean expressions with fewer
7938         jumps. As well if (x == 0) no longer emits a ceq.
7939
7940         if (x is Foo) is much faster now, because we generate
7941         better code.
7942
7943         Overall, we get a pretty big improvement on our benchmark
7944         tests. The code we generate is smaller and more readable.
7945
7946         I did a full two-stage bootstrap. The patch was reviewed
7947         by Martin and Miguel.
7948
7949 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7950
7951         * cs-parser.jay: Make primary_expression not take a QI.
7952         we dont need this because the member_access rule covers
7953         us here. So we replace the rule with just IDENTIFIER.
7954
7955         This has two good effects. First, we remove a s/r conflict.
7956         Second, we allocate many fewer QualifiedIdentifier objects.
7957
7958 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7959
7960         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7961         set the correct information via SRE. This prevents
7962         hanging on the MS runtime. Fixes #29374.
7963
7964 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7965
7966         * convert.cs: correctly handle conversions to value types
7967         from Enum and ValueType as unboxing conversions.
7968
7969         Fixes bug #52569. Patch by Benjamin Jemlich.
7970
7971 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7972
7973         * expression.cs (BetterConversion): Prefer int -> uint
7974         over int -> ulong (csc's behaviour). This fixed bug #52046.
7975
7976 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7977
7978         * decl.cs (MemberCache.FindMembers): now returns a
7979         MemberInfo [].
7980
7981         * typemanager.cs: In general, go with with ^^.
7982         (CopyNewMethods): take an IList.
7983         (RealMemberLookup): Only allocate an arraylist
7984         if we copy from two sets of methods.
7985
7986         This change basically does two things:
7987         1) Fewer array lists allocated due to CopyNewMethods.
7988         2) the explicit cast in MemberList costed ALOT.
7989
7990 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7991
7992         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7993         a hashtable to avoid needless string allocations when an identifier is
7994         used more than once (the common case).
7995
7996 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7997
7998         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7999         is broken, it will not return anything. So, we
8000         have to use the information we have in mcs to
8001         do the task.
8002
8003         * typemanager.cs: Add a cache for GetInterfaces,
8004         since this will now be used more often (due to ^^)
8005
8006         (GetExplicitInterfaces) New method that gets the
8007         declared, not effective, interfaces on a type
8008         builder (eg, if you have interface IFoo, interface
8009         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8010         { IBar }.
8011
8012         This patch makes MCS able to bootstrap itself on
8013         Windows again.
8014
8015 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8016
8017         * expression.cs: Remove the Nop's that Miguel put
8018         in by mistake.
8019
8020 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8021
8022         * report.cs, codegen.cs: Give the real stack trace to
8023         the error when an exception is thrown.
8024
8025 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8026
8027         * decl.cs: only allocate hashtables for ifaces if 
8028         it is an iface!
8029
8030 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8031
8032         * expression.cs: fix the error from cs0121-2.cs
8033         (a parent interface has two child interfaces that
8034         have a function with the same name and 0 params
8035         and the function is called through the parent).
8036
8037 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8038
8039         * class.cs, rootcontext.cs, typmanager.cs: do not
8040         leak pointers.
8041
8042 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8043
8044         * codegen.cs: remove stack for the ec flow branching.
8045         It is already a linked list, so no need.
8046
8047 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8048
8049         * Makefile: Allow custom profiler here.
8050
8051 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8052
8053         * typemanager.cs (LookupType):
8054           - Use a static char [], because split takes
8055             a param array for args, so it was allocating
8056             every time.
8057           - Do not store true in a hashtable, it boxes.
8058
8059 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8060
8061         * flowanalysis.cs: bytify common enums.
8062
8063 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8064
8065         * modifiers.cs: Add a new set of flags for the
8066         flags allowed on explicit interface impls.
8067         * cs-parser.jay: catch the use of modifiers in
8068         interfaces correctly.
8069         * class.cs: catch private void IFoo.Blah ().
8070
8071         All related to bug #50572.
8072
8073 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8074
8075         * decl.cs: Rewrite the consistant accessability checking.
8076         Accessability is not linear, it must be implemented in
8077         a tableish way. Fixes #49704.
8078
8079 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8080
8081         * expression.cs: Handle negation in a checked context.
8082         We must use subtraction from zero. Fixes #38674.
8083
8084 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8085
8086         * class.cs: Ignore static void main in DLLs.
8087         * rootcontext.cs: Handle the target type here,
8088         since we are have to access it from class.cs
8089         * driver.cs: account for the above.
8090
8091 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8092
8093         * report.cs: Give line numbers and files if available.
8094
8095 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8096
8097         * driver.cs: Implement /addmodule.
8098
8099         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8100         ModuleBuilders.
8101
8102 2003-12-20  Martin Baulig  <martin@ximian.com>
8103
8104         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8105         (FieldBase.IsAssigned): Removed this field.
8106         (FieldBase.SetAssigned): New public method.
8107         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8108
8109 2003-12-20  Martin Baulig  <martin@ximian.com>
8110
8111         * expression.cs (LocalVariableReference.DoResolve): Don't set
8112         `vi.Used' if we're called from DoResolveLValue().
8113
8114         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8115         returns the usage vector it just merged into the current one -
8116         pass this one to UsageWarning().
8117         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8118         of the `EmitContext', don't call this recursively on our children.
8119
8120 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8121
8122         * driver.cs: Implement /target:module.
8123
8124 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8125
8126         * support.cs (CharArrayHashtable): New helper class.
8127
8128         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8129         char arrays, not strings, so we can avoid creating a string in
8130         consume_identifier if the identifier is a keyword.
8131
8132 2003-12-16  Martin Baulig  <martin@ximian.com>
8133
8134         * statement.cs (LocalInfo.Assigned): Removed this property.
8135         (LocalInfo.Flags): Removed `Assigned'.
8136         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8137         and uses flow analysis.
8138         (Block.UsageWarning): Made this method private.
8139         (Block.Resolve): Call UsageWarning() if appropriate.
8140
8141         * expression.cs (LocalVariableReference.DoResolve): Always set
8142         LocalInfo.Used here.
8143
8144 2003-12-13  Martin Baulig  <martin@ximian.com>
8145
8146         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8147         any value here; we're now using flow analysis to figure out
8148         whether a statement/block returns a value.
8149
8150 2003-12-13  Martin Baulig  <martin@ximian.com>
8151
8152         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8153         working again.
8154         (FlowBranching.MergeFinally): Don't call
8155         `branching.CheckOutParameters()' here, this is called in
8156         MergeTopBlock().
8157         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8158         when adding the `finally' vector.       
8159
8160 2003-12-13  Martin Baulig  <martin@ximian.com>
8161
8162         * flowanalysis.cs
8163         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8164         actually work and also fix #48962.
8165
8166 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8167
8168         * decl.cs: Do not check System.Object for nested types,
8169         since we know it does not have any. Big bang for buck:
8170
8171         BEFORE:
8172            Run 1:   8.35 seconds
8173            Run 2:   8.32 seconds
8174            corlib:  17.99 seconds
8175         AFTER:
8176            Run 1:   8.17 seconds
8177            Run 2:   8.17 seconds
8178            corlib:  17.39 seconds
8179
8180 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8181
8182         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8183         time we are returning 0 members, so we save alot here.
8184
8185 2003-12-11  Martin Baulig  <martin@ximian.com>
8186
8187         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8188         `MergeChild()', also just take the `FlowBranching' as argument;
8189         call Merge() on it and return the result.
8190         (FlowBranching.Merge): We don't need to do anything if we just
8191         have one sibling.
8192
8193 2003-12-11  Martin Baulig  <martin@ximian.com>
8194
8195         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8196         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8197         Maurer for this idea.
8198
8199 2003-12-11  Martin Baulig  <martin@ximian.com>
8200
8201         * flowanalysis.cs (MergeResult): This class is now gone; we now
8202         use the `UsageVector' for this.  The reason for this is that if a
8203         branching just has one sibling, we don't need to "merge" them at
8204         all - that's the next step to do.
8205         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8206         `MergeResult'.
8207
8208 2003-12-11  Martin Baulig  <martin@ximian.com>
8209
8210         Reworked flow analyis and made it more precise and bug-free.  The
8211         most important change is that we're now using a special `Reachability'
8212         class instead of having "magic" meanings of `FlowReturns'.  I'll
8213         do some more cleanups and optimizations and also add some more
8214         documentation this week.
8215
8216         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8217         largely reworked this class.
8218         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8219         the new `Reachability' class instead of having "magic" values here.
8220         (FlowBranching): We're now using an instance of `Reachability'
8221         instead of having separate `Returns', `Breaks' etc. fields.
8222
8223         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8224         based on flow analysis; ignore the return value of block.Emit ().
8225
8226 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8227
8228         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8229         if they are private.
8230
8231 2003-12-09  Martin Baulig  <martin@ximian.com>
8232
8233         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8234         call them directly on the UsageVector.
8235
8236 2003-12-09  Martin Baulig  <martin@ximian.com>
8237
8238         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8239         Changed return type from `FlowReturns' to `Reachability'.
8240
8241 2003-12-09  Martin Baulig  <martin@ximian.com>
8242
8243         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8244         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8245         `Reachable' fields with a single `Reachability' one.
8246
8247 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8248
8249         * class.cs (FindMembers): Remove foreach's.
8250
8251         Bootstrap times:
8252
8253         BEFORE
8254                 Run 1:   8.74 seconds
8255                 Run 2:   8.71 seconds
8256
8257         AFTER
8258                 Run 1:   8.64 seconds
8259                 Run 2:   8.58 seconds
8260
8261
8262 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8263
8264         * cs-parser.jay:
8265         * gen-treedump.cs:
8266         * statement.cs:
8267         This patch does a few things:
8268                 1. EmptyStatement is now a singleton, so it is never reallocated.
8269                 2. All blah is EmptyStatement constructs have been changed to
8270                    blah == EmptyStatement.Value, which is much faster and valid
8271                    now that EmptyStatement is a singleton.
8272                 3. When resolving a block, rather than allocating a new array for
8273                    the non-empty statements, empty statements are replaced with
8274                    EmptyStatement.Value
8275                 4. Some recursive functions have been made non-recursive.
8276         Mainly the performance impact is from (3), however (1) and (2) are needed for
8277         this to work. (4) does not make a big difference in normal situations, however
8278         it makes the profile look saner.
8279
8280         Bootstrap times:
8281
8282         BEFORE
8283         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8284         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8285         Total memory allocated: 56397 KB
8286
8287         AFTER
8288         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8289         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8290         Total memory allocated: 55666 KB
8291
8292 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8293
8294         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8295         than the hashtable in a hashtable version
8296
8297         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8298         we always end up concating a string. This results in a huge perf
8299         loss, because many strings have to be tracked by the GC. In this
8300         patch, we first use a hashtable that works with two keys, so that
8301         the strings do not need to be concat'ed.
8302
8303         Bootstrap times:
8304         BEFORE
8305                 Run 1:   8.74 seconds
8306                 Run 2:   8.71 seconds
8307
8308         AFTER
8309                 Run 1:   8.65 seconds
8310                 Run 2:   8.56 seconds
8311
8312 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8313
8314         * Makefile: Add a new target `do-time' that does a quick and simple
8315         profile, leaving easy to parse output.
8316
8317 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8318
8319         * codegen.cs (Init): Create the dynamic assembly with 
8320         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8321
8322 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8323
8324         * support.cs: Make the PtrHashtable use only one
8325         instance of its comparer.
8326
8327 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8328
8329         * typemanager.cs: Fix lookup of GetNamespaces.
8330
8331 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8332
8333         * expression.cs: Removed redundant line.
8334
8335         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8336         ArrayLists, use for loops with bounds.  
8337
8338         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8339         arraylist.
8340
8341         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8342         arraylists, use for loop with bounds.
8343
8344         The above three changes give us a 0.071 second performance
8345         improvement out of 3.294 seconds down to 3.223.  On my machine
8346         the above changes reduced the memory usage by 1,387 KB during
8347         compiler bootstrap.
8348
8349         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8350         QualifiedIdentifiers.  Before we created a new string through
8351         concatenation, and mostly later on, the result would be
8352         manipulated by DecomposeQI through string manipulation.
8353
8354         This reduced the compiler memory usage for bootstrapping from
8355         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8356         compile times in 0.05 seconds.
8357
8358 2003-11-28  Dick Porter  <dick@ximian.com>
8359
8360         * support.cs: Do string compares with the Invariant culture.
8361
8362         * rootcontext.cs: 
8363         * gen-treedump.cs: 
8364         * expression.cs: 
8365         * driver.cs: 
8366         * decl.cs: 
8367         * codegen.cs: 
8368         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8369         the comparison is done with the Invariant culture.
8370
8371 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8372
8373         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8374         GetEnumerator method.
8375
8376         (ProbeCollectionType): Iterate starting at the most specific type
8377         upwards looking for a GetEnumerator
8378
8379         * expression.cs: Shift count can be up to 31 for int/uint and 63
8380         for long/ulong.
8381
8382 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8383
8384         * statement.cs (Block.LookupLabel): Also look for the label on the
8385         children blocks.  Use a hash table to keep track of visited
8386         nodes. 
8387
8388         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8389         we actually did transform the other operand, otherwise fall back
8390         to the common codepath that casts to long.
8391
8392         * cs-tokenizer.cs: Use the same code pattern as the int case.
8393         Maybe I should do the parsing myself, and avoid depending on the
8394         Parse routines to get this done.
8395
8396 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8397
8398         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8399         which fixes bug 51347.  This time test it.
8400
8401         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8402         attributes for example can not tell the difference between these.
8403         The difference was only a syntax feature of the language. 
8404
8405         * attribute.cs: Apply attributes to delegates.
8406
8407         * delegate.cs: Call the apply attributes method.
8408
8409 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8410
8411         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8412         comparing 0 vs Byte.MinValue, not the value
8413
8414         (ImplicitConversionRequired): When reporting a conversion error,
8415         use error 31 to print out the constant error instead of the
8416         simpler 29.
8417
8418         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8419         which fixes bug 51347.
8420
8421 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8422
8423         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8424         which fixes the -warnaserror command line option.
8425
8426 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8427
8428         * cfold.cs (DoNumericPromotions): During constant folding of
8429         additions on UIntConstant, special case intconstants with
8430         IntConstants like we do on the expression binary operator. 
8431
8432 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8433
8434         * convert.cs (ImplicitReferenceConversion): We were missing a case
8435         (System.Enum are not value types or class types, so we need to
8436         classify them separatedly).
8437
8438         * driver.cs: We do not support error 2007.
8439
8440 2003-11-12 Jackson Harper <jackson@ximian.com>
8441
8442         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8443         system directory. Also use the full file name so users can
8444         libraries names mscorlib-o-tron.dll in a non system dir.
8445
8446 2003-11-10  Martin Baulig  <martin@ximian.com>
8447
8448         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8449         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8450         calling `ResolveType()' on them, directly assign their `Type'.
8451
8452 2003-11-08  Martin Baulig  <martin@ximian.com>
8453
8454         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8455         return value and the `out parent' parameter.
8456         (TypeContainer.DefineType): Moved the CS0644 check into
8457         GetClassBases().  Don't pass the interface types to the
8458         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8459         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8460
8461         * ecore.cs (TypeExpr.IsAttribute): New property.
8462         (TypeExpr.GetInterfaces): New method.
8463
8464         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8465         TypeExpr instead of a Type.
8466         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8467         (Interface.DefineType): Don't pass the interface types to the
8468         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8469         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8470
8471         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8472         instead of a `Type[]'.
8473         (TypeManager.RegisterBuilder): Likewise.
8474         (TypeManager.AddUserInterface): Likewise.
8475         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8476         `Type[]' and also return a `TypeExpr[]'.
8477         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8478
8479 2003-11-08  Martin Baulig  <martin@ximian.com>
8480
8481         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8482         Expression.     
8483
8484 2003-11-08  Martin Baulig  <martin@ximian.com>
8485
8486         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8487         TypeManager.ResolveExpressionTypes().
8488
8489         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8490         instead of an Expression.
8491         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8492         (TypeExpression): New public class; formerly known as `TypeExpr'.
8493
8494         * expression.cs (ComposedCast): Derive from TypeExpr.
8495
8496         * typemanager.cs (TypeManager.system_*_expr): These are now
8497         TypExpr's instead of Expression's.
8498         (TypeManager.ResolveExpressionTypes): New public static function;
8499         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8500         of them.        
8501
8502 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8503
8504         * expression.cs (New.DoResolve): Do not dereference value that
8505         might be a null return.
8506
8507         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8508         sure that the constant value has the right type.  Fixes an
8509         unreported bug, similar to 50425.
8510
8511         * const.cs (Const.LookupConstantValue): Call
8512         ImplicitStandardConversionExists before doing a conversion to
8513         avoid havng the TypeManager.ChangeType do conversions.
8514
8515         Reduced the number of casts used
8516
8517         (Const.ChangeType): New routine to enable reuse of the constant
8518         type changing code from statement.
8519
8520         * typemanager.cs (ChangeType): Move common initialization to
8521         static global variables.
8522
8523         Fixes #50425.
8524
8525         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8526         every value type to go through, even if it was void.  Fix that. 
8527
8528         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8529         character of the define, and the is_identifier_part_character for
8530         the rest of the string.
8531
8532 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8533
8534         * expression.cs (UnaryMutator.EmitCode): When I updated
8535         LocalVariableReference.DoResolve, I overdid it, and dropped an
8536         optimization done on local variable references.
8537
8538 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8539
8540         * ecore.cs: Convert the return from Ldlen into an int.
8541
8542 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8543
8544         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8545         the accessibility, this is a special case for toplevel non-public
8546         classes (internal for instance).
8547
8548 2003-10-20  Nick Drochak <ndrochak@gol.com>
8549
8550         * ecore.cs: Fix typo and build.  Needed another right paren.
8551
8552 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8553
8554         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8555         `internal' case regular and protected, but not allowing protected
8556         to be evaluated later.  Bug 49840
8557
8558 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8559
8560         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8561         to kb.Nlast, and not the kb.nFirst to isolate the switch
8562         statement.
8563
8564         Extract the underlying type, so enumerations of long/ulong are
8565         treated like long/ulong.
8566
8567 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8568
8569         * expression.cs (New): Overload the meaning of RequestedType to
8570         track the possible creation of the NewDelegate type, since
8571         DoResolve is invoked more than once for new constructors on field
8572         initialization.
8573
8574         See bugs: #48800 and #37014
8575
8576         * cs-parser.jay (declare_local_constants): Take an arraylist
8577         instead of a single constant.
8578
8579         (local_constant_declaration): It should take a
8580         constant_declarators, not a constant_declarator.  Fixes 49487
8581
8582         * convert.cs: Fix error report.
8583
8584 2003-10-13 Jackson Harper <jackson@ximian.com>
8585
8586         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8587         bug #49611
8588
8589 2003-10-09  Martin Baulig  <martin@ximian.com>
8590
8591         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8592         to the .ctor.
8593         (MethodCore.DoDefineParameters): Removed the TypeContainer
8594         argument; use the DeclSpace which was passed to the .ctor instead.
8595         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8596         TypeContainer; we only need a DeclSpace here.
8597
8598 2003-10-09  Martin Baulig  <martin@ximian.com>
8599
8600         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8601         to the .ctor.
8602         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8603         EmitContext's .ctor.    
8604
8605 2003-10-09  Martin Baulig  <martin@ximian.com>
8606
8607         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8608         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8609         AsAccessible(), moved them as well.
8610
8611         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8612
8613 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8614
8615         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8616
8617 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8618
8619         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8620         generation for >=, as spotted by Paolo, bug 48679.  
8621         Patch from David Waite.
8622
8623         * cs-tokenizer.cs: Add handling for #pragma.
8624
8625         * cs-parser.jay: Allow for both yield and yield return in the
8626         syntax.  The anti-cobolization of C# fight will go on!
8627
8628         * class.cs (TypeBuilder.DefineType): Catch error condition here
8629         (Parent.DefineType erroring out and returning null).
8630
8631         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8632         coping with enumerations variables, we were mistakenly processing
8633         them as a regular value type instead of built-in types.  Fixes the
8634         bug #48063
8635
8636         * typemanager.cs (IsBuiltinOrEnum): New method.
8637
8638 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8639
8640         * cs-parser.jay: Upgrade: yield now needs the return clause.
8641
8642 2003-09-19  Martin Baulig  <martin@ximian.com>
8643
8644         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8645         `MemberCache parent' argument.  Normally, an interface doesn't
8646         have a parent type except System.Object, but we use this in gmcs
8647         for generic type parameters.
8648
8649 2003-09-18  Martin Baulig  <martin@ximian.com>
8650
8651         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8652         on `type.IsInterface'; don't check whether the type has a parent
8653         to determine whether it's an interface.
8654
8655 2003-09-15  Martin Baulig  <martin@ximian.com>
8656
8657         * class.cs (TypeContainer.DefineType): Added an error flag to
8658         avoid reporting duplicate CS0146's ("class definition is
8659         circular.").
8660
8661         * driver.cs (Driver.MainDriver): Abort if
8662         RootContext.ResolveTree() reported any errors.
8663
8664 2003-09-07  Martin Baulig  <martin@ximian.com>
8665
8666         * report.cs (Error, Warning): Added overloaded versions which take
8667         a `params object[] args' and call String.Format().
8668
8669 2003-09-07  Martin Baulig  <martin@ximian.com>
8670
8671         * decl.cs (DeclSpace..ctor): Don't call
8672         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8673         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8674         (DeclSpace.RecordDecl): New method.
8675
8676         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8677
8678 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8679
8680         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8681         value attributes to be applied to ParameterBuilders.
8682
8683         * class.cs (MethodCore.LabelParameters): Make static and more
8684         generic so that it can be used from other places - like interface
8685         methods, for instance.
8686
8687         * interface.cs (Interface.Emit): Call LabelParameters before
8688         emitting attributes on the InterfaceMethod.
8689
8690 2003-08-26  Martin Baulig  <martin@ximian.com>
8691
8692         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8693         resolving aliases; fixes #47927.
8694
8695 2003-08-26  Martin Baulig  <martin@ximian.com>
8696
8697         * statement.cs (Using.DoResolve): This is internally emitting a
8698         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8699         do not always return.  Fixes #47681.
8700
8701 2003-08-26  Martin Baulig  <martin@ximian.com>
8702
8703         * decl.cs (MemberCore): Moved WarningNotHiding(),
8704         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8705         into MemberBase.
8706         (AdditionResult): Make this nested in DeclSpace.
8707         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8708         argument; call NamespaceEntry.Define() unless we're nested in a
8709         class or struct.
8710
8711         * namespace.cs (Namespace.DefineName): New public function.  This
8712         is called from DeclSpace's .ctor to add 
8713         (Namespace.Lookup): Include DeclSpaces in the lookup.
8714
8715         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8716
8717         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8718
8719 2003-08-25  Martin Baulig  <martin@ximian.com>
8720
8721         * convert.cs (Convert.ExplicitReferenceConversion): When
8722         converting from an interface type to a class, unbox if the target
8723         type is a struct type.  Fixes #47822.
8724
8725 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8726
8727         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8728         #47854.
8729
8730 2003-08-22  Martin Baulig  <martin@ximian.com>
8731
8732         * class.cs (TypeManager.DefineType): When defining a nested type,
8733         call DefineType() on our parent; fixes #47801.
8734
8735 2003-08-22  Martin Baulig  <martin@ximian.com>
8736
8737         * class.cs (MethodData.Define): While checking if a method is an
8738         interface implementation, improve the test a bit more to fix #47654.
8739
8740 2003-08-22  Martin Baulig  <martin@ximian.com>
8741
8742         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8743         correctly; fixes #47722.
8744
8745 2003-08-22  Martin Baulig  <martin@ximian.com>
8746
8747         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8748         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8749
8750         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8751
8752 2003-08-22  Martin Baulig  <martin@ximian.com>
8753
8754         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8755         can only be assigned in static constructors.  Fixes #47161.
8756
8757 2003-08-22  Martin Baulig  <martin@ximian.com>
8758
8759         Rewrote and improved the flow analysis code.
8760
8761         * flowbranching.cs (FlowBranching): Make this class abstract.
8762         (FlowBranching.CreateBranching): New static function to create a
8763         new flow branching.
8764         (FlowBranchingBlock, FlowBranchingException): New classes.
8765         (FlowBranching.UsageVector.Type): New public readonly field.
8766         (FlowBranching.UsageVector.Breaks): Removed the setter.
8767         (FlowBranching.UsageVector.Returns): Removed the setter.
8768         (FlowBranching.UsageVector): Added Break(), Return(),
8769         NeverReachable() and Throw() methods to modify the reachability.
8770         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8771         done by FlowBranching.Merge().
8772         (FlowBranching.UsageVector.MergeChild): New method; merges the
8773         merge result into the current vector.
8774         (FlowBranching.Merge): New abstract method to merge a branching.
8775
8776 2003-08-12  Martin Baulig  <martin@ximian.com>
8777
8778         * expression.cs (Indirection.CacheTemporaries): Create the
8779         LocalTemporary with the pointer type, not its element type.
8780
8781 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8782
8783         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8784         token was a keyword or not.
8785
8786         Add `error' options where an IDENTIFIER was expected;  Provide
8787         CheckToken and CheckIdentifierToken convenience error reporting
8788         functions. 
8789
8790         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8791
8792         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8793         NameSpaceEntry NameSpaceEntry.
8794
8795         (LookupInterfaceOrClass): Avoid creating a full qualified name
8796         from namespace and name: avoid doing lookups when we know the
8797         namespace is non-existant.   Use new Tree.LookupByNamespace which
8798         looks up DeclSpaces based on their namespace, name pair.
8799
8800         * driver.cs: Provide a new `parser verbose' to display the
8801         exception thrown during parsing.  This is turned off by default
8802         now, so the output of a failure from mcs is more graceful.
8803
8804         * namespace.cs: Track all the namespaces defined in a hashtable
8805         for quick lookup.
8806
8807         (IsNamespace): New method
8808
8809 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8810
8811         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8812         we know that we need to concatenate (full typename can never be
8813         null). 
8814
8815         * class.cs: ditto.
8816
8817         * statement.cs: Use a bitfield;  Do not initialize to null things
8818         which are done by the constructor by default.
8819
8820         * cs-parser.jay: bug fix, parameter was 4, not 3.
8821
8822         * expression.cs: Just use the property;
8823
8824         * statement.cs: No need for GetVariableInfo method.
8825
8826 2003-08-08  Martin Baulig  <martin@ximian.com>
8827
8828         * flowanalysis.cs (FlowReturns): This is now nested in the
8829         `FlowBranching' class.
8830         (MyBitVector): Moved this here from statement.cs.
8831         (FlowBranching.SiblingType): New enum type.
8832         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8833
8834 2003-08-07  Martin Baulig  <martin@ximian.com>
8835
8836         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8837         `FlowBranching' class and called `BranchingType'.
8838
8839 2003-08-07  Martin Baulig  <martin@ximian.com>
8840
8841         * flowanalysis.cs: Moved all the control flow analysis code into
8842         its own file.
8843
8844 2003-08-07  Martin Baulig  <martin@ximian.com>
8845
8846         * assign.cs (Assign.DoResolve): `target' must either be an
8847         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8848         #37319.
8849
8850 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8851
8852         * expression.cs (BinaryMethod): This kind of expression is created by the
8853         Binary class if it determines that the operator has to be handled
8854         by a method.
8855
8856         (BinaryDelegate): This kind of expression is created if we are
8857         dealing with a + or - operator on delegates.
8858
8859         (Binary): remove method, argumetns, and DelegateOperator: when
8860         dealing with methods, 
8861
8862         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8863
8864         * statement.cs (Block): use bitfields for the three extra booleans
8865         we had in use.   Remove unused topblock parameter.
8866
8867         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8868
8869         * assign.cs: Drop extra unneeded tests.
8870
8871 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8872
8873         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8874
8875         * statement.cs (Foreach): Use VariableStorage instead of
8876         LocalBuilders.   
8877
8878         * codegen.cs (VariableStorage): New class used by clients that
8879         require a variable stored: locals or fields for variables that
8880         need to live across yield.
8881
8882         Maybe provide a convenience api for EmitThis+EmitLoad?
8883
8884         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8885         these bad boys.
8886
8887 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8888
8889         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8890         RemapParameterLValue): New methods that are used to turn a
8891         precomputed FieldInfo into an expression like this:
8892
8893                 instance.FieldInfo
8894
8895         The idea is to use this instead of making LocalVariableReference
8896         have more than one meaning.
8897
8898         * cs-parser.jay: Add error production to BASE.
8899
8900         * ecore.cs: Deal with TypeManager.GetField returning null, which
8901         is now a valid return value.
8902
8903         (FieldExprNoAddress): New expression for Fields whose address can
8904         not be taken.
8905
8906         * expression.cs (LocalVariableReference): During the resolve
8907         phases, create new expressions if we are in a remapping context.
8908         Remove code that dealt with remapping here.
8909
8910         (ParameterReference): same.
8911
8912         (ProxyInstance): New expression, like the `This' expression, but
8913         it is born fully resolved.  We know what we are doing, so remove
8914         the errors that are targeted to user-provided uses of `this'.
8915
8916         * statement.cs (Foreach): our variable is now stored as an
8917         Expression;  During resolution, follow the protocol, dont just
8918         assume it will return this.
8919
8920 2003-08-06  Martin Baulig  <martin@ximian.com>
8921
8922         * support.cs (SeekableStreamReader.cs): New public class.
8923
8924         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8925         SeekableStreamReader instead of the normal StreamReader.
8926
8927 2003-08-04  Martin Baulig  <martin@ximian.com>
8928
8929         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8930         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8931         deambiguate casts and delegate invocations.
8932         (parenthesized_expression): Use the new tokens to ensure this is
8933         not a cast of method invocation.
8934
8935         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8936         when reading a `)' and Deambiguate_CloseParens () was previously
8937         called.
8938
8939         * expression.cs (ParenthesizedExpression): New class.  This is
8940         just used for the CS0075 test.
8941         (Binary.DoResolve): Check for CS0075.   
8942
8943 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8944
8945         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8946         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8947         reference comparison.
8948
8949         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8950         examine the ReturnType for equality - this is necessary in the
8951         cases of implicit and explicit operators whose signature also
8952         includes the return type.
8953
8954 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8955
8956         * namespace.cs: Cache the result of the namespace computation,
8957         instead of computing it every time.
8958
8959 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8960
8961         * decl.cs: Use a global arraylist that we reuse over invocations
8962         to avoid excesive memory consumption.  Reduces memory usage on an
8963         mcs compile by one meg (45 average).
8964
8965         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8966         private, work around that.
8967
8968 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8969
8970         * literal.cs (IntLiteral): Define Zero and One static literals. 
8971
8972         * cs-parser.jay (integer_literal): use static literals to reduce
8973         memory usage for the most used literals (0, 1 and -1).  211kb
8974         reduced in memory usage.
8975
8976         Replace all calls to `new ArrayList' with `new
8977         ArrayList(4)' which is a good average number for most allocations,
8978         and also requires only 16 bytes of memory for its buffer by
8979         default. 
8980
8981         This reduced MCS memory usage in seven megabytes for the RSS after
8982         bootstrapping.
8983
8984 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8985
8986         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8987         handle params methods the correct way by forming only one
8988         applicable set with params and normal methods in them. Earlier we
8989         were looking at params methods only if we found no normal methods
8990         which was not the correct thing to do.
8991
8992         (Invocation.BetterFunction): Take separate arguments indicating
8993         when candidate and the best method are params methods in their
8994         expanded form.
8995
8996         This fixes bugs #43367 and #46199.
8997
8998         * attribute.cs: Documentation updates.
8999
9000         (CheckAttribute): Rename to CheckAttributeTarget.
9001         (GetValidPlaces): Rename to GetValidTargets.
9002
9003         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9004         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9005
9006         Fixes bug #44468.
9007
9008 2003-07-28  Martin Baulig  <martin@ximian.com>
9009
9010         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9011         name when looking up the base class of a nested class.  Fixes #46977.
9012
9013 2003-07-26  Martin Baulig  <martin@ximian.com>
9014
9015         * expression.cs (Indexers.Indexer): New nested struct; contains
9016         getter, setter and the indexer's type.
9017         (Indexers.Properties): This is now an ArrayList of
9018         Indexers.Indexer's.
9019         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9020         indexer doesn't have any getters.
9021
9022         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9023         for embedded property and indexer assignments.
9024
9025 2003-07-26  Martin Baulig  <martin@ximian.com>
9026
9027         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9028         preprocessor directive is not the first non-whitespace character
9029         on a line.
9030
9031 2003-07-26  Martin Baulig  <martin@ximian.com>
9032
9033         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9034         namespace parsing, follow the spec more closely.
9035
9036         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9037         NamespaceEntry.Lookup().
9038
9039 2003-07-25  Martin Baulig  <martin@ximian.com>
9040
9041         * MethodCore.cs (OverridesSomething): New public field; it's set
9042         from TypeContainer.DefineMembers if this method overrides
9043         something (which doesn't need to be a method).  Fix #39462.
9044
9045 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9046
9047         * typemanager.cs (GetMembers): Ensure that the list of members is
9048         reversed. This keeps things in sync.
9049
9050         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9051         find an AttributeUsage attribute.
9052
9053         * expression.cs (Invocation.OverloadResolve): Perform the check
9054         which disallows Invoke to be directly called on a Delegate.
9055
9056         (Error_InvokeOnDelegate): Report error cs1533.
9057
9058 2003-07-25  Martin Baulig  <martin@ximian.com>
9059
9060         * expression.cs (Indexers.GetIndexersForType): Only look in the
9061         interface hierarchy if the requested type is already an
9062         interface.  Fixes #46788 while keeping #46502 fixed.
9063
9064 2003-07-25  Martin Baulig  <martin@ximian.com>
9065
9066         * class.cs (TypeContainer.DefineMembers): Check whether all
9067         readonly fields have been assigned and report warning CS0649 if
9068         not.
9069
9070         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9071         a valuetype.
9072
9073 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9074
9075         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9076         returned from GetMethods to make things consistent with the
9077         assumptions MCS makes about ordering of methods.
9078
9079         This should comprehensively fix bug #45127 and it does :-)
9080
9081         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9082         ordering is actually reverse.
9083
9084         * Clean up some debug messages I left lying around.
9085
9086         * interface.cs (Populate*): Get rid of code which emits attributes
9087         since the stage in which we emit attributes is the 'Emit' stage,
9088         not the define stage.
9089
9090         (Emit): Move attribute emission for interface members here.
9091
9092 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9093
9094         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9095         closely: we eliminate methods in base types when we have an
9096         applicable method in a top-level type.
9097
9098         Please see section 14.5.5.1 for an exact description of what goes
9099         on. 
9100
9101         This fixes bug #45127 and a host of other related to corlib compilation.
9102
9103         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9104         array is the method corresponding to the top-level type (this is
9105         because of the changes made to icall.c) so we change this
9106         accordingly.
9107
9108         (MethodGroupExpr.Name): This too.
9109
9110         * typemanager.cs (GetElementType): New method which does the right
9111         thing when compiling corlib. 
9112
9113         * everywhere: Make use of the above in the relevant places.
9114
9115 2003-07-22  Martin Baulig  <martin@ximian.com>
9116
9117         * cs-parser.jay (invocation_expression): Moved
9118         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9119         `cast_expression', but create a InvocationOrCast which later
9120         resolves to either an Invocation or a Cast.
9121
9122         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9123         method; call this before EmitStatement() to make sure that this
9124         expression can be used as a statement.
9125
9126         * expression.cs (InvocationOrCast): New class; resolves to either
9127         an Invocation or a Cast.
9128
9129         * statement.cs (StatementExpression): Call ResolveStatement() on
9130         the ExpressionStatement before emitting it.
9131
9132 2003-07-21  Martin Baulig  <martin@ximian.com>
9133
9134         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9135         `ref' and `out' attributes match; fixes #46220.
9136         (MemberAccess.ResolveMemberAccess): You can't reference a type
9137         through an expression; fixes #33180.
9138         (Indexers.GetIndexersForType): Don't return the indexers from
9139         interfaces the class implements; fixes #46502.
9140
9141 2003-07-21  Martin Baulig  <martin@ximian.com>
9142
9143         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9144         CS0661 checks; fixes bug #30442.
9145
9146 2003-07-21  Martin Baulig  <martin@ximian.com>
9147
9148         * decl.cs (AdditionResult): Added `Error'.
9149
9150         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9151
9152         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9153         makes cs0031.cs actually work.
9154
9155 2003-07-20  Martin Baulig  <martin@ximian.com>
9156
9157         * namespace.cs: Fixed that bug which caused a crash when compiling
9158         the debugger's GUI.
9159
9160 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9161
9162         * typemanager.cs (LookupTypeReflection): Never expose types which
9163         are NotPublic, NestedPrivate, NestedAssembly, or
9164         NestedFamANDAssem.  We used to return these, and later do a check
9165         that would report a meaningful error, but the problem is that we
9166         would not get the real match, if there was a name override.
9167
9168 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9169
9170         * namespace.cs (Namespace, Name): Do not compute the namespace
9171         name dynamically, compute it in the constructor.  This reduced
9172         memory usage by 1697 KB.
9173
9174         * driver.cs: Use --pause to pause at the end.
9175
9176 2003-07-17  Peter Williams  <peter@newton.cx>
9177
9178         * Makefile: Change the name of the test target so that it doesn't
9179         conflict with the recursive test target.
9180
9181 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9182
9183         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9184         AddressOf): Do not use EmitThis, that was wrong, use the actual
9185         this pointer.
9186
9187 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9188
9189         * class.cs (MethodData.Define): While checking if a method is an
9190         interface implementation, improve the test: If we are not public
9191         (use new test here: use the computed MethodAttributes directly,
9192         instead of the parsed modifier flags) check if the `implementing'
9193         method comes from an interface or not.
9194
9195         * pending.cs (VerifyPendingMethods): Slightly better error
9196         message.
9197
9198         * makefile: add test target that does the mcs bootstrap.
9199
9200 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9201
9202         * interface.cs (Define): Do nothing here since there are no
9203         members to populate etc. Move the attribute emission out of here
9204         since this was just totally the wrong place to put it. Attribute
9205         application happens during the 'Emit' phase, not in the 'Define'
9206         phase.
9207
9208         (Emit): Add this method and move the attribute emission here
9209
9210         * rootcontext.cs (EmitCode): Call the Emit method on interface
9211         types too.
9212
9213 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9214
9215         * expression.cs (OverloadResolve): Report error only if Location
9216         is not 'Null' which means that there was a probe going on.
9217
9218 2003-07-14  Martin Baulig  <martin@ximian.com>
9219
9220         * expression.cs (ConditionalLogicalOperator): New public class to
9221         implement user defined conditional logical operators.
9222         This is section 14.11.2 in the spec and bug #40505.
9223
9224 2003-07-14  Martin Baulig  <martin@ximian.com>
9225
9226         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9227
9228 2003-07-14  Martin Baulig  <martin@ximian.com>
9229
9230         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9231
9232         * ecore.cs (IVariable.VerifyFixed): New interface method.
9233
9234         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9235         operator, check whether the variable is actually fixed.  Fixes bug
9236         #36055.  Set a variable definitely assigned when taking its
9237         address as required by the spec.
9238
9239         * statement.cs (LocalInfo.IsFixed): New field.
9240         (LocalInfo.MakePinned): Set `IsFixed' to true.
9241
9242 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9243
9244         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9245         for .ctors, ensure that we only ask for members declared in the
9246         attribute type (BindingFlags.DeclaredOnly).
9247
9248         Fixes bug #43632.
9249
9250         * expression.cs (Error_WrongNumArguments): Report error 1501
9251         correctly the way CSC does.
9252
9253 2003-07-13  Martin Baulig  <martin@ximian.com>
9254
9255         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9256         lookup on the fully qualified name, to make things like "X.X" work
9257         where "X.X" is a fully qualified type name, but we also have a
9258         namespace "X" in the using list.  Fixes #41975.
9259
9260 2003-07-13  Martin Baulig  <martin@ximian.com>
9261
9262         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9263         function. If we're a CompoundAssign, we need to create an embedded
9264         CompoundAssign, not an embedded Assign.
9265         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9266         Fixes #45854.
9267
9268 2003-07-13  Martin Baulig  <martin@ximian.com>
9269
9270         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9271         work to fix bug #46088.
9272
9273 2003-07-13  Ravi Pratap <ravi@ximian.com>
9274
9275         * class.cs (Operator.Emit): Do not emit attributes here - it is
9276         taken care of by the Method class that we delegate too. This takes
9277         care of bug #45876.
9278
9279 2003-07-10  Martin Baulig  <martin@ximian.com>
9280
9281         * expression.cs (TypeOfVoid): New class.
9282         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9283
9284 2003-07-10  Martin Baulig  <martin@ximian.com>
9285
9286         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9287         bug #35957.
9288
9289 2003-07-10  Martin Baulig  <martin@ximian.com>
9290
9291         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9292         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9293
9294         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9295
9296         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9297
9298 2003-07-10  Martin Baulig  <martin@ximian.com>
9299
9300         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9301         of decimal.  Fixes #42850.
9302
9303         NOTE: I also fixed the created byte blob, but this doesn't work on
9304         the MS runtime and csc never produces any byte blobs for decimal
9305         arrays.
9306
9307 2003-07-10  Martin Baulig  <martin@ximian.com>
9308
9309         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9310         structs; fixes #32068.
9311         (Block.AddChildVariableNames): Fixed #44302.
9312
9313 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9314
9315         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9316
9317 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9318
9319         * attribute.cs: And this test is onger needed.
9320
9321 2003-07-08  Martin Baulig  <martin@ximian.com>
9322
9323         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9324         inaccessible types.  Fixes #36313.
9325
9326         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9327
9328         * namespace.cs (NamespaceEntry): Create implicit entries for all
9329         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9330         implicit entries for N1.N2 and N1.
9331
9332 2003-07-08  Martin Baulig  <martin@ximian.com>
9333
9334         Rewrote the handling of namespaces to fix a lot of the issues
9335         wrt. `using' aliases etc.
9336
9337         * namespace.cs (Namespace): Splitted this class into a
9338         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9339
9340         * typemanager.cs (TypeManager.IsNamespace): Removed.
9341         (TypeManager.ComputeNamespaces): Only compute namespaces from
9342         loaded assemblies here, not the namespaces from the assembly we're
9343         currently compiling.
9344
9345 2003-07-08  Martin Baulig  <martin@ximian.com>
9346
9347         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9348
9349 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9350
9351         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9352         already fixed it.  
9353
9354         I thought about the memory savings here, but LookupTypeReflection
9355         is used under already very constrained scenarios.  Compiling
9356         corlib or mcs only exposes one hit, so it would not really reduce
9357         any memory consumption.
9358
9359 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9360
9361         * typemanager.cs: fixes bug #45889 by only adding public types from
9362         other assemblies to the list of known types.
9363
9364 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9365
9366         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9367         on the type we resolved.
9368
9369 2003-07-05  Martin Baulig  <martin@ximian.com>
9370
9371         * pending.cs (PendingImplementation.ParentImplements): Don't
9372         create the proxy if the parent is abstract.
9373
9374         * class.cs (TypeContainer.DefineIndexers): Process explicit
9375         interface implementations first.  Fixes #37714.
9376
9377 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9378
9379         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9380         defined recursively;  but since we modify the input parameters
9381         (left is set to `this' temporarily), we reset this value if the
9382         left_is_explicit is false, which gives the original semantics to
9383         the code.  
9384
9385         * literal.cs (NullPointer): new class used to represent a null
9386         literal in a pointer context.
9387
9388         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9389         type is a pointer, use a NullPointer object instead of a
9390         NullLiteral.   Closes 43687
9391
9392         (ExplicitConversion): Convert pointer values using
9393         the conv opcode to the proper type.
9394
9395         * ecore.cs (New): change ValueTypeVariable property into a method,
9396         that returns whether the valuetype is suitable for being used.
9397
9398         * expression.cs (Binary.DoNumericPromotions): Only return if we
9399         the int constant was a valid uint, and we can return both left and
9400         right as uints.  If not, we continue processing, to trigger the
9401         type conversion.  This fixes 39018.
9402
9403         * statement.cs (Block.EmitMeta): During constant resolution, set
9404         the CurrentBlock property on the emitcontext, so that we resolve
9405         constants propertly.
9406
9407 2003-07-02  Martin Baulig  <martin@ximian.com>
9408
9409         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9410         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9411
9412         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9413         than emitting it here.
9414
9415         * statement.cs: Fixed some more flow analysis bugs.
9416
9417 2003-07-02  Martin Baulig  <martin@ximian.com>
9418
9419         * class.cs (MethodData.Define): When implementing interface
9420         methods, set Final unless we're Virtual.
9421
9422         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9423         check work for interface methods.
9424
9425 2003-07-01  Martin Baulig  <martin@ximian.com>
9426
9427         * ecore.cs (EmitContext.This): Replaced this property with a
9428         GetThis() method which takes a Location argument.  This ensures
9429         that we get the correct error location for a CS0188.
9430
9431 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9432
9433         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9434         ImplicitStandardConversion.
9435
9436         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9437
9438 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9439
9440         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9441         optimization.
9442
9443 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9444
9445         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9446         constructors.
9447
9448         (MethodData.Define): Turn off initlocals for unsafe methods.
9449
9450 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9451
9452         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9453         complete;  Fixes #37521.
9454
9455         * delegate.cs: Use Modifiers.TypeAttr to compute the
9456         TypeAttributes, instead of rolling our own.  This makes the flags
9457         correct for the delegates.
9458
9459 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9460
9461         * class.cs (Constructor.Define): Set the private flag for static
9462         constructors as well.
9463
9464         * cs-parser.jay (statement_expression): Set the return value to
9465         null, to avoid a crash when we catch an error.
9466
9467 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9468
9469         * cs-parser.jay: Applied patch from Jackson that adds support for
9470         extern and unsafe modifiers to destructor declarations.
9471
9472         * expression.cs: Report error 21 if the user is trying to index a
9473         System.Array.
9474
9475         * driver.cs: Add an error message, suggested by the bug report.
9476
9477         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9478         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9479
9480 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9481
9482         * namespace.cs: Add some information to reduce FAQs.
9483
9484 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9485
9486         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9487         underlying enumeration types.  Fixes #43915.
9488
9489         * expression.cs: Treat ushort/short as legal values to be used in
9490         bitwise operations.
9491
9492 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9493
9494         * delegate.cs: transfer custom attributes for paramenters from
9495         the delegate declaration to Invoke and BeginInvoke.
9496
9497 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9498
9499         * attribute.cs: handle custom marshalers and emit marshal info
9500         for fields, too.
9501
9502 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9503
9504         * makefile.gnu: Added anonymous.cs to the compiler sources.
9505
9506 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9507
9508         * iterators.cs: Change the name of the proxy class to include two
9509         underscores.
9510
9511         * cs-parser.jay: Update grammar to include anonymous methods.
9512
9513         * anonymous.cs: new file.
9514
9515 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9516
9517         * class.cs (Field.Define): Add missing test for pointers and
9518         safety. 
9519
9520 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9521
9522         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9523         we use the stobj opcode.
9524
9525         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9526         since it wasn't the correct fix. 
9527
9528         It still is puzzling that we are required to use stobj for IntPtr
9529         which seems to be a ValueType.
9530
9531 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9532
9533         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9534         during regular simple name resolution.   Now, the trick is that
9535         instead of returning for processing the simplename, we do a
9536         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9537         contextual lookup type).   If a match is found, return that, if
9538         not, return for further composition.
9539
9540         This fixes long-standing 30485.
9541
9542         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9543         using the address to initialize an object, do an Stobj instead of
9544         using the regular Stelem.
9545
9546         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9547         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9548         Because if we are a BaseIndexerAccess that value will be true.
9549         Fixes 43643.
9550
9551         * statement.cs (GotoCase.Resolve): Return after reporting an
9552         error, do not attempt to continue. 
9553
9554         * expression.cs (PointerArithmetic.Emit): If our operand is a
9555         long, convert our constants to match the operand before
9556         multiplying.  Convert to I type before adding.   Fixes 43670.
9557
9558 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9559
9560         * enum.cs (ImplicitConversionExists) : Rename to
9561         ImplicitEnumConversionExists to remove ambiguity. 
9562
9563         * ecore.cs (NullCast): New type of cast expression class which
9564         basically is very similar to EmptyCast with the difference being
9565         it still is a constant since it is used only to cast a null to
9566         something else
9567         (eg. (string) null)
9568
9569         * convert.cs (ImplicitReferenceConversion): When casting a null
9570         literal, we return a NullCast.
9571
9572         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9573         should be around anymore.
9574
9575         The renaming (reported was slightly wrong). Corrections:
9576
9577         ConvertImplicitStandard -> ImplicitConversionStandard
9578         ConvertExplicitStandard -> ExplicitConversionStandard
9579
9580         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9581         before passing them in !
9582
9583         * convert.cs (ImplicitConversionStandard): When comparing for
9584         equal expr and target types, ensure that expr is not a
9585         NullLiteral.
9586
9587         In general, we must not be checking (expr_type ==
9588         target_type) in the top level conversion methods
9589         (ImplicitConversion, ExplicitConversion etc). This checking is
9590         done in the methods that they delegate to.
9591
9592 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9593
9594         * convert.cs: Move Error_CannotConvertType,
9595         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9596         ImplicitNumericConversion, ImplicitConversionExists,
9597         ImplicitUserConversionExists, StandardConversionExists,
9598         FindMostEncompassedType, FindMostSpecificSource,
9599         FindMostSpecificTarget, ImplicitUserConversion,
9600         ExplicitUserConversion, GetConversionOperators,
9601         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9602         TryImplicitIntConversion, Error_CannotConvertImplicit,
9603         ConvertImplicitRequired, ConvertNumericExplicit,
9604         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9605         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9606         its own file.
9607
9608         Perform the following renames:
9609
9610         StandardConversionExists -> ImplicitStandardConversionExists
9611         ConvertImplicit -> ImplicitConversion
9612         ConvertImplicitStandard -> ImplicitStandardConversion
9613         TryImplicitIntConversion -> ImplicitIntConversion
9614         ConvertImplicitRequired -> ImplicitConversionRequired
9615         ConvertNumericExplicit -> ExplicitNumericConversion
9616         ConvertReferenceExplicit -> ExplicitReferenceConversion
9617         ConvertExplicit -> ExplicitConversion
9618         ConvertExplicitStandard -> ExplicitStandardConversion
9619
9620 2003-05-19  Martin Baulig  <martin@ximian.com>
9621
9622         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9623         (TypeInfo): Added support for structs having structs as fields.
9624
9625         * ecore.cs (FieldExpr): Implement IVariable.
9626         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9627         VariableInfo for the field.
9628
9629 2003-05-18  Martin Baulig  <martin@ximian.com>
9630
9631         * expression.cs (This.DoResolve): Report a CS0027 if we're
9632         emitting a field initializer.
9633
9634 2003-05-18  Martin Baulig  <martin@ximian.com>
9635
9636         * expression.cs (This.ResolveBase): New public function.
9637         (This.DoResolve): Check for CS0188.
9638
9639         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9640         This.Resolve().
9641
9642         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9643         `instance_expression' to null if we don't have any non-static
9644         methods.
9645
9646 2003-05-18  Martin Baulig  <martin@ximian.com>
9647
9648         Reworked the way how local variables and parameters are handled by
9649         the flow analysis code.
9650
9651         * statement.cs (TypeInfo, VariableMap): New public classes.
9652         (VariableInfo): New public class.  This is now responsible for
9653         checking whether a variable has been assigned.  It is used for
9654         parameters and local variables.
9655         (Block.EmitMeta): Take the InternalParameters as argument; compute
9656         the layout of the flow vectors here.
9657         (Block.LocalMap, Block.ParameterMap): New public properties.
9658         (FlowBranching): The .ctor doesn't get the InternalParameters
9659         anymore since Block.EmitMeta() now computes the layout of the flow
9660         vector.
9661         (MyStructInfo): This class is now known as `StructInfo' and nested
9662         in `TypeInfo'; we don't access this directly anymore.
9663
9664         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9665         property and removed IsAssigned(), IsFieldAssigned(),
9666         SetAssigned() and SetFieldAssigned(); we now call them on the
9667         VariableInfo so we don't need to duplicate this code everywhere.
9668
9669         * expression.cs (ParameterReference): Added `Block block' argument
9670         to the .ctor.
9671         (LocalVariableReference, ParameterReference, This): The new
9672         VariableInfo class is now responsible for all the definite
9673         assignment stuff.
9674
9675         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9676         IsParameterAssigned, SetParameterAssigned): Removed.
9677
9678 2003-05-18  Martin Baulig  <martin@ximian.com>
9679
9680         * typemanager.cs (InitCoreTypes): Try calling
9681         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9682         the 3-args-version.  Corlib now also needs our `void_type'.
9683         (GetMethod): Added overloaded version which takes an optional
9684         `bool report_errors' to allow lookups of optional methods.
9685
9686 2003-05-12  Martin Baulig  <martin@ximian.com>
9687
9688         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9689         only used for locals and not for parameters.
9690
9691 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9692
9693         * support.cs (InternalParameters.ParameterType): Return the
9694         ExternalType of the parameter.
9695
9696         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9697         they were unused.
9698
9699 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9700
9701         * class.cs (MethodData.Define): Do not set the `newslot' on
9702         interface members, if they are also flagged as "override".
9703
9704         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9705         better code for ++i and i++.  This only works for static fields
9706         and local variables.
9707
9708         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9709         want to pull the DeclSpace out of the builder_to_declspace instead
9710         of the TypeBuilder (like in TypeContainer.FindMembers).
9711
9712         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9713         instead of LookupTypeContainer.  Fixes the crash on .NET for
9714         looking up interface members.
9715
9716         * const.cs: Create our own emit context during the Definition
9717         stage, so that constants are evaluated in the proper context, when
9718         a recursive definition happens.
9719
9720 2003-05-11  Martin Baulig  <martin@ximian.com>
9721
9722         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9723         new block for a switch section.
9724         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9725         the adding/lookup in the switch block.  Fixes #39828.
9726
9727 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9728
9729         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9730         functionality: I needed to convert the data after I had performed
9731         the add/sub operation into the operands type size.
9732
9733         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9734         pass the type for the box operation, otherwise the resulting
9735         object would have been of type object.
9736
9737         (BoxedCast): Add constructor to specify the type to box as.
9738
9739 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9740
9741         * iterators.cs: I was reusing the `count' variable inadvertently,
9742         take steps to not allow this to happen.
9743
9744 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9745
9746         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9747         by creating an array at the point where the params starts and
9748         putting all those arguments there, then adjusting the size of the
9749         array.
9750
9751 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9752
9753         * expression.cs (New.AddressOf): Implement interface
9754         IMemoryLocation.  This is used when the `new' operator is used in
9755         the context of an invocation to a method on a value type.
9756
9757         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9758         example. 
9759
9760         * namespace.cs: Also check the using aliases here.
9761
9762         * driver.cs: Move the test for using validity after the types have
9763         been entered, so we do a single pass that also includes the using
9764         aliases. 
9765
9766         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9767         in the regular case.   CreateSiblingForFinally is doing extra
9768         error checking.
9769
9770         * attribute.cs (GetAttributeArgumentExpression): Store the result
9771         on an out value, and use the return value to indicate failure
9772         instead of using null (which is a valid return for Constant.GetValue).
9773
9774         * statement.cs: Perform the analysis flow for the increment
9775         portion after the statement, because this will be the real flow of
9776         execution.  Fixes #42385
9777
9778         * codegen.cs (EmitContext.EmitArgument,
9779         EmitContext.EmitStoreArgument): New helper functions when the
9780         RemapToProxy flag is set.
9781
9782         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9783         function.
9784
9785         Add support for remapping parameters. 
9786
9787         * iterators.cs: Propagate parameter values;  Store parameter
9788         values in the proxy classes.
9789
9790 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9791
9792         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9793         need a proxy reference;  I do not know what I was thinking
9794
9795         * cs-parser.jay (constructor_initializer): catch another error,
9796         and display nice message.
9797
9798         (field_declaration): catch void field declaration
9799         to flag a better error. 
9800
9801         * class.cs (MemberBase.CheckBase): Report an error instead of a
9802         warning if a new protected member is declared in a struct. 
9803         (Field.Define): catch the error of readonly/volatile.
9804
9805         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9806
9807         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9808         volatile variable is taken
9809
9810 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9811
9812         * statement.cs (Fixed.Resolve): Report an error if we are not in
9813         an unsafe context.
9814
9815 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9816
9817         * typemanager.cs: reuse the code that handles type clashes for
9818         delegates and enumerations.
9819
9820         * class.cs (Report28): Always report.
9821
9822         * expression.cs (EncodeAsAttribute): Allow nulls here.
9823
9824 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9825
9826         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9827         the functionality for testing whether an expression is valid for
9828         an attribute here.  Also handle the case of arrays of elements
9829         being stored. 
9830
9831         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9832         encoding a linear array into an array of objects that are suitable
9833         to be passed to an CustomAttributeBuilder.
9834
9835         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9836
9837         * ecore.cs: (FieldExpr): Handle field remapping here.
9838
9839         * iteratators.cs: Pass the instance variable (if the method is an
9840         instance method) to the constructors, so we can access the field
9841         variables on the class.
9842
9843         TODO: Test this with structs.  I think the THIS variable on
9844         structs might have to be a pointer, and not a refenrece
9845
9846 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9847
9848         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9849         local variables to fields in a proxy class.
9850
9851         * iterators.cs (PopulateProxy): Rename our internal fields to
9852         <XXX>.  
9853         Create a <THIS> field if we are an instance method, so we can
9854         reference our parent container variables.
9855         (MapVariable): Called back from the EmitContext code to enter a
9856         new variable to field mapping into the proxy class (we just create
9857         a FieldBuilder).
9858
9859         * expression.cs
9860         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9861         for using the remapped locals to fields.
9862
9863         I placed the code here, because that gives the same semantics to
9864         local variables, and only changes the Emit code.
9865
9866         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9867         statements inside iterators.
9868         (VariableInfo): Add a FieldBuilder for the cases when we are
9869         remapping local variables to fields in a proxy class
9870
9871         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9872         current_block != null.
9873
9874         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9875         not cope with strings, as it has been moved to the
9876         TableSwitchEmit.  Fixed bug in switch generation.
9877
9878         * expression.cs (New.DoResolve): Provide more context for the user
9879         when reporting an error.
9880
9881         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9882         pointers. 
9883
9884         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9885         check the permissions for it.  Note than in a type-resolution
9886         context the check was already present in DeclSpace.ResolveType,
9887         but was missing from the MemberAccess.
9888
9889         (ArrayCreation.CheckIndices): warn if the user has
9890         more nested levels of expressions, but there are no more
9891         dimensions specified.  Avoids crash on bug 41906.
9892
9893 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9894
9895         * statement.cs (Block): replace Implicit bool, for a generic
9896         flags.   
9897         New flag: `Unchecked'.  This is used during the EmitMeta phase
9898         (which is out-of-line with the regular Resolve/Emit process for a
9899         statement, as this is done ahead of time, but still gets a chance
9900         to call constant resolve).
9901
9902         (Block.Flags): new enum for adding a new flag.
9903
9904         (Block.EmitMeta): track the state of unchecked.
9905
9906         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9907         to enable constant resolution to work there as well.
9908
9909 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9910
9911         * typemanager.cs (ienumerable_type): Also look up
9912         System.Collections.IEnumerable. 
9913
9914 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9915
9916         TODO: Test more than one conditional per method.
9917
9918         * class.cs (Indexer.Define): Report the location where the user is
9919         referencing the unsupported feature.
9920
9921         (MethodData): Overload the use of `conditionals' to
9922         minimize the creation of needless ArrayLists.   This saves roughly
9923         212kb on my machine.
9924
9925         (Method): Implement the new IIteratorContainer interface.
9926         (Method.SetYields): Implement the method by setting the ModFlags
9927         to contain METHOD_YIELDS.
9928
9929         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9930         which just got set to null.
9931
9932         * iterators.cs: New file.
9933
9934         (Yield, YieldBreak): New statements.
9935
9936         * statement.cs (Return.Resolve): Flag an error if we are used in
9937         an iterator method.
9938
9939         * codegen.cs (InIterator): New flag set if the code is being
9940         compiled in an iterator method.
9941
9942         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9943         internal modifier, and we just use it to avoid adding extra
9944         fields, as this is seldom used.  
9945
9946         * cs-parser.jay: Add yield_statement (yield and yield break).
9947
9948         * driver.cs: New flag -v2 to turn on version 2 features. 
9949
9950         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9951         hashtable when v2 is enabled.
9952
9953 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9954
9955         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9956         there is already a namespace defined with this name.
9957
9958         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9959         people upgraded their corlibs.
9960
9961         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9962         always use fully qualified types, no need to use the compiler
9963         front end.
9964
9965         (TypeManager.IsNamespace): Use binarysearch.
9966
9967         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9968         AddDelegate): I did not quite use the new IsValid API properly: I
9969         have to pass the short-name and the fullname.  I was passing only
9970         the basename instead of the fullname sometimes. 
9971
9972         (TypeContainer.DefineType): call NamespaceClash.
9973
9974         * interface.cs (Interface.DefineType): use NamespaceClash before
9975         defining the type.
9976
9977         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9978         defining the type.
9979
9980         * enum.cs: (Enum.DefineType): use NamespaceClash before
9981         defining the type.
9982
9983         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9984         speed increase.  First, use the negative_hits cache when we get a
9985         negative.  Second, add the type with its full original name
9986         instead of the new . and + encoded name (reflection uses + to
9987         separate type from a nested type).  Use LookupTypeReflection
9988         directly which bypasses the type->name hashtable (that we already
9989         know does not contain the type.
9990
9991         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9992         location/container type. 
9993
9994         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9995
9996 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9997
9998         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9999
10000         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10001         method is being referenced in the method group from a static
10002         context, and report error 120 if so.
10003
10004         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10005         Error118. 
10006
10007         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10008         is created, we create the A namespace).
10009
10010         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10011         Fixes #41591
10012
10013 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10014
10015         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10016         invocation to ModuleBuilder.GetType with the same values will
10017         return a new type instance, so we need to cache its return
10018         values. 
10019
10020         * expression.cs (Binary.ResolveOperator): Only allow the compare
10021         operators on enums if they are of the same type.
10022
10023         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10024         types of ValueType on their own case.  Before we were giving them
10025         the same treatment as objects.
10026
10027         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10028         fullname.  Short name is used to compare against container name.
10029         Fullname is used to check against defined namespace names.
10030
10031         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10032         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10033
10034         (Method.CheckBase): Call parent.
10035         (MemberBase.CheckBase): Check for protected members on sealed
10036         classes.
10037         (PropertyBase.CheckBase): Call parent.
10038         (Field.Define): Call parent.
10039
10040         * report.cs: Negative error codes are now mapped to 8000 - code,
10041         so that the display is render more nicely.
10042
10043         * typemanager.cs: Do not use try/catch, instead report a regular
10044         error. 
10045
10046         (GetPointerType, GetReferenceType): These methods provide
10047         mechanisms to obtain the T* and T& from a T.  We had the code
10048         previously scattered around the code base, and it also used
10049         TypeManager.LookupType that would go through plenty of caches.
10050         This one goes directly to the type source.
10051
10052         In some places we did the Type.GetType followed by
10053         ModuleBuilder.GetType, but not in others, so this unifies the
10054         processing as well.
10055
10056         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10057         statements now that we have namespace information.
10058
10059         * typemanager.cs (IsNamespace): New method, returns whether the
10060         string presented is a namespace or not.
10061
10062         (ComputeNamespaces): New public entry point, computes the list of
10063         available namespaces, using the GetNamespaces API call in Mono, or
10064         the slower version in MS.NET.   
10065
10066         Now before we start the semantic analysis phase, we have a
10067         complete list of namespaces including everything that the user has
10068         provided.
10069
10070         Deleted old code to cache namespaces in .nsc files.
10071
10072 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10073
10074         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10075         class/struct location definition Location for the implicit
10076         constructor location.
10077
10078         (Operator.Define): Use the location of the operator for the
10079         implicit Method definition.
10080
10081         (Constructor.Emit): use the constructor location for the implicit
10082         base initializer constructor.
10083
10084         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10085         and the Expression class now contains two new methods:
10086
10087         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10088         isolate type lookup from the rest of the resolution process.
10089
10090         Since we use Expressions to hold type definitions due to the way
10091         we parse the input we have historically overloaded Resolve to
10092         perform the Type lookups if a special flag is passed.  Now this is
10093         eliminated and two methods take their place. 
10094
10095         The differences in the two methods between xStep and xTerminal is
10096         that xStep is involved in our current lookup system that uses
10097         SimpleNames to compose a name, while xTerminal is used just to
10098         catch the case where the simplename lookup failed.
10099
10100 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10101
10102         * expression.cs (ResolveMemberAccess): Remove redundant code.
10103         TypeExpr expressions are always born fully resolved.
10104
10105         * interface.cs (PopulateMethod): Do not lookup the types twice.
10106         We were doing it once during SemanticAnalysis and once during
10107         PopulateMethod.
10108
10109         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10110         in local variable type definitions, were being returned as a
10111         SimpleName (we decomposed everything into a string), that is
10112         because primary_expression was being used instead of a type in the
10113         grammar (reduce/reduce conflicts).
10114
10115         The part that was wrong is that we converted the expression into a
10116         string (an oversimplification in one hand, compounded with primary
10117         expressions doing string concatenation).
10118
10119         So things like:
10120
10121         A.B.C [] x;
10122
10123         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10124         using clauses from working on this particular context.  And a type
10125         was being matched directly against "A.B.C[]".
10126
10127         We now use the correct approach, and allow for ComposedCast to be
10128         part of the unary expression.  So the "A.B.C []" become a composed
10129         cast of "A.B.C" (as a nested group of MemberAccess with a
10130         SimpleName at the end) plus the rank composition "[]". 
10131
10132         Also fixes 35567
10133
10134 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10135
10136         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10137         for the access level checking.
10138
10139         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10140         `TypeContainer container', because I kept getting confused when I
10141         was debugging this code.
10142
10143         * expression.cs (Indexers): Instead of tracking getters/setters,
10144         we now track them in parallel.  We create one arraylist less, but
10145         most importantly it is possible now for the LValue code to find a
10146         matching get for a set.
10147
10148         (IndexerAccess.DoResolveLValue): Update the code.
10149         GetIndexersForType has been modified already to extract all the
10150         indexers from a type.  The code assumed it did not.
10151
10152         Also make the code set the correct return type for the indexer.
10153         This was fixed a long time ago for properties, but was missing for
10154         indexers.  It used to be void_type.
10155
10156         (Binary.Emit): Test first for doubles instead of
10157         floats, as they are more common.
10158
10159         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10160         when dealing with floats and the <=, >= operators.  This fixes bug
10161         #39314 
10162
10163         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10164         to load the array value by emitting a load on the foreach variable
10165         type.  This was incorrect.  
10166
10167         We now emit the code to load an element using the the array
10168         variable type, and then we emit the conversion operator.
10169
10170         Fixed #40176
10171
10172 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10173
10174         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10175
10176 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10177
10178         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10179         test for protection before we test for signatures. 
10180
10181         (MethodSignature.ToString): implement.
10182
10183         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10184         to the case where we reduced into a LongConstant.
10185
10186         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10187         depend on whether the information is acurrate, because the
10188         Microsoft runtime will always claim that the array type is public,
10189         regardless of the real state.
10190
10191         If the type is a pointer, another problem happens: the type is
10192         reported as non-public in Microsoft.  
10193
10194         In both cases we have to call CheckAccessLevel recursively with
10195         the underlying type as the argument to be tested.
10196
10197 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10198
10199         * assign.cs (Assign.Emit): If we are dealing with a compound
10200         assignment expression, we should use the code path that stores the
10201         intermediate result in a temporary value.  This fixes #40903.
10202
10203         *expression.cs (Indirection.ToString): Provide ToString method for
10204         debugging. 
10205
10206 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10207
10208         * class.cs: Null out fields holding references to Block objects so
10209         they can be garbage collected.
10210
10211         * expression.cs (OverloadResolve): Remove unused local.
10212
10213 2003-04-07  Martin Baulig  <martin@ximian.com>
10214
10215         * codegen.cs (EmitContext.CurrentFile): New public field.
10216         (EmitContext.Mark): Use the CurrentFile to check whether the
10217         location is in the correct file.
10218         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10219
10220 2003-04-07  Martin Baulig  <martin@ximian.com>
10221
10222         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10223
10224         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10225         location.  [FIXME: The location argument which gets passed to this
10226         method is sometimes wrong!]
10227
10228 2003-04-07  Nick Drochak <ndrochak@gol.com>
10229
10230         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10231
10232 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10233
10234         * expression.cs (Indirection.EmitAssign): We were using the
10235         temporary, but returning immediately instead of continuing the
10236         EmitAssing flow.
10237
10238 2003-04-06  Martin Baulig  <martin@ximian.com>
10239
10240         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10241         if it's a nested child, but also deriving from the outer class.
10242         See test 190.cs.
10243
10244         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10245         nested child, but also deriving from the outer class.  See
10246         test-190.cs.
10247         (FilterWithClosure): We may access private members of the outer
10248         class if we're a nested child and deriving from the outer class.
10249         (RealMemberLookup): Only set `closure_private_ok' if the
10250         `original_bf' contained BindingFlags.NonPublic.
10251
10252 2003-04-05  Martin Baulig  <martin@ximian.com>
10253
10254         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10255
10256 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10257
10258         * class.cs (Event.Define): Do not allow abstract events to have
10259         initializers. 
10260
10261 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10262
10263         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10264         block in event declarations.
10265
10266         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10267         value type, get its address.
10268
10269         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10270         leaving a class on the stack instead of a boolean value (int
10271         0/1).  Change the code so we compare against null, and then the
10272         result against zero.
10273
10274         * class.cs (TypeContainer.GetClassBases): We were checking for the
10275         parent class being sealed too late.
10276
10277         * expression.cs (Binary.Emit): For <= and >= when dealing with
10278         floating point values, use cgt.un and clt.un instead of cgt and
10279         clt alone.
10280
10281 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10282
10283         * statement.cs: Apply the same optimization as MS: skip the 
10284         GetEnumerator returning an IEnumerator, and use the one returning a 
10285         CharEnumerator instead. This allows us to avoid the try-finally block 
10286         and the boxing.
10287
10288 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10289
10290         * cs-parser.jay: Attributes cannot be applied to
10291                          namespaces. Fixes #40473
10292
10293 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10294
10295         * class.cs:
10296         (Add*): check if the name is valid using the full name for constants,
10297         fields, properties and events.
10298
10299 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10300
10301         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10302         char constants to be part of the enumeration.
10303
10304         * expression.cs (Conditional.DoResolve): Add support for operator
10305         true. Implements the missing functionality from 14.12
10306
10307         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10308         operator true/false as required by the spec.
10309
10310         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10311         implicit conversion to boolean.
10312
10313         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10314         also one where the type implements `operator true'. 
10315
10316         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10317         get an expression that will invoke operator true based on an
10318         expression.  
10319
10320         (GetConversionOperators): Removed the hack that called op_True
10321         here.  
10322
10323         (Expression.ResolveBoolean): Move this from Statement.
10324
10325 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10326
10327         * ecore.cs (FieldExpr): do not allow initialization of initonly
10328         fields on derived classes
10329
10330 2003-03-13  Martin Baulig  <martin@ximian.com>
10331
10332         * statement.cs (Block.Emit): Call ig.BeginScope() and
10333         ig.EndScope() when compiling with debugging info; call
10334         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10335
10336 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10337
10338         * expression.cs (Indexers): Do not construct immediately, allow
10339         for new members to be appended as we go.  Fixes 38143
10340
10341 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10342
10343         * expression.cs: save/restore context when resolving an unchecked
10344         expression.
10345
10346 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10347
10348         * cfold.cs: Catch division by zero in modulus operator during
10349         constant folding.
10350
10351 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10352
10353         * interface.cs (Interface.DefineMembers): Avoid defining members
10354         twice. 
10355
10356 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10357
10358         * driver.cs: handle the +/- options for -noconfig
10359
10360         * statement.cs (Unckeched.Resolve): Also track the state of
10361         unchecked in the Resolve phase.
10362
10363 2003-02-27  Martin Baulig  <martin@ximian.com>
10364
10365         * ecore.cs (Expression.MemberLookup): Don't create a
10366         MethodGroupExpr for something which is not a method.  Fixes #38291.
10367
10368 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10369
10370         * class.cs (MemberBase.CheckParameters): Also check that the type
10371         is unmanaged if it is a pointer.
10372
10373         * expression.cs (SizeOf.Resolve): Add location information.
10374
10375         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10376         a managed type is declared.
10377
10378         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10379         parameter modifiers as well.  Fixes bug 38606
10380
10381         * class.cs: Very sad.  Am backing out the speed up changes
10382         introduced by the ArrayList -> Array in the TypeContainer, as they
10383         were not actually that much faster, and introduced a bug (no error
10384         reports on duplicated methods).
10385
10386         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10387         source first, this will guarantee that we have a valid expression
10388         before calling in lower levels functions that will require a
10389         resolved object.  Then use this original_source in the
10390         target.ResolveLValue instead of the original source that was
10391         passed to us.
10392
10393         Another change.  Use target.Resolve instead of LValueResolve.
10394         Although we are resolving for LValues, we will let the Assign code
10395         take care of that (it will be called again from Resolve).  This
10396         basically allows code like this:
10397
10398         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10399         class Y { void A (X x) { x [0] += o; }
10400
10401         The problem was that the indexer was trying to resolve for
10402         set_Item (idx, object o) and never finding one.  The real set_Item
10403         was set_Item (idx, X).  By delaying the process we get the right
10404         semantics. 
10405
10406         Fixes bug 36505
10407
10408 2003-02-23  Martin Baulig  <martin@ximian.com>
10409
10410         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10411         while calling DoEmit ().
10412
10413         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10414         source files; if you use the #line directive inside a method, the
10415         compiler stops emitting line numbers for the debugger until it
10416         reaches the end of the method or another #line directive which
10417         restores the original file.
10418
10419 2003-02-23  Martin Baulig  <martin@ximian.com>
10420
10421         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10422
10423 2003-02-23  Martin Baulig  <martin@ximian.com>
10424
10425         * statement.cs (Block.AddChildVariableNames): We need to call this
10426         recursively, not just for our immediate children.
10427
10428 2003-02-23  Martin Baulig  <martin@ximian.com>
10429
10430         * class.cs (Event.Define): Always make the field private, like csc does.
10431
10432         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10433         actually work, fixes bug #37521.
10434
10435 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10436
10437         * delegate.cs: When creating the various temporary "Parameters"
10438         classes, make sure that we call the ComputeAndDefineParameterTypes
10439         on those new parameters (just like we do with the formal ones), to
10440         allow them to be resolved in the context of the DeclSpace.
10441
10442         This fixes the bug that Dick observed in Bugzilla #38530.
10443
10444 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10445
10446         * expression.cs (ResolveMemberAccess): When resolving a constant,
10447         do not attempt to pull a constant if the value was not able to
10448         generate a valid constant.
10449
10450         * const.cs (LookupConstantValue): Do not report more errors than required.
10451
10452 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10453
10454         * expression.cs: fixes bug #38328.
10455
10456 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10457
10458         * class.cs: Changed all the various members that can be part of a
10459         class from being an ArrayList to be an Array of the right type.
10460         During the DefineType type_list, interface_list, delegate_list and
10461         enum_list are turned into types, interfaces, delegates and enums
10462         arrays.  
10463
10464         And during the member population, indexer_list, event_list,
10465         constant_list, field_list, instance_constructor_list, method_list,
10466         operator_list and property_list are turned into their real arrays.
10467
10468         Although we could probably perform this operation earlier, for
10469         good error reporting we need to keep the lists and remove the
10470         lists for longer than required.
10471
10472         This optimization was triggered by Paolo profiling the compiler
10473         speed on the output of `gen-sample-program.pl' perl script. 
10474
10475         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10476         not crash in methods like MemberLookupFailed that use this field.  
10477
10478         This problem arises when the compiler fails to resolve a type
10479         during interface type definition for example.
10480
10481 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10482
10483         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10484         inherit from System.Object, so we have to stop at null, not only
10485         when reaching System.Object.
10486
10487 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10488
10489         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10490         DeclaredOnly because the parent indexer might have had a different
10491         name, but did not loop until the top of the hierarchy was reached.
10492
10493         The problem this one fixes is 35492: when a class implemented an
10494         indexer from an interface, we were getting the interface method
10495         (which was abstract) and we were flagging an error (can not invoke
10496         abstract method).
10497
10498         This also keeps bug 33089 functioning, and test-148 functioning.
10499
10500         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10501         out if a method is special is to see if it is declared in a
10502         property or event, or whether it is one of the predefined operator
10503         names.   This should fix correctly #36804.
10504
10505 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10506
10507         The goal here is to remove the dependency on EmptyCast.Peel ().
10508         Killing it completely.
10509
10510         The problem is that currently in a number of places where
10511         constants are expected, we have to "probe" for an EmptyCast, and
10512         Peel, which is not the correct thing to do, as this will be
10513         repetitive and will likely lead to errors. 
10514
10515         The idea is to remove any EmptyCasts that are used in casts that
10516         can be reduced to constants, so we only have to cope with
10517         constants. 
10518
10519         This bug hunt was triggered by Bug 37363 and the desire to remove
10520         the duplicate pattern where we were "peeling" emptycasts to check
10521         whether they were constants.  Now constants will always be
10522         constants.
10523
10524         * ecore.cs: Use an enumconstant here instead of wrapping with
10525         EmptyCast.  
10526
10527         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10528         throwing me off.  By handling this we can get rid of a few hacks.
10529
10530         * statement.cs (Switch): Removed Peel() code.
10531
10532 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10533
10534         * class.cs: Location information for error 508
10535
10536         * expression.cs (New.DoResolve): Add a guard against double
10537         resolution of an expression.  
10538
10539         The New DoResolve might be called twice when initializing field
10540         expressions (see EmitFieldInitializers, the call to
10541         GetInitializerExpression will perform a resolve on the expression,
10542         and later the assign will trigger another resolution
10543
10544         This leads to bugs (#37014)
10545
10546         * delegate.cs: The signature for EndInvoke should contain any ref
10547         or out parameters as well.  We were not doing this in the past. 
10548
10549         * class.cs (Field.Define): Do not overwrite the type definition
10550         inside the `volatile' group.  Turns out that volatile enumerations
10551         were changing the type here to perform a validity test, which
10552         broke conversions. 
10553
10554 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10555
10556         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10557         and structs, we do not want to load the instance variable
10558
10559         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10560         enum_type has to be handled like an object reference (implicit
10561         conversions exists from this to object), but the regular IsClass
10562         and IsValueType tests will never return true for this one.
10563
10564         Also we use TypeManager.IsValueType instead of type.IsValueType,
10565         just for consistency with the rest of the code (this is only
10566         needed if we ever use the construct exposed by test-180.cs inside
10567         corlib, which we dont today).
10568
10569 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10570
10571         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10572         just InternalCall.
10573
10574 2003-02-09  Martin Baulig  <martin@ximian.com>
10575
10576         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10577         (Namespace.DefineNamespaces): New static public method; this is
10578         called when we're compiling with debugging to add all namespaces
10579         to the symbol file.
10580
10581         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10582         pass it to the Namespace's .ctor.
10583
10584         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10585         and MethodBase arguments; pass the namespace ID to the symwriter;
10586         pass the MethodBase instead of the token to the symwriter.
10587         (SymbolWriter.DefineNamespace): New method to add a namespace to
10588         the symbol file.
10589
10590 2003-02-09  Martin Baulig  <martin@ximian.com>
10591
10592         * symbolwriter.cs: New file.  This is a wrapper around
10593         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10594         methods here in near future.
10595
10596 2003-02-09  Martin Baulig  <martin@ximian.com>
10597
10598         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10599         ILGenerator.MarkSequencePoint() which are actually used by the
10600         symbol writer.
10601
10602 2003-02-09  Martin Baulig  <martin@ximian.com>
10603
10604         * location.cs (SourceFile): New public sealed class.  This
10605         contains the name and an index which is used in the location's token.
10606         (Location): Reserve an appropriate number of bits in the token for
10607         the source file instead of walking over that list, this gives us a
10608         really huge performance improvement when compiling with debugging.
10609
10610         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10611         `SourceFile' argument instead of a string.
10612         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10613         but don't parse/tokenize here, we need to generate the list of all
10614         source files before we do that.
10615         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10616         the files.
10617
10618         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10619         instead of a string.
10620
10621         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10622         of a string.
10623
10624 2003-02-09  Martin Baulig  <martin@ximian.com>
10625
10626         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10627         filename on `#line default'.
10628
10629 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10630
10631         * statement.cs: don't clear the pinned var when the fixed statement
10632         returns from the method (fixes bug#37752).
10633
10634 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10635
10636         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10637         to IsValueType.
10638
10639 2003-02-07  Martin Baulig  <martin@ximian.com>
10640
10641         * driver.cs: Removed the `--debug-args' command line argument.
10642
10643         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10644         automatically by the AsssemblyBuilder.
10645         (CodeGen.InitializeSymbolWriter): We don't need to call any
10646         initialization function on the symbol writer anymore.  This method
10647         doesn't take any arguments.
10648
10649 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10650
10651         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10652         from referenced assemblies as well.
10653
10654 2003-02-02  Martin Baulig  <martin@ximian.com>
10655
10656         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10657
10658 2003-02-02  Martin Baulig  <martin@ximian.com>
10659
10660         * class.cs (Constructor.Emit): Open the symbol writer before
10661         emitting the constructor initializer.
10662         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10663         single-stepping through constructor initializers.
10664
10665 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10666
10667         * class.cs: Handle error 549: do not allow virtual methods in
10668         sealed classes. 
10669
10670 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10671
10672         * decl.cs: Check access levels when resolving types
10673
10674 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10675
10676         * statement.cs: Add parameters and locals set in catch blocks that might 
10677         return to set vector
10678
10679 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10680
10681         * class.cs (Operator): Set the SpecialName flags for operators.
10682
10683         * expression.cs (Invocation.DoResolve): Only block calls to
10684         accessors and operators on SpecialName methods.
10685
10686         (Cast.TryReduce): Handle conversions from char constants.
10687
10688
10689 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10690
10691         * statement.cs: small memory and time optimization in FlowBranching.
10692
10693 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10694
10695         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10696         problem that the last fix but in the other sid (Set).
10697
10698         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10699         access when there is no indexer in the hierarchy.
10700
10701 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10702
10703         * class.cs: Combine some if statements.
10704
10705 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10706
10707         * driver.cs: fixed bug #37187.
10708
10709 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10710
10711         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10712         any indexer, it's needed to build a list with all the indexers in the
10713         hierarchy (AllGetters), else we have problems. Fixes #35653.
10714
10715 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10716
10717         * class.cs (MethodData.Define): It is wrong for an interface
10718         implementation to be static in both cases: explicit and implicit.
10719         We were only handling this in one case.
10720
10721         Improve the if situation there to not have negations.
10722
10723         * class.cs (Field.Define): Turns out that we do not need to check
10724         the unsafe bit on field definition, only on usage.  Remove the test.
10725
10726 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10727
10728         * driver.cs: use assembly.Location instead of Codebase (the latest
10729         patch made mcs fail when using MS assemblies).
10730
10731 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10732
10733         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10734         get the path to *corlib.dll.
10735
10736 2003-01-21  Nick Drochak <ndrochak@gol.com>
10737
10738         * cs-tokenizer.cs:
10739         * pending.cs:
10740         * typemanager.cs: Remove compiler warnings
10741
10742 2003-01-20  Duncan Mak  <duncan@ximian.com>
10743
10744         * AssemblyInfo.cs: Bump the version number to 0.19.
10745
10746 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10747
10748         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10749
10750 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10751
10752         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10753
10754 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10755
10756         * cs-parser.jay: Small fix: we were not comparing the constructor
10757         name correctly.   Thanks to Zoltan for the initial pointer.
10758
10759 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10760
10761         * cs-tokenizer.cs: Set file name when specified with #line
10762
10763 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10764
10765         * cs-parser.jay: Only perform the constructor checks here if we
10766         are named like the class;  This will help provider a better
10767         error.  The constructor path is taken when a type definition is
10768         not found, but most likely the user forgot to add the type, so
10769         report that rather than the constructor error.
10770
10771 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10772
10773         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10774         allocations.
10775
10776 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10777
10778         * cs-parser.jay: Add cleanup call.
10779
10780 2003-01-13  Duncan Mak  <duncan@ximian.com>
10781
10782         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10783         consistent with other methods.
10784
10785 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10786
10787         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10788
10789 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10790
10791         * attribute.cs: only set GuidAttr to true when we have a
10792         GuidAttribute.
10793
10794 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10795
10796         * ecore.cs:
10797         * expression.cs:
10798         * typemanager.cs: fixes to allow mcs compile corlib with the new
10799         Type.IsSubclassOf fix.
10800
10801 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10802
10803         * expression.cs (LocalVariableReference.DoResolve): Classify a
10804         constant as a value, not as a variable.   Also, set the type for
10805         the variable.
10806
10807         * cs-parser.jay (fixed_statement): take a type instead of a
10808         pointer_type, so we can produce a better error message later.
10809
10810         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10811         as an error.  
10812
10813         (For.DoEmit): Make inifinite loops have a
10814         non-conditional branch back.
10815
10816         (Fixed.DoEmit): First populate the pinned variables, then emit the
10817         statement, then clear the variables.  Before I was emitting the
10818         code once for each fixed piece.
10819
10820
10821 2003-01-08  Martin Baulig  <martin@ximian.com>
10822
10823         * statement.cs (FlowBranching.MergeChild): A break in a
10824         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10825
10826 2003-01-08  Martin Baulig  <martin@ximian.com>
10827
10828         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10829         lives in the same number space than `param_map'.  Fixes #36154.
10830
10831 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10832
10833         * cs-parser.jay (constructor_declaration): Set the
10834         Constructor.ModFlags before probing for it.  This makes the
10835         compiler report 514, 515 and 132 (the code was there, but got
10836         broken). 
10837
10838         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10839         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10840         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10841
10842 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10843
10844         * enum.cs: create the enum static fields using the enum type.
10845
10846 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10847
10848         * class.cs: don't try to create the ParamBuilder for the return
10849         type if it's not needed (and handle it breaking for the ms runtime
10850         anyway).
10851
10852 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10853
10854         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10855
10856 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10857
10858         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10859         the command.   This showed up while compiling the JANET source
10860         code, which used \r as its only newline separator.
10861
10862 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10863
10864         * class.cs (Method.Define): If we are an operator (because it
10865         reuses our code), then set the SpecialName and HideBySig.  #36128
10866
10867 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10868
10869         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10870         exception, report error 120 `object reference required'.
10871
10872         * driver.cs: Add --pause option, used during to measure the size
10873         of the process as it goes with --timestamp.
10874
10875         * expression.cs (Invocation.DoResolve): Do not allow methods with
10876         SpecialName to be invoked.
10877
10878 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10879
10880         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10881         number before adding it.
10882
10883 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10884
10885         * ecore.cs (StandardImplicitConversion): When in an unsafe
10886         context, we allow conversion between void * to any other pointer
10887         type. This fixes bug #35973.
10888
10889 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10890
10891         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10892         is not thrown when extensionless outputs are used 
10893
10894 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10895
10896         * rootcontext.cs: fixed compilation of corlib.
10897
10898 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10899
10900         * attribute.cs (Attributes.Contains): Add new method.
10901
10902         * class.cs (MethodCore.LabelParameters): if the parameter is an
10903         `out' parameter, check that no attribute `[In]' has been passed.
10904
10905         * enum.cs: Handle the `value__' name in an enumeration.
10906
10907 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10908
10909         * decl.cs: Added special case to allow overrides on "protected
10910         internal" methods
10911
10912 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10913
10914         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10915         since it makes much more sense.
10916
10917         (Attributes.ctor): Don't require a Location parameter.
10918
10919         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10920
10921         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10922         since we already have that information per attribute.
10923
10924         * everywhere : make appropriate changes.
10925
10926         * class.cs (LabelParameters): Write the code which actually
10927         applies attributes to the return type. We can't do this on the MS
10928         .NET runtime so we flag a warning in the case an exception is
10929         thrown.
10930
10931 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10932
10933         * const.cs: Handle implicit null conversions here too.
10934
10935 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10936
10937         * class.cs (MethodCore.LabelParameters): Remove the extra
10938         Type [] parameter since it is completely unnecessary. Instead
10939         pass in the method's attributes so that we can extract
10940         the "return" attribute.
10941
10942 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10943
10944         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10945         of ignoring it and letting the compile continue.
10946
10947         * typemanager.cs (ChangeType): use an extra argument to return an
10948         error condition instead of throwing an exception.
10949
10950 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10951
10952         * expression.cs (Unary.TryReduce): mimic the code for the regular
10953         code path.  Perform an implicit cast in the cases where we can
10954         implicitly convert to one of the integral types, and then reduce
10955         based on that constant.   This fixes bug #35483.
10956
10957 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10958
10959         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10960
10961 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10962
10963         * namespace.cs: fixed bug #35489.
10964
10965 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10966
10967         * class.cs: Remove some dead code.
10968
10969         * cs-parser.jay: Estimate the number of methods needed
10970         (RootContext.MethodCount);
10971
10972         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10973         numbers instead of StringBuilders.
10974
10975         * support.cs (PtrHashtable): Add constructor with initial size;
10976         We can now reduce reallocations of the method table.
10977
10978 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10979
10980         * attribute.cs (ApplyAttributes): Keep track of the emitted
10981         attributes on a per-target basis. This fixes bug #35413.
10982
10983 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10984
10985         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10986         default to the Windows 1252 encoding.
10987
10988         (UnixParseOption): Support version, thanks to Alp for the missing
10989         pointer. 
10990
10991         * AssemblyInfo.cs: Add nice assembly information.
10992
10993         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10994         (bug 35169).
10995
10996         * cs-parser.jay: Allow a trailing comma before the close bracked
10997         in the attribute_section production.
10998
10999         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11000         address of the instance was being taken, I will take this out,
11001         because we take the address of the object immediately here.
11002
11003 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11004
11005         * typemanager.cs (AreMultipleAllowed): Take care of the most
11006         obvious case where attribute type is not in the current assembly -
11007         stupid me ;-)
11008
11009 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11010
11011         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11012         definitions, instead of doing that afterwards.  
11013
11014         Also we use a nice little hack, depending on the constructor, we
11015         know if we are a "composed" name or a simple name.  Hence, we
11016         avoid the IndexOf test, and we avoid 
11017
11018         * codegen.cs: Add code to assist in a bug reporter to track down
11019         the source of a compiler crash. 
11020
11021 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11022
11023         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11024         types have been emitted for a given element and flag an error
11025         if something which does not have AllowMultiple set is used more
11026         than once.
11027
11028         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11029         attribute types and their corresponding AllowMultiple properties
11030
11031         (AreMultipleAllowed): Check the property for a given type.
11032
11033         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11034         property in the case we have a TypeContainer.
11035
11036         (Attributes.AddAttribute): Detect duplicates and just skip on
11037         adding them. This trivial fix catches a pretty gross error in our
11038         attribute emission - global attributes were being emitted twice!
11039
11040         Bugzilla bug #33187 is now fixed.
11041
11042 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11045         instead of pp_and).
11046
11047         * expression.cs (Binary.ResolveOperator): I can only use the
11048         Concat (string, string, string) and Concat (string, string,
11049         string, string) if the child is actually a concatenation of
11050         strings. 
11051
11052 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11053
11054         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11055         context where we need a 2-character lookahead.
11056
11057         * pending.cs (PendingImplementation): Rework so we can keep track
11058         of interface types all the time, and flag those which were
11059         implemented by parents as optional.
11060
11061 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11062
11063         * expression.cs (Binary.ResolveOperator): Use
11064         String.Concat(string,string,string) or
11065         String.Concat(string,string,string,string) when possible. 
11066
11067         * typemanager: More helper methods.
11068
11069
11070 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11071
11072         * pending.cs: remove the bogus return from GetMissingInterfaces()
11073         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11074
11075 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11076
11077         * namespace.cs: avoid duplicated 'using xxx' being added to
11078         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11079         when we get more than one 'using' statement for the same namespace.
11080         Report a CS0105 warning for it.
11081
11082 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11083
11084         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11085         of calling getChar/putback, uses internal knowledge of it.    
11086
11087         (xtoken): Reorder tokenizer so most common patterns are checked
11088         first.  This reduces the compilation time in another 5% (from 8.11s
11089         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11090
11091         The parsing time is 22% of the compilation in mcs, and from that
11092         64% is spent on the tokenization process.  
11093
11094         I tried using a binary search for keywords, but this is slower
11095         than the hashtable.  Another option would be to do a couple of
11096         things:
11097
11098                 * Not use a StringBuilder, instead use an array of chars,
11099                   with a set value.  Notice that this way we could catch
11100                   the 645 error without having to do it *afterwards*.
11101
11102                 * We could write a hand-parser to avoid the hashtable
11103                   compares altogether.
11104
11105         The identifier consumption process takes 37% of the tokenization
11106         time.  Another 15% is spent on is_number.  56% of the time spent
11107         on is_number is spent on Int64.Parse:
11108
11109                 * We could probably choose based on the string length to
11110                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11111                   computations. 
11112
11113         Another 3% is spend on wrapping `xtoken' in the `token' function.
11114
11115         Handle 0xa0 as whitespace (#34752)
11116
11117 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11118
11119         * typemanager.cs (IsCLRType): New routine to tell whether a type
11120         is one of the builtin types.  
11121
11122         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11123         typecode in more places instead of doing pointer comparissions.
11124         We could leverage some knowledge about the way the typecodes are
11125         laid out.
11126
11127         New code to cache namespaces in assemblies, it is currently not
11128         invoked, to be used soon.
11129
11130         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11131
11132         * expression.cs (Binary.ResolveOperator): specially handle
11133         strings, and do not perform user-defined operator overloading for
11134         built-in types.
11135
11136 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11137
11138         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11139         internalcall as it is a pretty simple operation;  Avoid whenever
11140         possible to call Char.IsLetter.
11141
11142         (consume_identifier): Cut by half the number of
11143         hashtable calls by merging the is_keyword and GetKeyword behavior.
11144
11145         Do not short-circuit, because if we do, we
11146         report errors (ie, #if false && true would produce an invalid
11147         directive error);
11148
11149
11150 2002-11-24  Martin Baulig  <martin@ximian.com>
11151
11152         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11153         check constant ranges and report a CS0221.  Fixes #33186.
11154
11155 2002-11-24  Martin Baulig  <martin@ximian.com>
11156
11157         * cs-parser.jay: Make this work for uninitialized variable
11158         declarations in the `for' initializer.  Fixes #32416.
11159
11160 2002-11-24  Martin Baulig  <martin@ximian.com>
11161
11162         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11163         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11164
11165 2002-11-24  Martin Baulig  <martin@ximian.com>
11166
11167         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11168         argument; if true, we also check for user-defined conversions.
11169         This is only needed if both arguments are of a user-defined type.
11170         Fixes #30443, added test-175.cs.
11171         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11172
11173         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11174
11175 2002-11-24  Martin Baulig  <martin@ximian.com>
11176
11177         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11178         function to get the store opcode.
11179         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11180         only emit the Ldelema if the store opcode is Stobj.  You must run
11181         both test-34 and test-167 to test this.  Fixes #34529.
11182
11183 2002-11-23  Martin Baulig  <martin@ximian.com>
11184
11185         * ecore.cs (Expression.MemberLookup): Added additional
11186         `qualifier_type' argument which is used when we're being called
11187         from MemberAccess.DoResolve() and null if we're called from a
11188         SimpleName lookup.
11189         (Expression.MemberLookupFailed): New method to report errors; this
11190         does the CS1540 check and reports the correct error message.
11191
11192         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11193         argument for the CS1540 check and redone the way how we're dealing
11194         with private members.  See the comment in the source code for details.
11195         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11196         `closure_start_type' to `closure_qualifier_type' and check whether
11197         it's not null.  It was not this filter being broken, it was just
11198         being called with the wrong arguments.
11199
11200         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11201         and pass it the correct `qualifier_type'; this also does the error
11202         handling for us.
11203
11204 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11205
11206         * expression.cs (Invocation.EmitParams): If the we are dealing
11207         with a non-built-in value type, load its address as well.
11208
11209         (ArrayCreation): Use a a pretty constant instead
11210         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11211         static initializers.  
11212
11213         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11214         because they are not really value types, just glorified integers. 
11215
11216         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11217
11218         * ecore.cs: Remove redundant code for enumerations, make them use
11219         the same code path as everything else, fixes the casting issue
11220         with enumerations in Windows.Forms.
11221
11222         * attribute.cs: Do only cast to string if it is a string, the
11223         validation happens later.
11224
11225         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11226         people upgrade their corlibs.
11227
11228         * ecore.cs: Oops, enumerations were not following the entire code path
11229
11230 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11231
11232         * typemanager.cs (FilterWithClosure): Commented out the test for
11233         1540 in typemanager.cs, as it has problems when accessing
11234         protected methods from a parent class (see test-174.cs). 
11235
11236         * attribute.cs (Attribute.ValidateGuid): new method.
11237         (Attribute.Resolve): Use above.
11238
11239 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11240
11241         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11242
11243         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11244         handling for enumerations, as we only needed the TypeContainer
11245         functionality to begin with (this is required for the fix below to
11246         work for enums that reference constants in a container class for
11247         example). 
11248
11249         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11250
11251         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11252         a valid TypeBuilder to perform lookups on.o
11253
11254         * class.cs (InheritableMemberSignatureCompare): Use true in the
11255         call to GetGetMethod and GetSetMethod, because we are comparing
11256         the signature, and we need to get the methods *even* if they are
11257         private. 
11258
11259         (PropertyBase.CheckBase): ditto.
11260
11261         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11262         GotoCase.Resolve): Use Peel on EmpytCasts.
11263
11264         * ecore.cs (EmptyCast): drop child, add Peel method.
11265
11266 2002-11-17  Martin Baulig  <martin@ximian.com>
11267
11268         * ecore.cs (EmptyCast.Child): New public property.
11269
11270         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11271         label resolved to an EmptyCast.  Fixes #34162.
11272         (GotoCase.Resolve): Likewise.
11273         (Block.EmitMeta): Likewise.
11274
11275 2002-11-17  Martin Baulig  <martin@ximian.com>
11276
11277         * expression.cs (Invocation.BetterConversion): Prefer int over
11278         uint; short over ushort; long over ulong for integer literals.
11279         Use ImplicitConversionExists instead of StandardConversionExists
11280         since we also need to check for user-defined implicit conversions.
11281         Fixes #34165.  Added test-173.cs.
11282
11283 2002-11-16  Martin Baulig  <martin@ximian.com>
11284
11285         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11286         with the `true' and `false' literals.  Fixes #33151.
11287
11288 2002-11-16  Martin Baulig  <martin@ximian.com>
11289
11290         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11291         October 22nd; don't do the cs1540 check for static members.
11292
11293         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11294         now using our own filter here and doing the cs1540 check again.
11295
11296 2002-11-16  Martin Baulig  <martin@ximian.com>
11297
11298         * support.cs (InternalParameters): Don't crash if we don't have
11299         any fixed parameters.  Fixes #33532.
11300
11301 2002-11-16  Martin Baulig  <martin@ximian.com>
11302
11303         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11304         when looking up static methods to make this work on Windows.
11305         Fixes #33773.
11306
11307 2002-11-16  Martin Baulig  <martin@ximian.com>
11308
11309         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11310         a setter rather than using PropertyInfo.CanWrite.
11311
11312 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11313
11314         * class.cs: Allow acces to block member by subclasses. Fixes build
11315         breaker.
11316
11317 2002-11-14  Martin Baulig  <martin@ximian.com>
11318
11319         * class.cs (Constructor.Emit): Added the extern/block check.
11320         Fixes bug #33678.
11321
11322 2002-11-14  Martin Baulig  <martin@ximian.com>
11323
11324         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11325         iteration while looking for indexers, this is needed because the
11326         indexer may have a different name in our base classes.  Fixed the
11327         error reporting (no indexers at all, not get accessor, no
11328         overloaded match).  Fixes bug #33089.
11329         (IndexerAccess.DoResolveLValue): Likewise.
11330
11331 2002-11-14  Martin Baulig  <martin@ximian.com>
11332
11333         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11334         indexers.  Fixes the first part of bug #33089.
11335         (MethodSignature.InheritableMemberSignatureCompare): Added support
11336         for properties.
11337
11338 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11339
11340         * attribute.cs (Attribute.Resolve): Catch the
11341         NullReferenceException and report it since it isn't supposed to
11342         happen. 
11343
11344 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11345
11346         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11347         LogicalOr and LogicalAnd that can benefit from recursively
11348         handling EmitBranchable.  The code now should be nice for Paolo.
11349
11350 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11351
11352         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11353         the Type lookups, as we perform quite a number of lookups on
11354         non-Types.  This can be removed once we can deterministically tell
11355         whether we have a type or a namespace in advance.
11356
11357         But this might require special hacks from our corlib.
11358
11359         * TODO: updated.
11360
11361         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11362         and double which avoids a conversion from an integer to a double.
11363
11364         * expression.cs: tiny optimization, avoid calling IsConstant,
11365         because it effectively performs the lookup twice.
11366
11367 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11368
11369         But a bogus return here to keep the semantics of the old code
11370         until the Mono runtime is fixed.
11371
11372         * pending.cs (GetMissingInterfaces): New method used to remove all
11373         the interfaces that are already implemented by our parent
11374         classes from the list of pending methods. 
11375
11376         * interface.cs: Add checks for calls after ResolveTypeExpr.
11377
11378 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11379
11380         * class.cs (Class.Emit): Report warning 67: event not used if the
11381         warning level is beyond 3.
11382
11383         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11384         being a NullLiteral.
11385
11386         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11387         specifiers. 
11388
11389         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11390         path that might fail if a type can not be resolved.
11391
11392         * expression.cs (Binary.Emit): Emit unsigned versions of the
11393         operators. 
11394
11395         * driver.cs: use error 5.
11396
11397 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11398
11399         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11400
11401 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11402
11403         * cs-parser.jay (switch_section): A beautiful patch from Martin
11404         Baulig that fixed 33094.
11405
11406 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11407
11408         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11409         Check whether the base is abstract and report an error if so.
11410
11411         * expression.cs (IndexerAccess.DoResolveLValue,
11412         IndexerAccess.DoResolve): ditto. 
11413
11414         (Invocation.DoResolve): ditto.
11415
11416         (Invocation.FullMethodDesc): Improve the report string.
11417
11418         * statement.cs (Block): Eliminate IsVariableDefined as it is
11419         basically just a wrapper for GetVariableInfo.
11420
11421         * ecore.cs (SimpleName): Use new 
11422
11423         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11424         type, as we return the actual parameter ref/unref state on a
11425         different call.
11426
11427 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11428
11429         * support.cs: Return proper flags REF/OUT fixing the previous
11430         commit.  
11431
11432         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11433         not used to mean `ref' but `ref or out' in ParameterReference
11434
11435         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11436         full type signature instead of calling TypeManger.CSharpName
11437         ourselves. 
11438
11439         * support.cs (InternalParameters.ParameterDesc): Do not compare
11440         directly to the modflags, because REF/OUT will actually be bitsets
11441         if set. 
11442
11443         * delegate.cs (VerifyMethod): Check also the modifiers.
11444
11445         * cs-tokenizer.cs: Fix bug where floating point values with an
11446         exponent where a sign was missing was ignored.
11447
11448         * driver.cs: Allow multiple assemblies to be specified in a single
11449         /r: argument
11450
11451 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11452
11453         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11454         because identifiers after a parenthesis would end up in this kind
11455         of production, and we needed to desamiguate it for having casts
11456         like:
11457
11458                 (UserDefinedType *) xxx
11459
11460 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11461
11462         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11463         we should set on the Bindingflags.NonPublic, but not turn on
11464         private_ok.  private_ok controls whether a Private member is
11465         returned (this is chekced on the filter routine), while the
11466         BindingFlags.NonPublic just controls whether private/protected
11467         will be allowed.   This fixes the problem part of the problem of
11468         private properties being allowed to be used in derived classes.
11469
11470         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11471         so we can call the children DoResolveLValue method (this will
11472         properly signal errors on lvalue assignments to base properties)
11473
11474         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11475         getter are null, and we have a property info, we know that this
11476         happened because the lookup failed, so we report an error 122 for
11477         protection level violation.
11478
11479         We also silently return if setter and getter are null in the
11480         resolve functions, this condition only happens if we have flagged
11481         the error before.  This is the other half of the problem. 
11482
11483         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11484         not have accessibility information, that is why we were returning
11485         true in the filter function in typemanager.cs.
11486
11487         To properly report 122 (property is inaccessible because of its
11488         protection level) correctly, we report this error in ResolveAccess
11489         by failing if both the setter and the getter are lacking (ie, the
11490         lookup failed). 
11491
11492         DoResolve and DoLResolve have been modified to check for both
11493         setter/getter being null and returning silently, the reason being
11494         that I did not want to put the knowledge about this error in upper
11495         layers, like:
11496
11497         int old = Report.Errors;
11498         x = new PropertyExpr (...);
11499         if (old != Report.Errors)
11500                 return null;
11501         else
11502                 return x;
11503
11504         So the property expr is returned, but it is invalid, so the error
11505         will be flagged during the resolve process. 
11506
11507         * class.cs: Remove InheritablePropertySignatureCompare from the
11508         class, as we no longer depend on the property signature to compute
11509         whether it is possible to implement a method or not.
11510
11511         The reason is that calling PropertyInfo.GetGetMethod will return
11512         null (in .NET, in Mono it works, and we should change this), in
11513         cases where the Get Method does not exist in that particular
11514         class.
11515
11516         So this code:
11517
11518         class X { public virtual int A { get { return 1; } } }
11519         class Y : X { }
11520         class Z : Y { public override int A { get { return 2; } } }
11521
11522         Would fail in Z because the parent (Y) would not have the property
11523         defined.  So we avoid this completely now (because the alternative
11524         fix was ugly and slow), and we now depend exclusively on the
11525         method names.
11526
11527         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11528         reference method, instead of using the property.
11529
11530         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11531         routines are gone now.
11532
11533         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11534         names, they were incorrectly named.
11535
11536         * cs-tokenizer.cs: Return are more gentle token on failure. 
11537
11538         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11539         had an out-of-sync index variable, which caused it to remove from
11540         the list of pending methods the wrong method sometimes.
11541
11542 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11543
11544         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11545         CanWrite, because those refer to this particular instance of the
11546         property, and do not take into account the fact that we can
11547         override single members of a property.
11548
11549         Constructor requires an EmitContext.  The resolution process does
11550         not happen here, but we need to compute the accessors before,
11551         because the resolution does not always happen for properties.
11552
11553         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11554         subclass, before we did not update this flag, but we did update
11555         bindingflags. 
11556
11557         (GetAccessors): Drop this routine, as it did not work in the
11558         presence of partially overwritten set/get methods. 
11559
11560         Notice that this broke the cs1540 detection, but that will require
11561         more thinking. 
11562
11563 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11564
11565         * class.cs:
11566         * codegen.cs:
11567         * driver.cs: issue a warning instead of an error if we don't support
11568         debugging for the platform. Also ignore a couple of errors that may
11569         arise when trying to write the symbols. Undo my previous patch.
11570
11571 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11572
11573         * driver.cs: ignore /debug switch except for Unix platforms.
11574
11575 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11576
11577         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11578
11579 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11580
11581         * driver.cs: Do not make mcs-debug conditional, so we do not break
11582         builds that use it.
11583
11584         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11585         review this patch.  But basically after all the children variables
11586         have been merged, the value of "Breaks" was not being set to
11587         new_breaks for Switch blocks.  I think that it should be set after
11588         it has executed.  Currently I set this to the value of new_breaks,
11589         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11590         conservative, but I do not understand this code very well.
11591
11592         I did not break anything in the build, so that is good ;-)
11593
11594         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11595
11596 2002-10-20  Mark Crichton  <crichton@gimp.org>
11597
11598         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11599
11600 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11601
11602         * cfold.cs: Fixed compile blocker.
11603
11604 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11605
11606         * driver.cs: I was chekcing the key, not the file.
11607
11608 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11609
11610         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11611         message that we were generating - we just need to silently return
11612         a null.
11613
11614 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11615
11616         * class.cs (Event.Define): Change my previous commit, as this
11617         breaks the debugger.  This is a temporary hack, as it seems like
11618         the compiler is generating events incorrectly to begin with.
11619
11620         * expression.cs (Binary.ResolveOperator): Added support for 
11621         "U operator - (E x, E y)"
11622
11623         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11624         y)".
11625
11626         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11627         init-only variables, but this path did not take into account that
11628         there might be also instance readonly variables.  Correct this
11629         problem. 
11630
11631         This fixes bug 32253
11632
11633         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11634         delegates as well.
11635
11636         * driver.cs: Change the extension for modules to `netmodule'
11637
11638         * cs-parser.jay: Improved slightly the location tracking for
11639         the debugger symbols.
11640
11641         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11642         modifiers that were specified instead of the hardcoded value
11643         (FamAndAssem).  This was basically ignoring the static modifier,
11644         and others.  Fixes 32429.
11645
11646         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11647         fixed a bug in the process (32476)
11648
11649         * expression.cs (ArrayAccess.EmitAssign): Patch from
11650         hwang_rob@yahoo.ca that fixes bug 31834.3
11651
11652 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11653
11654         * driver.cs: Make the module extension .netmodule.
11655
11656 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11657
11658         * driver.cs: Report an error if the resource file is not found
11659         instead of crashing.
11660
11661         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11662         false, like Emit does.
11663
11664 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11665
11666         * typemanager.cs: Remove unused private member.  Also reported mcs
11667         bug to report this as a warning like csc.
11668
11669 2002-10-15  Martin Baulig  <martin@gnome.org>
11670
11671         * statement.cs (Statement.Emit): Made this a virtual method; emits
11672         the line number info and calls DoEmit().
11673         (Statement.DoEmit): New protected abstract method, formerly knows
11674         as Statement.Emit().
11675
11676         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11677
11678 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11679
11680         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11681         have fixed a remaining problem: not every AddXXXX was adding a
11682         fully qualified name.  
11683
11684         Now everyone registers a fully qualified name in the DeclSpace as
11685         being defined instead of the partial name.  
11686
11687         Downsides: we are slower than we need to be due to the excess
11688         copies and the names being registered this way.  
11689
11690         The reason for this is that we currently depend (on the corlib
11691         bootstrap for instance) that types are fully qualified, because
11692         we dump all the types in the namespace, and we should really have
11693         types inserted into the proper namespace, so we can only store the
11694         basenames in the defined_names array.
11695
11696 2002-10-10  Martin Baulig  <martin@gnome.org>
11697
11698         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11699         from bug #31834, see the bug report for a testcase which is
11700         miscompiled.
11701
11702 2002-10-10  Martin Baulig  <martin@gnome.org>
11703
11704         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11705         flow analysis code for this.
11706
11707         * statement.cs (Do, While, For): Tell the flow analysis code about
11708         infinite loops.
11709         (FlowBranching.UsageVector): Added support for infinite loops.
11710         (Block.Resolve): Moved the dead code elimination here and use flow
11711         analysis to do it.
11712
11713 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11714
11715         * class.cs (Field.Define): Catch cycles on struct type
11716         definitions. 
11717
11718         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11719         fields if the fields are static.  We only need to check instance
11720         fields. 
11721
11722         * expression.cs (As.DoResolve): Test for reference type.
11723
11724         * statement.cs (Using.ResolveExpression): Use
11725         ConvertImplicitRequired, not ConvertImplicit which reports an
11726         error on failture
11727         (Using.ResolveLocalVariableDecls): ditto.
11728
11729         * expression.cs (Binary.ResolveOperator): Report errors in a few
11730         places where we had to.
11731
11732         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11733
11734 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11735
11736         * expression.cs: Use StoreFromPtr instead of extracting the type
11737         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11738
11739         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11740         an enumeration value to a System.Enum, but System.Enum is not a
11741         value type, but an class type, so we need to box.
11742
11743         (Expression.ConvertExplicit): One codepath could return
11744         errors but not flag them.  Fix this.  Fixes #31853
11745
11746         * parameter.cs (Resolve): Do not allow void as a parameter type.
11747
11748 2002-10-06  Martin Baulig  <martin@gnome.org>
11749
11750         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11751         if it's a class type and not a struct.  Fixes #31815.
11752
11753 2002-10-06  Martin Baulig  <martin@gnome.org>
11754
11755         * statement.cs: Reworked the flow analysis code a bit to make it
11756         usable for dead code elimination.
11757
11758 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11759
11760         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11761
11762 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11763
11764         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11765         to fix the test 165, will investigate deeper.
11766
11767 2002-10-04  Martin Baulig  <martin@gnome.org>
11768
11769         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11770         finally blocks actually work.
11771         (Try.Resolve): We don't need to create a sibling for `finally' if
11772         there is no finally block.
11773
11774 2002-10-04  Martin Baulig  <martin@gnome.org>
11775
11776         * class.cs (Constructor.Define): The default accessibility for a
11777         non-default constructor is private, not public.
11778
11779 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11780
11781         * class.cs (Constructor): Make AllowedModifiers public, add
11782         EXTERN.
11783
11784         * cs-parser.jay: Perform the modifiers test here, as the
11785         constructor for the Constructor class usually receives a zero
11786         because of the way we create it (first we create, later we
11787         customize, and we were never checking the modifiers).
11788
11789         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11790         is a version of LookupTypeReflection that includes the type-name
11791         cache.  This can be used as a fast path for functions that know
11792         the fully qualified name and are only calling into *.GetType() to
11793         obtain a composed type.
11794
11795         This is also used by TypeManager.LookupType during its type
11796         composition.
11797
11798         (LookupType): We now also track the real type name, as sometimes
11799         we can get a quey for the real type name from things like
11800         ComposedCast.  This fixes bug 31422.
11801
11802         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11803         complete type fullname, it does not have to go through the type
11804         resolution system to obtain the composed version of the type (for
11805         obtaining arrays or pointers).
11806
11807         (Conditional.Emit): Use the EmitBoolExpression to
11808         generate nicer code, as requested by Paolo.
11809
11810         (ArrayCreation.CheckIndices): Use the patch from
11811         hwang_rob@yahoo.ca to validate the array initializers. 
11812
11813 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11814
11815         * class.cs (ConstructorInitializer.Emit): simplify code by using
11816         Invocation.EmitCall, and at the same time, fix the bugs in calling
11817         parent constructors that took variable arguments. 
11818
11819         * ecore.cs (Expression.ConvertNumericExplicit,
11820         Expression.ImplicitNumericConversion): Remove the code that
11821         manually wrapped decimal (InternalTypeConstructor call is now gone
11822         as well).
11823
11824         * expression.cs (Cast.TryReduce): Also handle decimal types when
11825         trying to perform a constant fold on the type.
11826
11827         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11828
11829         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11830         that only turned off an error report, and did nothing else. 
11831
11832 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11833
11834         * driver.cs: Handle and ignore /fullpaths
11835
11836 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11837
11838         * expression.cs (Binary.ResolveOperator): Catch the case where
11839         DoNumericPromotions returns true, 
11840
11841         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11842
11843 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11844
11845         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11846         report error 70.
11847
11848 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11849
11850         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11851         conversion exists, but it is also required that the conversion be
11852         performed.  This manifested in "(Type64Enum) 2".  
11853
11854         * class.cs (TypeManager.AddMethod): The fix is not to change
11855         AddEnum, because that one was using a fully qualified name (every
11856         DeclSpace derivative does), but to change the AddMethod routine
11857         that was using an un-namespaced name.  This now correctly reports
11858         the duplicated name.
11859
11860         Revert patch until I can properly fix it.  The issue
11861         is that we have a shared Type space across all namespaces
11862         currently, which is wrong.
11863
11864         Options include making the Namespace a DeclSpace, and merge
11865         current_namespace/current_container in the parser.
11866
11867 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11868
11869         * cs-parser.jay: Improve error reporting when we get a different
11870         kind of expression in local_variable_type and
11871         local_variable_pointer_type. 
11872
11873         Propagate this to avoid missleading errors being reported.
11874
11875         * ecore.cs (ImplicitReferenceConversion): treat
11876         TypeManager.value_type as a target just like object_type.   As
11877         code like this:
11878
11879         ValueType v = 1;
11880
11881         Is valid, and needs to result in the int 1 being boxed before it
11882         is assigned to the value type v.
11883
11884         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11885         to validate the enumeration name.
11886
11887         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11888         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11889         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11890
11891         * ecore.cs (TryImplicitIntConversion): When doing an
11892         implicit-enumeration-conversion, check if the type is 64-bits and
11893         perform a conversion before passing to EnumConstant.
11894
11895 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11896
11897         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11898         report ambiguous type references.  Unlike the MS version, we
11899         report what the ambiguity is.   Innovation at work ;-)
11900
11901         (DeclSpace.FindType): Require a location argument to
11902         display when we display an ambiguous error.
11903
11904         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11905
11906         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11907
11908         * expression.cs (EmitDynamicInitializers): Apply patch from
11909         hwang_rob@yahoo.ca that fixes the order in which we emit our
11910         initializers. 
11911
11912 2002-09-21  Martin Baulig  <martin@gnome.org>
11913
11914         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11915         delegate takes no arguments.
11916
11917 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11918
11919         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11920         from integers.
11921
11922         * expression.cs: Extract the underlying type.
11923
11924         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11925
11926         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11927
11928 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11929
11930         * class.cs (TypeContainer.DefineType): We can not use the nice
11931         PackingSize with the size set to 1 DefineType method, because it
11932         will not allow us to define the interfaces that the struct
11933         implements.
11934
11935         This completes the fixing of bug 27287
11936
11937         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11938         means also structs.  This fixes part of the problem. 
11939         (Expresion.ImplicitReferenceConversionExists): ditto.
11940
11941         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11942         error if there were no errors reported during the type lookup
11943         process, to avoid duplicates or redundant errors.  Without this
11944         you would get an ambiguous errors plus a type not found.  We have
11945         beaten the user enough with the first error.  
11946
11947         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11948         reference. 
11949
11950         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11951         during the resolution process, stop the lookup, this avoids
11952         repeated error reports (same error twice).
11953
11954         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11955
11956         * typemanager.cs (LookupType): Redo the type lookup code to match
11957         the needs of System.Reflection.  
11958
11959         The issue is that System.Reflection requires references to nested
11960         types to begin with a "+" sign instead of a dot.  So toplevel
11961         types look like: "NameSpace.TopLevelClass", and nested ones look
11962         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11963         levels. 
11964
11965 2002-09-19  Martin Baulig  <martin@gnome.org>
11966
11967         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11968         says that a method always returns or always throws an exception,
11969         don't report the CS0161.
11970
11971         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11972         set `Returns = new_returns'.
11973
11974 2002-09-19  Martin Baulig  <martin@gnome.org>
11975
11976         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11977         to an enum constant, check for a CS0176.
11978
11979 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11980
11981         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11982         for operators that must be in pairs and report errors.
11983
11984         * ecore.cs (SimpleName.DoResolveType): During the initial type
11985         resolution process, when we define types recursively, we must
11986         check first for types in our current scope before we perform
11987         lookups in the enclosing scopes.
11988
11989         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11990
11991         (Invocation.VerifyArgumentsCompat): Call
11992         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11993         I thought we were supposed to always call this, but there are a
11994         few places in the code where we dont do it.
11995
11996 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11997
11998         * driver.cs: Add support in -linkres and -resource to specify the
11999         name of the identifier.
12000
12001 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12002
12003         * ecore.cs (StandardConversionExists): Sync with the conversion
12004         code: allow anything-* to void* conversions.
12005
12006         (FindMostSpecificSource): Use an Expression argument
12007         instead of a Type, because we might be handed over a Literal which
12008         gets a few more implicit conversions that plain types do not.  So
12009         this information was being lost.
12010
12011         Also, we drop the temporary type-holder expression when not
12012         required.
12013
12014 2002-09-17  Martin Baulig  <martin@gnome.org>
12015
12016         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12017         this is an explicit interface implementation.
12018
12019 2002-09-17  Martin Baulig  <martin@gnome.org>
12020
12021         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12022         different `IndexerName' attributes.
12023
12024         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12025         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12026         virtual CommonResolve().
12027
12028 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12029
12030         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12031         and convert that to the UnderlyingType.
12032
12033         * statement.cs (Foreach.Resolve): Indexers are just like variables
12034         or PropertyAccesses.
12035
12036         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12037         inside quoted strings, we were not doing this before.
12038
12039 2002-09-16  Martin Baulig  <martin@gnome.org>
12040
12041         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12042         resolve it.  This is needed for the definite assignment check of the
12043         instance expression, fixes bug #29846.
12044         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12045
12046 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12047
12048         * parameter.cs: Fix compile error.  Cannot reference static member
12049         from an instance object.  Is this an mcs bug?
12050
12051 2002-09-14  Martin Baulig  <martin@gnome.org>
12052
12053         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12054         multiple times.  Fixes bug #30295, added test-166.cs.
12055
12056 2002-09-14  Martin Baulig  <martin@gnome.org>
12057
12058         * statement.cs (Block.Emit): Don't emit unreachable code.
12059         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12060         `break' statements.
12061         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12062
12063 2002-09-14  Martin Baulig  <martin@gnome.org>
12064
12065         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12066         is set.
12067
12068 2002-09-14  Martin Baulig  <martin@gnome.org>
12069
12070         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12071         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12072         be false on the ms runtime.
12073
12074 2002-09-13  Martin Baulig  <martin@gnome.org>
12075
12076         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12077         the CS0038 error message.
12078
12079 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12080
12081         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12082         constant inside, return it.
12083
12084 2002-09-12  Martin Baulig  <martin@gnome.org>
12085
12086         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12087         implicit conversion can be done between enum types.
12088
12089         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12090         check whether an implicit conversion to the current enum's UnderlyingType
12091         exists and report an error if not.
12092
12093         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12094         without debugging support.
12095
12096         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12097         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12098
12099 2002-09-12  Martin Baulig  <martin@gnome.org>
12100
12101         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12102
12103         * ecore.cs (IMemberExpr.DeclaringType): New property.
12104         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12105         nonstatic member of an outer type (CS0038).
12106
12107 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12108
12109         * driver.cs: Activate the using-error detector at warning level
12110         4 (at least for MS-compatible APIs).
12111
12112         * namespace.cs (VerifyUsing): Small buglett fix.
12113
12114         * pending.cs (PendingImplementation): pass the container pointer. 
12115
12116         * interface.cs (GetMethods): Allow for recursive definition.  Long
12117         term, I would like to move every type to support recursive
12118         definitions, not the current ordering mechanism that we have right
12119         now.
12120
12121         The situation is this: Attributes are handled before interfaces,
12122         so we can apply attributes to interfaces.  But some attributes
12123         implement interfaces, we will now handle the simple cases
12124         (recursive definitions will just get an error).  
12125
12126         * parameter.cs: Only invalidate types at the end if we fail to
12127         lookup all types.  
12128
12129 2002-09-09  Martin Baulig  <martin@gnome.org>
12130
12131         * ecore.cs (PropertyExpr.Emit): Also check for
12132         TypeManager.system_int_array_get_length so this'll also work when
12133         compiling corlib.  Fixes #30003.
12134
12135 2002-09-09  Martin Baulig  <martin@gnome.org>
12136
12137         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12138         and throw an exception if we can't get the type's size.  Fixed #30040,
12139         added test-165.cs.
12140
12141 2002-09-09  Martin Baulig  <martin@gnome.org>
12142
12143         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12144
12145         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12146         context.  Fixes bug #30027.
12147
12148         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12149         virtual functions.  Fixes bug #30043, added test-164.cs.
12150
12151 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12152
12153         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12154
12155 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12156
12157         * driver.cs: Use an object to get the windows codepage since it's not a
12158         static property.
12159
12160 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12161
12162         * statement.cs (For.Emit): for infinite loops (test == null)
12163         return whether there is a break inside, not always "true".
12164
12165         * namespace.cs (UsingEntry): New struct to hold the name of the
12166         using definition, the location where it is defined, and whether it
12167         has been used in a successful type lookup.
12168
12169         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12170         strings.
12171
12172         * decl.cs: ditto.
12173
12174 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12175
12176         * attribute.cs : Fix incorrect code which relied on catching
12177         a NullReferenceException to detect a null being passed in
12178         where an object was expected.
12179
12180 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12181
12182         * statement.cs (Try): flag the catch variable as assigned
12183
12184         * expression.cs (Cast): Simplified by using ResolveType instead of
12185         manually resolving.
12186
12187         * statement.cs (Catch): Fix bug by using ResolveType.
12188
12189 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12190
12191         * expression.cs (BetterConversion): Special case for when we have
12192         a NullLiteral as the argument and we have to choose between string
12193         and object types - we choose string the way csc does.
12194
12195         * attribute.cs (Attribute.Resolve): Catch the
12196         NullReferenceException and report error #182 since the Mono
12197         runtime no more has the bug and having this exception raised means
12198         we tried to select a constructor which takes an object and is
12199         passed a null.
12200
12201 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12202
12203         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12204         message (1502, 1503) when we can't locate a method after overload
12205         resolution. This is much more informative and closes the bug
12206         Miguel reported.
12207
12208         * interface.cs (PopulateMethod): Return if there are no argument
12209         types. Fixes a NullReferenceException bug.
12210
12211         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12212         expressions too. Previously we were checking only in one place for
12213         positional arguments leaving out named arguments.
12214
12215         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12216         type to the enum type is not allowed. Remove code corresponding to
12217         that.
12218
12219         (ConvertNumericExplicit): Allow explicit conversions from
12220         the underlying type to enum type. This precisely follows the spec
12221         and closes a bug filed by Gonzalo.
12222
12223 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12224
12225         * compiler.csproj:
12226         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12227
12228 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12229
12230         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12231         it was important that we stored the right value after the
12232         reduction in `converted'.
12233
12234 2002-09-04  Martin Baulig  <martin@gnome.org>
12235
12236         * location.cs (Location.SymbolDocument): Use full pathnames for the
12237         source files.
12238
12239 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12240
12241         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12242         of the expression resolve mechanism, because that will catch the
12243         SimpleName error failures.
12244
12245         (Conditional): If we can not resolve the
12246         expression, return, do not crash.
12247
12248 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12249
12250         * cs-tokenizer.cs:
12251         (location): display token name instead of its number.
12252
12253 2002-08-28  Martin Baulig  <martin@gnome.org>
12254
12255         * expression.cs (Binary.ResolveOperator): Don't silently return
12256         but return an error if an operator cannot be applied between two
12257         enum types.
12258
12259 2002-08-28  Martin Baulig  <martin@gnome.org>
12260
12261         * class.cs (Constructor.Define): Set the permission attributes
12262         correctly instead of making all constructors public.
12263
12264 2002-08-28  Martin Baulig  <martin@gnome.org>
12265
12266         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12267         for private members before reporting a CS0103; if we find anything,
12268         it's a CS0122.
12269
12270 2002-08-28  Martin Baulig  <martin@gnome.org>
12271
12272         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12273         to check whether `closure_start_type == closure_invocation_type',
12274         we also need to check whether `m.DeclaringType == closure_invocation_type'
12275         before bypassing the permission checks.  We might be accessing
12276         protected/private members from the base class.
12277         (TypeManager.RealMemberLookup): Only set private_ok if private
12278         members were requested via BindingFlags.NonPublic.
12279
12280         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12281
12282         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12283         MethodGroupExpr.IsExplicitImpl if appropriate.
12284         (Invocation.DoResolve): Don't report the CS0120 for explicit
12285         interface implementations.
12286
12287 2002-08-27  Martin Baulig  <martin@gnome.org>
12288
12289         * expression.cs (Invocation.DoResolve): If this is a static
12290         method and we don't have an InstanceExpression, we must report
12291         a CS0120.
12292
12293 2002-08-25  Martin Baulig  <martin@gnome.org>
12294
12295         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12296         `==' between a valuetype and an object.
12297
12298 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12299
12300         * ecore.cs (TypeExpr): Provide a ToString method.
12301
12302 2002-08-24  Martin Baulig  <martin@gnome.org>
12303
12304         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12305         now called proggie.dbg and it's a binary file.
12306
12307 2002-08-23  Martin Baulig  <martin@gnome.org>
12308
12309         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12310
12311 2002-08-23  Martin Baulig  <martin@gnome.org>
12312
12313         * struct.cs (MyStructInfo.ctor): Make this work with empty
12314         structs; it's not allowed to use foreach() on null.
12315
12316 2002-08-23  Martin Baulig  <martin@gnome.org>
12317
12318         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12319         writer the full pathname of the generated assembly.
12320
12321 2002-08-23  Martin Baulig  <martin@gnome.org>
12322
12323         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12324         A `finally' block never returns or breaks; improved handling of
12325         unreachable code.
12326
12327 2002-08-23  Martin Baulig  <martin@gnome.org>
12328
12329         * statement.cs (Throw.Resolve): Allow `throw null'.
12330
12331 2002-08-23  Martin Baulig  <martin@gnome.org>
12332
12333         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12334         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12335         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12336         MemberLookup would return a wrong event if this is an explicit
12337         interface implementation and the class has an event with the same
12338         name.
12339
12340 2002-08-23  Martin Baulig  <martin@gnome.org>
12341
12342         * statement.cs (Block.AddChildVariableNames): New public method.
12343         (Block.AddChildVariableName): Likewise.
12344         (Block.IsVariableNameUsedInChildBlock): Likewise.
12345         (Block.AddVariable): Check whether a variable name has already
12346         been used in a child block.
12347
12348         * cs-parser.jay (declare_local_variables): Mark all variable names
12349         from the current block as being used in a child block in the
12350         implicit block.
12351
12352 2002-08-23  Martin Baulig  <martin@gnome.org>
12353
12354         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12355         find the symbol writer.
12356
12357         * driver.cs: csc also allows the arguments to /define being
12358         separated by commas, not only by semicolons.
12359
12360 2002-08-23  Martin Baulig  <martin@gnome.org>
12361
12362         * interface.cs (Interface.GetMembers): Added static check for events.
12363
12364 2002-08-15  Martin Baulig  <martin@gnome.org>
12365
12366         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12367         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12368
12369         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12370         why the MethodData.EmitDestructor() change was necessary.
12371
12372 2002-08-20  Martin Baulig  <martin@gnome.org>
12373
12374         * class.cs (TypeContainer.FindMembers): Added static check for events.
12375
12376         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12377
12378         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12379         use Type.GetEvents(), not Type.FindMembers().
12380
12381 2002-08-20  Martin Baulig  <martin@gnome.org>
12382
12383         * decl.cs (MemberCache): Added a special method cache which will
12384         be used for method-only searched.  This ensures that a method
12385         search will return a MethodInfo with the correct ReflectedType for
12386         inherited methods.      
12387
12388 2002-08-20  Martin Baulig  <martin@gnome.org>
12389
12390         * decl.cs (DeclSpace.FindMembers): Made this public.
12391
12392 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12393
12394         * delegate.cs: fixed build on windows.
12395         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12396
12397 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12398
12399         * ecore.cs (StandardConversionExists): Return a false
12400         if we are trying to convert the void type to anything else
12401         since that is not allowed.
12402
12403         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12404         we flag error 70 in the event an event is trying to be accessed
12405         directly from outside the declaring type.
12406
12407 2002-08-20  Martin Baulig  <martin@gnome.org>
12408
12409         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12410         MemberCache from typemanager.cs to decl.cs.
12411
12412 2002-08-19  Martin Baulig  <martin@gnome.org>
12413
12414         * class.cs (TypeContainer): Implement IMemberContainer.
12415         (TypeContainer.DefineMembers): Create the MemberCache.
12416         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12417         return public members if BindingFlags.Public was given, check
12418         whether members are static.
12419
12420 2002-08-16  Martin Baulig  <martin@gnome.org>
12421
12422         * decl.cs (DeclSpace.Define): Splitted this in Define and
12423         DefineMembers.  DefineMembers is called first and initializes the
12424         MemberCache.
12425
12426         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12427         DefineMembers() on all our DeclSpaces.
12428
12429         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12430         but call DefineMembers() on all nested interfaces.  We call their
12431         Define() in our new Define() function.
12432
12433         * interface.cs (Interface): Implement IMemberContainer.
12434         (Interface.Define): Moved all code except the attribute stuf to
12435         DefineMembers().
12436         (Interface.DefineMembers): Initialize the member cache.
12437
12438         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12439         need this anymore since we can use MemberCache.FindMembers directly.
12440
12441 2002-08-19  Martin Baulig  <martin@gnome.org>
12442
12443         * typemanager.cs (MemberCache): When creating the cache for an
12444         interface type, add all inherited members.
12445         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12446         to `out bool used_cache' and documented it.
12447         (TypeManager.MemberLookup): If we already used the cache in the first
12448         iteration, we don't need to do the interfaces check.
12449
12450 2002-08-19  Martin Baulig  <martin@gnome.org>
12451
12452         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12453         here from IMemberFinder and don't implement this interface anymore.
12454         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12455
12456         * typemanager.cs (IMemberFinder): This interface is now only used by
12457         classes which actually support the member cache.
12458         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12459         since we only put DeclSpaces into this Hashtable.
12460         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12461         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12462
12463 2002-08-16  Martin Baulig  <martin@gnome.org>
12464
12465         * typemanager.cs (ICachingMemberFinder): Removed.
12466         (IMemberFinder.MemberCache): New property.
12467         (TypeManager.FindMembers): Merged this with RealFindMembers().
12468         This function will never be called from TypeManager.MemberLookup()
12469         so we can't use the cache here, just the IMemberFinder.
12470         (TypeManager.MemberLookup_FindMembers): Check whether the
12471         IMemberFinder has a MemberCache and call the cache's FindMembers
12472         function.
12473         (MemberCache): Rewrote larger parts of this yet another time and
12474         cleaned it up a bit.
12475
12476 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12477
12478         * driver.cs (LoadArgs): Support quoting.
12479
12480         (Usage): Show the CSC-like command line arguments.
12481
12482         Improved a few error messages.
12483
12484 2002-08-15  Martin Baulig  <martin@gnome.org>
12485
12486         * typemanager.cs (IMemberContainer.Type): New property.
12487         (IMemberContainer.IsInterface): New property.
12488
12489         The following changes are conditional to BROKEN_RUNTIME, which is
12490         defined at the top of the file.
12491
12492         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12493         class'es members, but add all members from TypeHandle.ObjectType
12494         if we're an interface.
12495         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12496         is the current type.
12497         (MemberCache.CacheEntry.Container): Removed this field.
12498         (TypeHandle.GetMembers): Include inherited members.
12499
12500 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12501
12502         * typemanager.cs: fixed compilation and added a comment on a field that
12503         is never used.
12504
12505 2002-08-15  Martin Baulig  <martin@gnome.org>
12506
12507         * class.cs (ConstructorInitializer.Resolve): In the
12508         Expression.MemberLookup call, use the queried_type as
12509         invocation_type.
12510
12511         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12512         declared' attribute, it's always true.
12513         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12514         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12515         temporary wrapper for FindMembers which tells MemberLookup whether
12516         members from the base classes are included in the return value.
12517         This will go away soon.
12518         (TypeManager.MemberLookup): Use this temporary hack here; once the
12519         new MemberCache is completed, we don't need to do the DeclaredOnly
12520         looping here anymore since the MemberCache will take care of this.
12521         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12522         (MemberCache): When creating the MemberCache for a class, get
12523         members from the current class and all its base classes.
12524         (MemberCache.CacheEntry.Container): New field.  This is a
12525         temporary hack until the Mono runtime is fixed to distinguish
12526         between ReflectedType and DeclaringType.  It allows us to use MCS
12527         with both the MS runtime and the unfixed Mono runtime without
12528         problems and without accecting performance.
12529         (MemberCache.SearchMembers): The DeclaredOnly looping from
12530         TypeManager.MemberLookup is now done here.      
12531
12532 2002-08-14  Martin Baulig  <martin@gnome.org>
12533
12534         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12535         Type.GetFields on dynamic types but get the fields from the
12536         corresponding TypeContainer.
12537         (MyStructInfo.GetStructInfo): Added check for enum types.
12538
12539         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12540         (MemberList.SyncRoot): Implemented.
12541         (TypeManager.FilterWithClosure): No need to check permissions if
12542         closure_start_type == closure_invocation_type, don't crash if
12543         closure_invocation_type is null.
12544
12545 2002-08-13  Martin Baulig  <martin@gnome.org>
12546
12547         Rewrote TypeContainer.FindMembers to use a member cache.  This
12548         gives us a speed increase of about 35% for the self-hosting MCS
12549         build and of about 15-20% for the class libs (both on GNU/Linux).
12550
12551         * report.cs (Timer): New class to get enhanced profiling.  This
12552         whole class is "TIMER" conditional since it remarkably slows down
12553         compilation speed.
12554
12555         * class.cs (MemberList): New class.  This is an IList wrapper
12556         which we're now using instead of passing MemberInfo[]'s around to
12557         avoid copying this array unnecessarily.
12558         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12559         (ICachingMemberFinder, IMemberContainer): New interface.
12560         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12561         has already been checked, otherwise use it for the name comparision.
12562         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12563         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12564         if possible.  Returns a MemberList, not a MemberInfo [].
12565         (TypeHandle): New class, implements IMemberContainer.  We create
12566         one instance of this class per type, it contains a MemberCache
12567         which is used to do the member lookups.
12568         (MemberCache): New class.  Each instance of this class contains
12569         all members of a type and a name-based hash table.
12570         (MemberCache.FindMembers): This is our new member lookup
12571         function.  First, it looks up all members of the requested name in
12572         the hash table.  Then, it walks this list and sorts out all
12573         applicable members and returns them.
12574
12575 2002-08-13  Martin Baulig  <martin@gnome.org>
12576
12577         In addition to a nice code cleanup, this gives us a performance
12578         increase of about 1.4% on GNU/Linux - not much, but it's already
12579         half a second for the self-hosting MCS compilation.
12580
12581         * typemanager.cs (IMemberFinder): New interface.  It is used by
12582         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12583         Enum, Delegate or Interface.
12584         (TypeManager.finder_to_member_finder): New PtrHashtable.
12585         (TypeManager.finder_to_container): Removed.
12586         (TypeManager.finder_to_delegate): Removed.
12587         (TypeManager.finder_to_interface): Removed.
12588         (TypeManager.finder_to_enum): Removed.
12589
12590         * interface.cs (Interface): Implement IMemberFinder.
12591
12592         * delegate.cs (Delegate): Implement IMemberFinder.
12593
12594         * enum.cs (Enum): Implement IMemberFinder.
12595
12596         * class.cs (TypeContainer): Implement IMemberFinder.
12597
12598 2002-08-12  Martin Baulig  <martin@gnome.org>
12599
12600         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12601
12602 2002-08-12  Martin Baulig  <martin@gnome.org>
12603
12604         * ecore.cs (ITypeExpression): New interface for expressions which
12605         resolve to a type.
12606         (TypeExpression): Renamed to TypeLookupExpression.
12607         (Expression.DoResolve): If we're doing a types-only lookup, the
12608         expression must implement the ITypeExpression interface and we
12609         call DoResolveType() on it.
12610         (SimpleName): Implement the new ITypeExpression interface.
12611         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12612         hack, the situation that we're only looking up types can't happen
12613         anymore when this method is called.  Moved the type lookup code to
12614         DoResolveType() and call it.
12615         (SimpleName.DoResolveType): This ITypeExpression interface method
12616         is now doing the types-only lookup.
12617         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12618         (ResolveFlags): Added MaskExprClass.
12619
12620         * expression.cs (MemberAccess): Implement the ITypeExpression
12621         interface.
12622         (MemberAccess.DoResolve): Added support for a types-only lookup
12623         when we're called via ITypeExpression.DoResolveType().
12624         (ComposedCast): Implement the ITypeExpression interface.
12625
12626         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12627         Expression.Resolve() with ResolveFlags.Type instead.
12628
12629 2002-08-12  Martin Baulig  <martin@gnome.org>
12630
12631         * interface.cs (Interface.Define): Apply attributes.
12632
12633         * attribute.cs (Attribute.ApplyAttributes): Added support for
12634         interface attributes.
12635
12636 2002-08-11  Martin Baulig  <martin@gnome.org>
12637
12638         * statement.cs (Block.Emit): Only check the "this" variable if we
12639         do not always throw an exception.
12640
12641         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12642         whether the property has a set accessor.
12643
12644 2002-08-11  Martin Baulig  <martin@gnome.org>
12645
12646         Added control flow analysis support for structs.
12647
12648         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12649         with control flow analysis turned off.
12650         (IVariable): New interface.
12651         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12652         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12653         (FieldExpr.DoResolve): Resolve the instance expression with flow
12654         analysis turned off and do the definite assignment check after the
12655         resolving when we know what the expression will resolve to.
12656
12657         * expression.cs (LocalVariableReference, ParameterReference):
12658         Implement the new IVariable interface, only call the flow analysis
12659         code if ec.DoFlowAnalysis is true.
12660         (This): Added constructor which takes a Block argument.  Implement
12661         the new IVariable interface.
12662         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12663         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12664         This does the definite assignment checks for struct members.
12665
12666         * class.cs (Constructor.Emit): If this is a non-static `struct'
12667         constructor which doesn't have any initializer, call
12668         Block.AddThisVariable() to tell the flow analysis code that all
12669         struct elements must be initialized before control returns from
12670         the constructor.
12671
12672         * statement.cs (MyStructInfo): New public class.
12673         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12674         argument to this indexer.  If non-zero, check an individual struct
12675         member, not the whole struct.
12676         (FlowBranching.CheckOutParameters): Check struct members.
12677         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12678         overloaded versions of these methods which take an additional
12679         `int field_idx' argument to check struct members.
12680         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12681         overloaded versions of these methods which take an additional
12682         `string field_name' argument to check struct member.s
12683         (VariableInfo): Implement the IVariable interface.
12684         (VariableInfo.StructInfo): New public property.  Returns the
12685         MyStructInfo instance of the variable if it's a struct or null.
12686         (Block.AddThisVariable): New public method.  This is called from
12687         Constructor.Emit() for non-static `struct' constructor which do
12688         not have any initializer.  It creates a special variable for the
12689         "this" instance variable which will be checked by the flow
12690         analysis code to ensure that all of the struct's fields are
12691         initialized before control returns from the constructor.
12692         (UsageVector): Added support for struct members.  If a
12693         variable/parameter is a struct with N members, we reserve a slot
12694         in the usage vector for each member.  A struct is considered fully
12695         initialized if either the struct itself (slot 0) or all its
12696         members are initialized.
12697
12698 2002-08-08  Martin Baulig  <martin@gnome.org>
12699
12700         * driver.cs (Driver.MainDriver): Only report an error CS5001
12701         if there were no compilation errors.
12702
12703         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12704         `UnsafeContext' property to determine whether the parent is in
12705         unsafe context rather than checking the parent's ModFlags:
12706         classes nested in an unsafe class are unsafe as well.
12707
12708 2002-08-08  Martin Baulig  <martin@gnome.org>
12709
12710         * statement.cs (UsageVector.MergeChildren): Distinguish between
12711         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12712         we return.  Added test17() and test18() to test-154.cs.
12713
12714 2002-08-08  Martin Baulig  <martin@gnome.org>
12715
12716         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12717         Family access, make sure the invoking type isn't a subclass of the
12718         queried type (that'd be a CS1540).
12719
12720         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12721         this method which takes an additional `Type invocation_type'.
12722
12723         * expression.cs (BaseAccess.DoResolve): Use the base type as
12724         invocation and query type.
12725         (MemberAccess.DoResolve): If the lookup failed and we're about to
12726         report a CS0122, try a lookup with the ec.ContainerType - if this
12727         succeeds, we must report a CS1540.
12728
12729 2002-08-08  Martin Baulig  <martin@gnome.org>
12730
12731         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12732         (MethodGroupExpr): Implement the IMemberExpr interface.
12733
12734         * expression (MemberAccess.ResolveMemberAccess): No need to have
12735         any special code for MethodGroupExprs anymore, they're now
12736         IMemberExprs.   
12737
12738 2002-08-08  Martin Baulig  <martin@gnome.org>
12739
12740         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12741         Family, FamANDAssem and FamORAssem permissions.
12742         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12743
12744 2002-08-08  Martin Baulig  <martin@gnome.org>
12745
12746         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12747         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12748         or loop block.
12749
12750 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12751
12752         * driver.cs: implemented /resource option to embed managed resources.
12753
12754 2002-08-07  Martin Baulig  <martin@gnome.org>
12755
12756         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12757         (FieldBase.HasFieldInitializer): New public property.
12758         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12759         returns the field initializer and makes sure it is only resolved once.
12760         (TypeContainer.EmitFieldInitializers): Call
12761         FieldBase.GetInitializerExpression to get the initializer, this ensures
12762         that it isn't resolved multiple times.
12763
12764         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12765         the resolving process (SimpleName/MemberLookup) that we're currently
12766         emitting a field initializer (which must not access any instance members,
12767         this is an error CS0236).
12768
12769         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12770         argument, if the `IsFieldInitializer' flag is set, we must report and
12771         error CS0236 and not an error CS0120.   
12772
12773 2002-08-07  Martin Baulig  <martin@gnome.org>
12774
12775         * ecore.cs (IMemberExpr): New public interface.
12776         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12777         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12778         if the expression is an IMemberExpr.
12779
12780         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12781         to be null, implicitly default to `this' if we're non-static in
12782         this case.  Simplified the code a lot by using the new IMemberExpr
12783         interface.  Also fixed bug #28176 here.
12784
12785 2002-08-06  Martin Baulig  <martin@gnome.org>
12786
12787         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12788         ParameterReferences during semantic analysis so that we can do a
12789         type-only search when resolving Cast, TypeOf and SizeOf.
12790         (block): Pass the `current_local_parameters' to the Block's
12791         constructor.
12792
12793         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12794         argument to the constructor.
12795         (ConstructorInitializer.Resolve): Create a temporary implicit
12796         block with the parameters.
12797
12798         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12799         references here if we aren't doing a type-only search.
12800
12801         * statement.cs (Block): Added constructor which takes a
12802         `Parameters parameters' argument.
12803         (Block.Parameters): New public property.
12804
12805         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12806         to `Parameters' and made it public readonly.
12807
12808 2002-08-06  Martin Baulig  <martin@gnome.org>
12809
12810         * ecore.cs (Expression.Warning): Made this public as well.
12811
12812         * report.cs (Report.Debug): Print the contents of collections.
12813
12814 2002-08-06  Martin Baulig  <martin@gnome.org>
12815
12816         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12817         used to tell Resolve() which kinds of expressions it may return.
12818         (Expression.Resolve): Added overloaded version of this method which
12819         takes a `ResolveFlags flags' argument.  This can be used to tell
12820         Resolve() which kinds of expressions it may return.  Reports a
12821         CS0118 on error.
12822         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12823         ResolveFlags.SimpleName.
12824         (Expression.Error118): Added overloaded version of this method which
12825         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12826         which kinds of expressions are allowed.
12827
12828         * expression.cs (Argument.ResolveMethodGroup): New public method.
12829         Resolves an argument, but allows a MethodGroup to be returned.
12830         This is used when invoking a delegate.
12831
12832         * TODO: Updated a bit.
12833
12834 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12835
12836         Fixed compilation with csc.
12837
12838         * ecore.cs: Expression.Error made public. Is this correct? Should
12839         Warning be made public too?
12840
12841         * expression.cs: use ea.Location instead of ea.loc.
12842         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12843
12844 2002-08-06  Martin Baulig  <martin@gnome.org>
12845
12846         * ecore.cs (Expression.loc): Moved the location here instead of
12847         duplicating it in all derived classes.
12848         (Expression.Location): New public property.
12849         (Expression.Error, Expression.Warning): Made them non-static and
12850         removed the location argument.
12851         (Expression.Warning): Added overloaded version which takes an
12852         `int level' argument.
12853         (Expression.Error118): Make this non-static and removed the
12854         expression and location arguments.
12855         (TypeExpr): Added location argument to the constructor.
12856
12857         * expression.cs (StaticCallExpr): Added location argument to
12858         the constructor.
12859         (Indirection, PointerArithmetic): Likewise.
12860         (CheckedExpr, UnCheckedExpr): Likewise.
12861         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12862         (StringPtr): Likewise.
12863
12864
12865 2002-08-05  Martin Baulig  <martin@gnome.org>
12866
12867         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12868
12869         * assign.cs (Assign.DoResolve): Check whether the source
12870         expression is a value or variable.
12871
12872         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12873         while resolving the corresponding blocks.
12874
12875         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12876         an error, don't silently return null.
12877
12878         * statement.cs (Block.AddVariable): Do the error reporting here
12879         and distinguish between CS0128 and CS0136.
12880         (Block.DoResolve): Report all unused labels (warning CS0164).
12881         (LabeledStatement): Pass the location to the constructor.
12882         (LabeledStatement.HasBeenReferenced): New property.
12883         (LabeledStatement.Resolve): Set it to true here.
12884
12885         * statement.cs (Return.Emit): Return success even after reporting
12886         a type mismatch error (CS0126 or CS0127), this is what csc does and
12887         it avoids confusing the users with any consecutive errors.
12888
12889 2002-08-05  Martin Baulig  <martin@gnome.org>
12890
12891         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12892
12893         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12894
12895         * expression.cs (MemberAccess.DoResolve): Silently return if an
12896         error has already been reported.
12897
12898         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12899         error has already been reported.
12900
12901 2002-08-05  Martin Baulig  <martin@gnome.org>
12902
12903         * statement.cs (UsageVector): Only initialize the `parameters'
12904         vector if we actually have any "out" parameters.
12905
12906 2002-08-05  Martin Baulig  <martin@gnome.org>
12907
12908         * expression.cs (Binary.ResolveOperator): When combining delegates,
12909         they must have the same type.
12910
12911 2002-08-05  Martin Baulig  <martin@gnome.org>
12912
12913         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12914         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12915         work with the ms runtime and we also don't need it: if we're a
12916         PropertyBuilder and not in the `indexer_arguments' hash, then we
12917         are a property and not an indexer.
12918
12919         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12920         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12921         since the latter one doesn't work with the ms runtime.
12922
12923 2002-08-03  Martin Baulig  <martin@gnome.org>
12924
12925         Fixed bugs #27998 and #22735.
12926
12927         * class.cs (Method.IsOperator): New public field.
12928         (Method.CheckBase): Report CS0111 if there's already a method
12929         with the same parameters in the current class.  Report CS0508 when
12930         attempting to change the return type of an inherited method.
12931         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12932         and it's not marked abstract or extern.
12933         (PropertyBase): New abstract base class for Property and Indexer.
12934         (PropertyBase.CheckBase): Moved here from Property and made it work
12935         for indexers.
12936         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12937         the same so we can reuse it there.
12938         (Property, Indexer): Derive from PropertyBase.
12939         (MethodSignature.inheritable_property_signature_filter): New delegate
12940         to find properties and indexers.
12941
12942         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12943         argument and improved error reporting.
12944
12945         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12946         EmptyReadOnlyParameters and made it a property.
12947
12948         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12949         version of this method which takes a `PropertyInfo indexer'.
12950         (TypeManager.RegisterIndexer): New method.
12951
12952         * class.cs: Added myself as author of this file :-)
12953
12954 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12955
12956         * class.cs: fixed compilation on windoze.
12957
12958 2002-08-03  Martin Baulig  <martin@gnome.org>
12959
12960         * interface.cs (Interface.GetInterfaceBases): Check whether all
12961         base interfaces are at least as accessible than the current one.
12962
12963         * class.cs (TypeContainer.GetClassBases): Check whether base types
12964         are at least as accessible than the current type.
12965         (TypeContainer.AsAccessible): Implemented and made non-static.
12966         (MemberBase.CheckParameters): Report errors if the accessibility
12967         checks fail.
12968
12969         * delegate.cs (Delegate.Delegate): The default visibility is
12970         internal for top-level types and private for nested types.
12971         (Delegate.Define): Report errors if the accessibility checks fail.
12972
12973         * enum.cs (Enum.Enum): The default visibility is internal for
12974         top-level types and private for nested types.
12975         (Enum.DefineType): Compute the correct visibility.
12976
12977         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12978         function which takes a `bool is_toplevel' instead of a TypeContainer.
12979
12980         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12981         builtin type.
12982
12983 2002-08-02  Martin Baulig  <martin@gnome.org>
12984
12985         * expression.cs (LocalVariableReferenc): Added constructor which
12986         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12987         (LocalVariableReference.IsReadOnly): New property.
12988         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12989         variable is readonly, use our own readonly flag to do this; you can
12990         use the new constructor to get a writable reference to a read-only
12991         variable.
12992
12993         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12994         reference to the local variable.
12995
12996 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12997
12998         * rootcontext.cs (ResolveCore): Also include System.Exception
12999
13000         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13001         we reach an EmptyStatement.
13002
13003         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13004         is also fine.
13005
13006         * expression.cs (Binary.ResolveOperator): Check error result in
13007         two places.
13008
13009         use brtrue/brfalse directly and avoid compares to null.
13010
13011 2002-08-02  Martin Baulig  <martin@gnome.org>
13012
13013         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13014         Fixes bug #28407, added test-155.cs.
13015
13016 2002-08-01  Martin Baulig  <martin@gnome.org>
13017
13018         * class.cs (Event.EmitDefaultMethod): Make this work with static
13019         events.  Fixes #28311, added verify-3.cs.
13020
13021 2002-08-01  Martin Baulig  <martin@gnome.org>
13022
13023         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13024         `is_disposable' fields.
13025         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13026         `hm.is_disposable' if we're using the collection pattern.
13027         (Foreach.EmitCollectionForeach): Use the correct type for the
13028         enumerator's local variable, only emit the try/finally block if
13029         necessary (fixes #27713).
13030
13031 2002-08-01  Martin Baulig  <martin@gnome.org>
13032
13033         * ecore.cs (Expression.report118): Renamed to Error118 and made
13034         it public static.
13035
13036         * statement.cs (Throw.Resolve): Check whether the expression is of
13037         the correct type (CS0118) and whether the type derives from
13038         System.Exception (CS0155).
13039         (Catch.Resolve): New method.  Do the type lookup here and check
13040         whether it derives from System.Exception (CS0155).
13041         (Catch.CatchType, Catch.IsGeneral): New public properties.
13042
13043         * typemanager.cs (TypeManager.exception_type): Added.
13044
13045 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13046
13047         * driver.cs: Updated About function.
13048
13049 2002-07-31  Martin Baulig  <martin@gnome.org>
13050
13051         Implemented Control Flow Analysis.
13052
13053         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13054         (EmitContext.CurrentBranching): Added.
13055         (EmitContext.StartFlowBranching): Added.
13056         (EmitContext.EndFlowBranching): Added.
13057         (EmitContext.KillFlowBranching): Added.
13058         (EmitContext.IsVariableAssigned): Added.
13059         (EmitContext.SetVariableAssigned): Added.
13060         (EmitContext.IsParameterAssigned): Added.
13061         (EmitContext.SetParameterAssigned): Added.
13062         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13063         Added control flow analysis stuff here.
13064
13065         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13066         resolve the expression as lvalue.
13067         (LocalVariableReference.DoResolve): Check whether the variable has
13068         already been assigned.
13069         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13070         the parameter as assigned here.
13071         (ParameterReference.DoResolve): Check whether the parameter has already
13072         been assigned.
13073         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13074         expression as lvalue.
13075
13076         * statement.cs (FlowBranching): New class for the flow analysis code.
13077         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13078         (LabeledStatement.IsDefined): New public property.
13079         (LabeledStatement.AddUsageVector): New public method to tell flow
13080         analyis that the label may be reached via a forward jump.
13081         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13082         flow analysis.
13083         (VariableInfo.Number): New public field.  This is used by flow analysis
13084         to number all locals of a block.
13085         (Block.CountVariables): New public property.  This is the number of
13086         local variables in this block (including the locals from all parent
13087         blocks).
13088         (Block.EmitMeta): Number all the variables.
13089
13090         * statement.cs: Added flow analysis support to all classes.
13091
13092 2002-07-31  Martin Baulig  <martin@gnome.org>
13093
13094         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13095         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13096         then use this argument.
13097
13098         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13099
13100         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13101         use this to specify /define options.
13102
13103 2002-07-29  Martin Baulig  <martin@gnome.org>
13104
13105         * statement.cs (Fixed): Moved all code that does variable lookups
13106         and resolvings from Emit to Resolve.
13107
13108         * statement.cs (For): Moved all code that does variable lookups
13109         and resolvings from Emit to Resolve.
13110
13111         * statement.cs (Using): Moved all code that does variable lookups
13112         and resolvings from Emit to Resolve.
13113
13114 2002-07-29  Martin Baulig  <martin@gnome.org>
13115
13116         * attribute.cs (Attribute.Resolve): Explicitly catch a
13117         System.NullReferenceException when creating the
13118         CustromAttributeBuilder and report a different warning message.
13119
13120 2002-07-29  Martin Baulig  <martin@gnome.org>
13121
13122         * support.cs (ParameterData.ParameterName): Added method to
13123         get the name of a parameter.
13124
13125         * typemanager.cs (TypeManager.IsValueType): New public method.
13126
13127 2002-07-29  Martin Baulig  <martin@gnome.org>
13128
13129         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13130         is a flag which specifies that it's either ref or out.
13131         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13132         the out parameter to `out Parameter.Modifier mod', also set the
13133         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13134
13135         * support.cs (InternalParameters.ParameterModifier): Distinguish
13136         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13137         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13138
13139         * expression.cs (Argument.GetParameterModifier): Distinguish
13140         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13141         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13142
13143 2002-07-29  Martin Baulig  <martin@gnome.org>
13144
13145         * expression.cs (ParameterReference.ParameterReference): Added
13146         `Location loc' argument to the constructor.
13147
13148         * cs-parser.jay: Pass location to ParameterReference.
13149
13150 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13151
13152         * statement.cs (Try): Initialize the location.
13153
13154         * cs-parser.jay: pass location to Try.
13155
13156         * expression.cs (Unary.Reduce): Change the prototype to return
13157         whether a constant fold could be performed or not.  The result is
13158         returned in an out parameters.  In the case of Indirection and
13159         AddressOf, we want to perform the full tests.
13160
13161 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13162
13163         * statement.cs (Statement.Emit): Flag dead code.
13164
13165 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13166
13167         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13168
13169 2002-07-27  Martin Baulig  <martin@gnome.org>
13170
13171         * class.cs (MethodData.Define): Put back call to
13172         TypeManager.AddMethod(), accidentally commented this out.
13173
13174         * report.cs (Debug): New public method to print debugging information,
13175         this is `[Conditional ("DEBUG")]'.
13176
13177 2002-07-26  Martin Baulig  <martin@gnome.org>
13178
13179         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13180         (switch_statement): Push the current_block to the switch_stack and
13181         pop it again when we're done with the switch.
13182         (switch_section): The new block is a child of the current_block.
13183         Fixes bug #24007, added test-152.cs.
13184
13185 2002-07-27  Martin Baulig  <martin@gnome.org>
13186
13187         * expression.cs (Invocation.EmitArguments): When calling a varargs
13188         function with only its fixed arguments, we need to pass an empty
13189         array.
13190
13191 2002-07-27  Martin Baulig  <martin@gnome.org>
13192
13193         Mono 0.13 has been released.
13194
13195 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13196
13197         * driver.cs: Rename --resource to --linkres, because that is what
13198         we do currently, we dont support --resource yet.
13199
13200         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13201
13202 2002-07-25  Martin Baulig  <martin@gnome.org>
13203
13204         * class.cs (MethodData): New public class.  This is a `method builder'
13205         class for a method or one accessor of a Property/Indexer/Event.
13206         (MethodData.GetMethodFlags): Moved here from MemberBase.
13207         (MethodData.ApplyAttributes): Likewise.
13208         (MethodData.ApplyObsoleteAttribute): Likewise.
13209         (MethodData.ApplyConditionalAttribute): Likewise.
13210         (MethodData.ApplyDllImportAttribute): Likewise.
13211         (MethodData.CheckAbstractAndExternal): Likewise.
13212         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13213         (MethodData.Emit): Formerly known as Method.Emit().
13214         (MemberBase): Moved everything which was specific to a single
13215         accessor/method to MethodData.
13216         (Method): Create a new MethodData and call Define() and Emit() on it.
13217         (Property, Indexer, Event): Create a new MethodData objects for each
13218         accessor and call Define() and Emit() on them.
13219
13220 2002-07-25  Martin Baulig  <martin@gnome.org>
13221
13222         Made MethodCore derive from MemberBase to reuse the code from there.
13223         MemberBase now also checks for attributes.
13224
13225         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13226         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13227         as virtual.
13228         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13229         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13230         (MemberBase.ApplyAttributes): New virtual method; applies the
13231         attributes to a method or accessor.
13232         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13233         (MemberBase.ApplyConditionalAttribute): Likewise.
13234         (MemberBase.ApplyDllImportAttribute): Likewise.
13235         (MemberBase.CheckAbstractAndExternal): Likewise.
13236         (MethodCore.ParameterTypes): This is now a property instead of a
13237         method, it's initialized from DoDefineParameters().
13238         (MethodCore.ParameterInfo): Removed the set accessor.
13239         (MethodCore.DoDefineParameters): New protected virtual method to
13240         initialize ParameterTypes and ParameterInfo.
13241         (Method.GetReturnType): We can now simply return the MemberType.
13242         (Method.GetMethodFlags): Override the MemberBase version and add
13243         the conditional flags.
13244         (Method.CheckBase): Moved some code from Define() here, call
13245         DoDefineParameters() here.
13246         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13247         here to avoid some larger code duplication.
13248         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13249         ensure that abstract and external accessors don't declare a body.
13250
13251         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13252         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13253         lookup in the attribute's parent classes, so we need to abort as soon
13254         as we found the first match.
13255         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13256         the attribute has no arguments.
13257
13258         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13259         of a Method.
13260
13261 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13262
13263         * cs-parser.jay: reverted previous patch.
13264
13265 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13266
13267         * cs-parser.jay: fixed bug #22119.
13268
13269 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13270
13271         * attribute.cs: fixed compilation. The error was:
13272         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13273         be assigned to before control leaves the current method."
13274         [FIXME:  Filed as bug #28186: MCS must report this error.]
13275
13276 2002-07-25  Martin Baulig  <martin@gnome.org>
13277
13278         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13279         method to pull the condition name ouf of a Conditional attribute.
13280         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13281         the obsolete message and error flag out of an Obsolete attribute.
13282
13283         * class.cs (Method.GetMethodFlags): New public method to get the
13284         TypeManager.MethodFlags for this method.
13285         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13286         private methods.
13287         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13288         if we're overriding a virtual function, set the new private variable
13289         `parent_method'; call the new TypeManager.AddMethod().
13290
13291         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13292         the MethodBuilder and the Method in a PtrHashtable.
13293         (TypeManager.builder_to_method): Added for this purpose.
13294         (TypeManager.MethodFlags): Added IsObsoleteError.
13295         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13296         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13297         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13298         the message from the attribute.
13299
13300 2002-07-24  Martin Baulig  <martin@gnome.org>
13301
13302         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13303         preprocessor directives, ensure that the argument to #define/#undef is
13304         exactly one identifier and that it's actually an identifier.
13305
13306         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13307         did not work ....
13308
13309 2002-07-24  Martin Baulig  <martin@gnome.org>
13310
13311         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13312         initialize it to TypeManager.object_type in the constructor.
13313         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13314         of the `hm.get_current' method if we're using the collection pattern.
13315         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13316         for the explicit conversion to make it work when we're using the collection
13317         pattern and the `Current' property has a different return type than `object'.
13318         Fixes #27713.
13319
13320 2002-07-24  Martin Baulig  <martin@gnome.org>
13321
13322         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13323         does not match, but don't report any errors.  This method is called in
13324         order for all methods in a MethodGroupExpr until a matching method is
13325         found, so we don't want to bail out if the first method doesn't match.
13326         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13327         matches, report the 123.  Fixes #28070.
13328
13329 2002-07-24  Martin Baulig  <martin@gnome.org>
13330
13331         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13332         TypeManager.TypeToCoreType() to the top of the method so the
13333         following equality checks will work.  Fixes #28107.
13334
13335 2002-07-24  Martin Baulig  <martin@gnome.org>
13336
13337         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13338         operand is of type uint, and the other operand is of type sbyte,
13339         short or int, the operands are converted to type long." -
13340         Actually do what this comment already told us.  Fixes bug #28106,
13341         added test-150.cs.
13342
13343 2002-07-24  Martin Baulig  <martin@gnome.org>
13344
13345         * class.cs (MethodBase): New abstract class.  This is now a base
13346         class for Property, Indexer and Event to avoid some code duplication
13347         in their Define() and DefineMethods() methods.
13348         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13349         generic methods for Define() and DefineMethods().
13350         (FieldBase): Derive from MemberBase, not MemberCore.
13351         (Property): Derive from MemberBase, not MemberCore.
13352         (Property.DefineMethod): Moved all the code from this method to the
13353         new MethodBase.DefineAccessor(), just call it with appropriate
13354         argumetnts.
13355         (Property.Define): Call the new Property.DoDefine(), this does some
13356         sanity checks and we don't need to duplicate the code everywhere.
13357         (Event): Derive from MemberBase, not MemberCore.
13358         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13359         accessors, this will also make them work with interface events.
13360         (Indexer): Derive from MemberBase, not MemberCore.
13361         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13362         (Indexer.Define): Use the new MethodBase functions.
13363
13364         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13365         argument to the constructor.
13366         (Interface.FindMembers): Added support for interface events.
13367         (Interface.PopluateEvent): Implemented.
13368
13369         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13370
13371 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13372
13373         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13374         but this is required to check for a method name being the same as
13375         the containing class.  
13376
13377         Handle this now.
13378
13379 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13380
13381         * interface.cs: initialize variable.
13382
13383 2002-07-23  Martin Baulig  <martin@gnome.org>
13384
13385         Implemented the IndexerName attribute in interfaces.
13386
13387         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13388         name if this is an explicit interface implementation.
13389         (Indexer.InterfaceIndexerName): New public variable.  If we're
13390         implementing an interface indexer, this is the IndexerName in that
13391         interface.  Otherwise, it's the IndexerName.
13392         (Indexer.DefineMethod): If we're implementing interface indexer,
13393         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13394         and Pending.ImplementIndexer methods.
13395         (Indexer.Define): Also define the PropertyBuilder if we're
13396         implementing an interface indexer and this is neither an explicit
13397         interface implementation nor do the IndexerName match the one in
13398         the interface.
13399
13400         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13401         If a method is defined here, then we always need to create a proxy
13402         for it.  This is used when implementing interface indexers.
13403         (Pending.IsInterfaceIndexer): New public method.
13404         (Pending.ImplementIndexer): New public method.
13405         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13406         This is used when implementing interface indexers to define a proxy
13407         if necessary.
13408         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13409         define a proxy if necessary.
13410
13411         * interface.cs (Interface.IndexerName): New public variable.
13412         (Interface.PopulateIndexer): Set the IndexerName.
13413         (Interface.DefineIndexers): New private method.  Populate all the
13414         indexers and make sure their IndexerNames match.
13415
13416         * typemanager.cs (IndexerPropertyName): Added support for interface
13417         indexers.
13418
13419 2002-07-22  Martin Baulig  <martin@gnome.org>
13420
13421         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13422         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13423         ret if HasReturnLabel.
13424         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13425         variables.
13426
13427         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13428         and set the ec.LoopBeginTryCatchLevel.
13429         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13430         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13431         the current ec.TryCatchLevel, the branch goes out of an exception
13432         block.  In this case, we need to use Leave and not Br.
13433
13434 2002-07-22  Martin Baulig  <martin@gnome.org>
13435
13436         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13437         block unless the block does not always return or it is contained in
13438         another try { ... } catch { ... } block.  Fixes bug #26506.
13439         Added verify-1.cs to the test suite.
13440
13441 2002-07-22  Martin Baulig  <martin@gnome.org>
13442
13443         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13444         then we do not always return.  Fixes bug #24985.
13445
13446 2002-07-22  Martin Baulig  <martin@gnome.org>
13447
13448         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13449         lookup on a per-class level; ie. walk up the class hierarchy until we
13450         found at least one applicable method, then choose the best among them.
13451         Fixes bug #24463 and test-29.cs.
13452
13453 2002-07-22  Martin Baulig  <martin@gnome.org>
13454
13455         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13456         return types of the methods.  The return type is not part of the
13457         signature and we must not check it to make the `new' modifier work.
13458         Fixes bug #27999, also added test-147.cs.
13459         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13460
13461         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13462         on the method's return type.
13463
13464 2002-07-21  Martin Baulig  <martin@gnome.org>
13465
13466         * assign.cs: Make this work if the rightmost source is a constant and
13467         we need to do an implicit type conversion.  Also adding a few more tests
13468         to test-38.cs which should have caught this.
13469
13470         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13471         target in the makefile for this.  The makefile.gnu is primarily intended
13472         for end-users who don't want to debug the compiler.
13473
13474 2002-07-21  Martin Baulig  <martin@gnome.org>
13475
13476         * assign.cs: Improved the Assign class so it can now handle embedded
13477         assignments (X = Y = Z = something).  As a side-effect this'll now also
13478         consume less local variables.  test-38.cs now passes with MCS, added
13479         a few new test cases to that test.
13480
13481 2002-07-20  Martin Baulig  <martin@gnome.org>
13482
13483         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13484         instructions.  Fixes bug #27977, also added test-146.cs.
13485
13486 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13487
13488         * cs-tokenizer.cs: fixed getHex ().
13489
13490 2002-07-19  Martin Baulig  <martin@gnome.org>
13491
13492         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13493         not Type.GetType() to lookup the array type.  This is needed when
13494         we're constructing an array of a user-defined type.
13495         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13496         single-dimensional arrays, but also for single-dimensial arrays of
13497         type decimal.
13498
13499 2002-07-19  Martin Baulig  <martin@gnome.org>
13500
13501         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13502         this function is called, it's not allowed to share LocalBuilders
13503         among ILGenerators.
13504
13505 2002-07-19  Martin Baulig  <martin@gnome.org>
13506
13507         * expression.cs (Argument.Resolve): Report an error 118 when trying
13508         to pass a type as argument.
13509
13510 2002-07-18  Martin Baulig  <martin@gnome.org>
13511
13512         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13513         Conv_R_Un for the signed `long' type.
13514
13515 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13516
13517         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13518         `expr' for the temporary result, as that will fail if we do
13519         multiple resolves on the same expression.
13520
13521 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13522
13523         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13524         ec.TypeContainer for looking up aliases. 
13525
13526         * class.cs (TypeContainer): Remove LookupAlias from here.
13527
13528         * decl.cs (DeclSpace); Move here.
13529
13530 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13531
13532         * class.cs (FindMembers): Only call filter if the constructor
13533         bulider is not null.
13534
13535         Also handle delegates in `NestedTypes' now.  Now we will perform
13536         type lookups using the standard resolution process.  This also
13537         fixes a bug.
13538
13539         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13540         This uses Expressions (the limited kind that can be parsed by the
13541         tree) instead of strings.
13542
13543         * expression.cs (ComposedCast.ToString): Implement, used to flag
13544         errors since now we have to render expressions.
13545
13546         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13547         FormArrayType. 
13548
13549         * ecore.cs (SimpleName.ToString): ditto.
13550
13551         * cs-parser.jay: Instead of using strings to assemble types, use
13552         Expressions to assemble the type (using SimpleName, ComposedCast,
13553         MemberAccess).  This should fix the type lookups in declarations,
13554         because we were using a different code path for this.
13555
13556         * statement.cs (Block.Resolve): Continue processing statements
13557         even when there is an error.
13558
13559 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13560
13561         * class.cs (Event.Define): Also remove the `remove' method from
13562         the list of pending items.
13563
13564         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13565         generate more compact code. 
13566
13567 2002-07-17  Martin Baulig  <martin@gnome.org>
13568
13569         * const.cs (Const.LookupConstantValue): Add support for constant
13570         `unchecked' and `checked' expressions.
13571         Also adding test case test-140.cs for this.
13572
13573 2002-07-17  Martin Baulig  <martin@gnome.org>
13574
13575         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13576         check whether mi.ReturnType implements the IEnumerator interface; the
13577         `==' and the IsAssignableFrom() will fail in this situation.
13578
13579 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13580
13581         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13582         here too.
13583
13584 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13585
13586         * expression.cs: fixed bug #27811.
13587
13588 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13589
13590         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13591         Molaro: when we are a ref, the value already contains a pointer
13592         value, do not take the address of it.
13593
13594 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13595         * removed mb-parser.jay and mb-tokenizer.cs
13596
13597 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13598
13599         * expression.cs: check against the building corlib void type.
13600
13601 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13602
13603         * ecore.cs: fix for valuetype static readonly fields: when 
13604         initializing them, we need their address, not the address of a copy.
13605
13606 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13607
13608         * typemanager.cs: register also enum_type in corlib.
13609
13610 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13611
13612         * class.cs: allow calling this (but not base) initializers in structs.
13613
13614 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13615
13616         * ecore.cs: make sure we compare against the building base types
13617         in GetTypeSize ().
13618
13619 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13620
13621         * typemanager.cs: fix TypeToCoreType() to handle void and object
13622         (corlib gets no more typerefs after this change).
13623
13624 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13625
13626         * expression.cs (ArrayCreation.EmitArrayArguments): use
13627         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13628
13629         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13630         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13631         array indexes, the runtime actually forbids them.
13632
13633         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13634         for array arguments here.
13635
13636         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13637         instead of the default for ValueTypes.
13638
13639         (New.DoEmit): Use IsValueType instead of
13640         IsSubclassOf (value_type)
13641         (New.DoResolve): ditto.
13642         (Invocation.EmitCall): ditto.
13643
13644         * assign.cs (Assign): ditto.
13645
13646         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13647         Statements *are* currently doing part of their resolution during
13648         Emit.  
13649
13650         Expressions do always resolve during resolve, but statements are
13651         only required to propagate resolution to their children.
13652
13653 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13654
13655         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13656
13657         (LoadAssembly): Do not add the dll if it is already specified
13658
13659         (MainDriver): Add the System directory to the link path at the end,
13660         after all the other -L arguments. 
13661
13662         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13663         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13664         ldelem.u1) and using the opposite for sbytes.
13665
13666         This fixes Digger, and we can finally run it.
13667
13668         * driver.cs (UnixParseOption): Move the option parsing here.  
13669         (CSCParseOption): Implement CSC-like parsing of options.
13670
13671         We now support both modes of operation, the old Unix way, and the
13672         new CSC-like way.  This should help those who wanted to make cross
13673         platform makefiles.
13674
13675         The only thing broken is that /r:, /reference: and /lib: are not
13676         implemented, because I want to make those have the same semantics
13677         as the CSC compiler has, and kill once and for all the confussion
13678         around this.   Will be doing this tomorrow.
13679
13680         * statement.cs (Unsafe.Resolve): The state is checked during
13681         resolve, not emit, so we have to set the flags for IsUnsfe here.
13682
13683 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13684
13685         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13686         not catch the Error_ObjectRefRequired in SimpleName (as it is
13687         possible to have a class/instance variable name that later gets
13688         deambiguated), we have to check this here.      
13689
13690 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13691
13692         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13693         make static and put into Expression.
13694
13695         (Event.Define): Register the private field of the event with the 
13696         TypeManager so that GetFieldFromEvent can get at it.
13697
13698         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13699         keep track of the private field associated with an event which
13700         has no accessors.
13701
13702         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13703         private field.
13704
13705         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13706
13707 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13708
13709         * expression.cs (Binary.EmitBranchable): this routine emits the
13710         Binary expression in a branchable context.  This basically means:
13711         we need to branch somewhere, not just get the value on the stack.
13712
13713         This works together with Statement.EmitBoolExpression.
13714
13715         * statement.cs (Statement.EmitBoolExpression): Use
13716         EmitBranchable. 
13717
13718 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13719
13720         * statement.cs (For): Reduce the number of jumps in loops.
13721
13722         (For): Implement loop inversion for the For statement.
13723
13724         (Break): We can be breaking out of a Try/Catch controlled section
13725         (foreach might have an implicit try/catch clause), so we need to
13726         use Leave instead of Br.
13727
13728         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13729         now).  If the instace expression supports IMemoryLocation, we use
13730         the AddressOf method from the IMemoryLocation to extract the
13731         address instead of emitting the instance.
13732
13733         This showed up with `This', as we were emitting the instance
13734         always (Emit) instead of the Address of This.  Particularly
13735         interesting when This is a value type, as we dont want the Emit
13736         effect (which was to load the object).
13737
13738 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13739
13740         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13741
13742         * statement.cs (Checked): Set the CheckedState during the resolve
13743         process too, as the ConvCast operations track the checked state on
13744         the resolve process, and not emit.
13745
13746         * cs-parser.jay (namespace_member_declaration): Flag that we have
13747         found a declaration when we do.  This is used to flag error 1529
13748
13749         * driver.cs: Report ok when we display the help only.
13750
13751 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13752
13753         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13754
13755 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13756
13757         * cs-tokenizer.cs (define): We also have to track locally the
13758         defines.  AllDefines is just used for the Conditional Attribute,
13759         but we also need the local defines for the current source code. 
13760
13761 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13762
13763         * statement.cs (While, For, Do): These loops can exit through a
13764         Break statement, use this information to tell whether the
13765         statement is the last piece of code.
13766
13767         (Break): Flag that we break.
13768
13769         * codegen.cs (EmitContexts): New `Breaks' state variable.
13770
13771 2002-07-03  Martin Baulig  <martin@gnome.org>
13772
13773         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13774         modifiers in method declarations in structs.  Otherwise, you won't
13775         be able to override things like Object.Equals().
13776
13777 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13778
13779         * class.cs (Method, Property, Indexer): Do not allow the public
13780         modifier to be used in explicit interface implementations.
13781
13782         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13783         override modifiers in method declarations in structs
13784
13785 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13786
13787         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13788         integer or real overflow, report an error
13789
13790 2002-07-02  Martin Baulig  <martin@gnome.org>
13791
13792         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13793         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13794         to tell the runtime about our newly created System.Object and
13795         System.ValueType types.
13796
13797 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13798
13799         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13800         struct instead of Ldarg/Starg.
13801
13802 2002-07-02  Martin Baulig  <martin@gnome.org>
13803
13804         * expression.cs (Indirection.Indirection): Call
13805         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13806
13807 2002-07-02  Martin Baulig  <martin@gnome.org>
13808
13809         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13810         ValueType, call TypeManager.TypeToCoreType() on it.
13811         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13812         the OpCodes.Newarr argument.
13813
13814 2002-07-02  Martin Baulig  <martin@gnome.org>
13815
13816         * expression.cs (Invocation.EmitCall): When compiling corlib,
13817         replace all calls to the system's System.Array type to calls to
13818         the newly created one.
13819
13820         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13821         System.Array methods.
13822         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13823         from the system's System.Array type which must be replaced.
13824
13825 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13826
13827         * typemanager.cs: load unverifiable_code_ctor so we can build
13828         corlib using the correct type. Avoid using GetTypeCode() with
13829         TypeBuilders.
13830         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13831         TypeManager.object_type to allow building corlib.
13832
13833 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13834
13835         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13836
13837 2002-07-01  Martin Baulig  <martin@gnome.org>
13838
13839         * class.cs: Make the last change actually work, we need to check
13840         whether `ifaces != null' to avoid a crash.
13841
13842 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13843
13844         * class.cs: when we build structs without fields that implement
13845         interfaces, we need to add the interfaces separately, since there is
13846         no API to both set the size and add the interfaces at type creation
13847         time.
13848
13849 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13850
13851         * expression.cs: the dimension arguments to the array constructors
13852         need to be converted if they are a long.
13853
13854 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13855
13856         * class.cs: don't emit ldarg.0 if there is no parent constructor
13857         (fixes showstopper for corlib).
13858
13859 2002-06-29  Martin Baulig  <martin@gnome.org>
13860
13861         MCS now compiles corlib on GNU/Linux :-)
13862
13863         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13864         ie. check for MethodImplOptions.InternalCall.
13865
13866         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13867         and TypeManager.attribute_type are null, so we must explicitly check
13868         whether parent is not null to find out whether it's an attribute type.
13869         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13870         and SetBuilder, not only if the property is neither abstract nor external.
13871         This is necessary to set the MethodImplOptions on the accessor methods.
13872         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13873         SetBuilder, see Property.Emit().
13874
13875         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13876         populate "System.Object", "System.ValueType" and "System.Attribute" since
13877         they've already been populated from BootCorlib_PopulateCoreTypes().
13878
13879 2002-06-29  Martin Baulig  <martin@gnome.org>
13880
13881         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13882         is the NullLiteral, we also need to make sure that target_type is not
13883         an enum type.   
13884
13885 2002-06-29  Martin Baulig  <martin@gnome.org>
13886
13887         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13888         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13889         before calling BootstrapCorlib_ResolveDelegate ().
13890
13891 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13892
13893         * statement.cs: fixed build-breaker. All tests passed ok.
13894
13895 2002-06-27  Martin Baulig  <martin@gnome.org>
13896
13897         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13898         for System.Decimal when compiling corlib.
13899
13900 2002-06-27  Martin Baulig  <martin@gnome.org>
13901
13902         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13903         switch blocks which contain nothing but a default clause.
13904
13905 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13906
13907        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13908
13909 2002-06-27  Martin Baulig  <martin@gnome.org>
13910
13911         * ecore.cs (PropertyExpr.PropertyExpr): Call
13912         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13913
13914         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13915         is already a TypeBuilder.
13916
13917 2002-06-27  Martin Baulig  <martin@gnome.org>
13918
13919         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13920         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13921         the "from an array-type to System.Array" case.  This makes it work
13922         when compiling corlib.
13923
13924 2002-06-27  Martin Baulig  <martin@gnome.org>
13925
13926         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13927         non-static PropertyExpr, set its InstanceExpression.  This makes
13928         the `ICollection.Count' property work in System/Array.cs.
13929
13930 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13931
13932         * driver.cs: Made error handling more consistent.  Errors now
13933         tracked by Report class, so many methods which used to return int
13934         now return void.  Main() now prints success/failure and 
13935         errors/warnings message.
13936
13937         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13938         the magic number return values (123 and 124).  Now, if the
13939         expected error occurs, the compiler exits with success (exit value
13940         0).  If the compilation completes without seeing that particular
13941         error, the compiler exits with failure (exit value 1).  The
13942         makefile in mcs/errors has been changed to handle the new behaviour.
13943
13944         * report.cs: Made 'expected error' number a property and renamed
13945         it from 'Probe' to 'ExpectedError'.
13946
13947         * genericparser.cs: Removed error handling support, since it is
13948         now all done by Report class.
13949
13950         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13951         class, so parse() no longer returns an int.
13952
13953         * namespace.cs: Use Report.Error instead of GenericParser.error
13954
13955 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13958         TypeContainer.AddOperator): At the front of the list put the
13959         explicit implementations, so they get resolved/defined first. 
13960
13961 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13962
13963         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13964         interface type is implemented by this TypeContainer.  Used during
13965         explicit interface implementation.
13966
13967         (Property.Define, Indexer.Define, Method.Define): Validate that
13968         the given interface in the explicit implementation is one of the
13969         base classes for the containing type.
13970
13971         Also if we are explicitly implementing an interface, but there is
13972         no match in the pending implementation table, report an error.
13973
13974         (Property.Define): Only define the property if we are
13975         not explicitly implementing a property from an interface.  Use the
13976         correct name also for those properties (the same CSC uses,
13977         although that is really not needed).
13978
13979         (Property.Emit): Do not emit attributes for explicitly implemented
13980         properties, as there is no TypeBuilder.
13981
13982         (Indexer.Emit): ditto.
13983
13984         Hiding then means that we do not really *implement* a pending
13985         implementation, which makes code fail.
13986
13987 2002-06-22  Martin Baulig  <martin@gnome.org>
13988
13989         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13990         the return value of Object.GetType().  [FIXME: we need to do this whenever
13991         we get a type back from the reflection library].
13992
13993 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13994
13995         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13996
13997 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13998
13999         * attribute.cs: Return null if we can not look up the type.
14000
14001         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14002         the interface types found.
14003
14004         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14005         interface types found.
14006
14007         * typemanager.cs (GetInterfaces): Make this routine returns alll
14008         the interfaces and work around the lame differences between
14009         System.Type and System.Reflection.Emit.TypeBuilder in the results
14010         result for GetInterfaces.
14011
14012         (ExpandInterfaces): Given an array of interface types, expand and
14013         eliminate repeated ocurrences of an interface.  This expands in
14014         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14015         be IA, IB, IC.
14016
14017 2002-06-21  Martin Baulig  <martin@gnome.org>
14018
14019         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14020         on System.Enum.
14021
14022 2002-06-21  Martin Baulig  <martin@gnome.org>
14023
14024         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14025         and called with one of the core types, return the corresponding typebuilder for
14026         that type.
14027
14028         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14029         element type.
14030
14031 2002-06-21  Martin Baulig  <martin@gnome.org>
14032
14033         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14034         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14035         (Expression.ConvertReferenceExplicit): Likewise.
14036
14037         * expression.cs (ElementAccess.DoResolve): Likewise.
14038         (ElementAccess.DoResolveLValue): Likewise.
14039
14040 2002-06-10  Martin Baulig  <martin@gnome.org>
14041
14042         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14043         add the "value" parameter to the parameter list.
14044
14045         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14046         to our caller.
14047
14048 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14049
14050         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14051         the argument to an int, uint, long or ulong, per the spec.  Also
14052         catch negative constants in array creation.
14053
14054 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14055
14056         * class.cs: do not allow the same interface to appear twice in
14057         the definition list.
14058
14059 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14060
14061         * ecore.cs: don't use ldlen with System.Array.
14062
14063 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14064
14065         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14066
14067 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14068
14069         * modifiers.cs: produce correct field attributes for protected
14070         internal. Easy fix so miguel can work on ther harder stuff:-)
14071
14072 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14073
14074         * pending.cs: New file.  Move the code from class.cs here.
14075         Support clearning the pending flag for all methods (when not doing
14076         explicit interface implementation).
14077
14078 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14079
14080         * rootcontext.cs: added a couple more types needed to bootstrap.
14081
14082 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14083
14084         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14085         constructor in the type, instead of any constructor in the type
14086         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14087         a bug in the Mono runtime when applying the params attribute). 
14088
14089 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14090         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14091
14092 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14093
14094         * expression.cs (Unary.ResolveOperator): Use TypeManager
14095         to resolve the type.
14096
14097 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14098
14099         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14100         attached.
14101
14102         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14103         with each member too.
14104
14105         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14106         field builders too - this takes care of the enum member case.
14107
14108 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14109
14110         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14111         address-of operator on both value types and pointers.
14112
14113 2002-06-10  Martin Baulig  <martin@gnome.org>
14114
14115         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14116         PropertyBuilder to the `property_builders' list.
14117
14118         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14119         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14120         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14121         find any indexers which are inherited from an interface.
14122
14123 2002-06-09  Martin Baulig  <martin@gnome.org>
14124
14125         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14126         the same type as the constant if necessary.  There's also a test-130.cs
14127         for this.
14128
14129         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14130
14131         * typemanager.cs (TypeManager.ChangeType): Previously known as
14132         Enum.ChangeEnumType().
14133
14134 2002-06-09  Martin Baulig  <martin@gnome.org>
14135
14136         * expression.cs (Cast.TryReduce): Added support for consts.
14137
14138 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14139
14140         * class.cs (Accessor): Hold attributes information so we can pass
14141         it along.
14142
14143         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14144         Modify to pass in attributes attached to the methods.
14145
14146         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14147
14148         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14149         to handle the Accessor kind :-)
14150
14151         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14152
14153 2002-06-08  Martin Baulig  <martin@gnome.org>
14154
14155         * expression.cs (Unary.TryReduceNegative): Added support for
14156         ULongConstants.
14157
14158 2002-06-08  Martin Baulig  <martin@gnome.org>
14159
14160         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14161         name can't be found in the `defined_names' - the caller will do a
14162         MemberLookup in this case and thus find methods in System.Enum
14163         such as Enum.IsDefined().
14164
14165 2002-06-08  Martin Baulig  <martin@gnome.org>
14166
14167         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14168         Convert.ChangeType() which works with TypeBuilder created types.
14169         (Enum.LookupEnumValue, Enum.Define): Use it here.
14170
14171         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14172         `TypeBuilder.BaseType != null' check.
14173         (TypeContainer.FindMembers): Only lookup parent members if we
14174         actually have a parent.
14175         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14176         (ConstructorInitializer.Resolve): Likewise.
14177
14178         * interface.cs (Interface.FindMembers): Added
14179         `TypeBuilder.BaseType != null' check.
14180
14181         * rootcontext.cs (RootContext.ResolveCore): Added
14182         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14183         classes_second_stage.
14184
14185         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14186         debug_type and trace_type when compiling with --nostdlib.       
14187
14188 2002-06-07  Martin Baulig  <martin@gnome.org>
14189
14190         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14191         (AddField): Set it to true when adding a non-static field.
14192         (DefineType): Use `have_nonstatic_fields' to find out whether we
14193         have non-static fields, not `Fields != null'.
14194
14195 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14196
14197         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14198         dereferencing a null on the static-field code path)
14199
14200 2002-05-30  Martin Baulig  <martin@gnome.org>
14201
14202         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14203         to take command line arguments.  Use reflection to call the new
14204         custom `Initialize' function on the symbol writer and pass it the
14205         command line arguments.
14206
14207         * driver.cs (--debug-args): New command line argument to pass command
14208         line arguments to the symbol writer.
14209
14210 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14211
14212         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14213         the target type for indexers and properties.  Thanks to Joe for
14214         catching this.
14215
14216 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * typemanager.cs (MethodFlags): returns the method flags
14219         (Obsolete/ShouldIgnore) that control warning emission and whether
14220         the invocation should be made, or ignored. 
14221
14222         * expression.cs (Invocation.Emit): Remove previous hack, we should
14223         not do this on matching a base type, we should do this based on an attribute
14224
14225         Only emit calls to System.Diagnostics.Debug and
14226         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14227         on the command line.
14228
14229         * rootcontext.cs: Global settings for tracing and debugging.
14230
14231         * cs-tokenizer.cs (define): New utility function to track
14232         defines.   Set the global settings for TRACE and DEBUG if found.
14233
14234 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14235
14236         * interface.cs (Populate*): Pass in the TypeContainer as well as
14237         the DeclSpace as parameters so that we can create EmitContexts and
14238         then use that to apply attributes etc.
14239
14240         (PopulateMethod, PopulateEvent, PopulateProperty)
14241         (PopulateIndexer): Apply attributes everywhere.
14242
14243         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14244         etc.
14245
14246         (ApplyAttributes): Update accordingly.
14247
14248         We now apply interface attributes for all members too.
14249
14250 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14251
14252         * class.cs (Indexer.Define); Correctly check if we are explicit
14253         implementation (instead of checking the Name for a ".", we
14254         directly look up if the InterfaceType was specified).
14255
14256         Delay the creation of the PropertyBuilder.
14257
14258         Only create the PropertyBuilder if we are not an explicit
14259         interface implementation.   This means that explicit interface
14260         implementation members do not participate in regular function
14261         lookups, and hence fixes another major ambiguity problem in
14262         overload resolution (that was the visible effect).
14263
14264         (DefineMethod): Return whether we are doing an interface
14265         implementation. 
14266
14267         * typemanager.cs: Temporary hack until we get attributes in
14268         interfaces (Ravi is working on that) and we get IndexerName
14269         support in interfaces.
14270
14271         * interface.cs: Register the indexers as properties.
14272
14273         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14274         warning, I have verified that this is a bug in the .NET runtime
14275         (JavaScript suffers of the same problem).
14276
14277         * typemanager.cs (MemberLookup): When looking up members for
14278         interfaces, the parent of an interface is the implicit
14279         System.Object (so we succeed in searches of Object methods in an
14280         interface method invocation.  Example:  IEnumerable x;  x.ToString
14281         ()) 
14282
14283 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14284
14285         * class.cs (Event): Events should also register if they do
14286         implement the methods that an interface requires.
14287
14288         * typemanager.cs (MemberLookup); use the new GetInterfaces
14289         method. 
14290
14291         (GetInterfaces): The code used to lookup interfaces for a type is
14292         used in more than one place, factor it here. 
14293
14294         * driver.cs: Track the errors at the bottom of the file, we kept
14295         on going.
14296
14297         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14298         instance if the method we are calling is static!
14299
14300 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14301
14302         * attribute.cs (ApplyAttributes): Make this function filter out
14303         the IndexerName attribute (as that attribute in reality is never
14304         applied) and return the string constant for the IndexerName
14305         attribute. 
14306
14307         * class.cs (TypeContainer.Emit): Validate that all the indexers
14308         have the same IndexerName attribute, and if so, set the
14309         DefaultName attribute on the class. 
14310
14311         * typemanager.cs: The return value might contain other stuff (not
14312         only methods).  For instance, consider a method with an "Item"
14313         property and an Item method.
14314
14315         * class.cs: If there is a problem with the parameter types,
14316         return. 
14317
14318 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14319
14320         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14321         looks at user defined conversion after making a call to 
14322         StandardConversionExists - we need this for overload resolution.
14323
14324         * expression.cs : Update accordingly the various method calls.
14325
14326         This fixes 2 bugs filed against implicit user defined conversions 
14327
14328 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14329
14330         * statement.cs: Track the result of the assignment.
14331
14332 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14333
14334         * expression.cs (MemberAccess): Improved error reporting for
14335         inaccessible members.
14336
14337 2002-05-22  Martin Baulig  <martin@gnome.org>
14338
14339         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14340         itself with debugging support.
14341
14342 2002-05-22  Martin Baulig  <martin@gnome.org>
14343
14344         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14345         Removed, this isn't needed anymore.
14346
14347 2002-05-20  Martin Baulig  <martin@gnome.org>
14348
14349         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14350         be underlying type for an enum.
14351
14352 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14355         that splits out the loading of just the core types.
14356
14357         * rootcontext.cs (ResolveCore): Split the struct resolution in
14358         two, so we can load the enumeration underlying types before any
14359         enums are used.
14360
14361         * expression.cs (Is): Bandaid until we fix properly Switch (see
14362         bug #24985 for details).
14363
14364         * typemanager.cs (ImplementsInterface): The hashtable will contain
14365         a null if there are no interfaces implemented.
14366
14367 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14368
14369         * cs-parser.jay (indexer_declarator): It is fine to have array
14370         parameters
14371
14372 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14373
14374         * typemanager.cs: (RegisterBuilder): New function used to register
14375         TypeBuilders that implement interfaces.  Since
14376         TypeBuilder.GetInterfaces (as usual) does not work with lame
14377         Reflection.Emit. 
14378         (AddUserType): register interfaces.
14379
14380         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14381         dealing with TypeBuilder.  Also, arrays are showing up as
14382         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14383         methods can not be invoked on them!
14384
14385         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14386         (ImplicitReferenceConversionExists): Split out from
14387         StandardConversionExists. 
14388
14389         * expression.cs (As): We were only implementing one of the three
14390         cases for the as operator.  We now implement them all.
14391         (Is): Implement the various other cases for Is as well.
14392
14393         * typemanager.cs (CACHE): New define used to control if we want or
14394         not the FindMembers cache.  Seems to have a negative impact on
14395         performance currently
14396
14397         (MemberLookup): Nested types have full acess to
14398         enclosing type members
14399
14400         Remove code that coped with instance/static returns for events, we
14401         now catch this in RealFindMembers.
14402
14403         (RealFindMembers): only perform static lookup if the instance
14404         lookup did not return a type or an event.  
14405
14406 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14407
14408         * assign.cs (CompoundAssign): We pass more semantic information
14409         now to Compound Assignments than we did before: now we have all
14410         the information at hand, and now we resolve the target *before* we
14411         do the expression expansion, which allows the "CacheValue" method
14412         to have the effect we intended (before, a [x] += 1 would generate
14413         two differen ArrayAccess expressions from the ElementAccess,
14414         during the resolution process).
14415
14416         (CompoundAssign.DoResolve): Resolve target and original_source here.
14417
14418 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14419
14420         * expression.cs (ArrayAccess): dropped debugging information. 
14421
14422         * typemanager.cs: Small bug fix: I was always returning i_members,
14423         instead of one of i_members or s_members (depending on which had
14424         the content).
14425
14426         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14427         method is invoked before any code generation takes place, and it
14428         is a mechanism to inform that the expression will be invoked more
14429         than once, and that the method should use temporary values to
14430         avoid having side effects
14431
14432         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14433
14434         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14435         implementation.
14436
14437         * expression.cs (Indirection, ArrayAccess): Add support for
14438         CacheTemporaries in these two bad boys. 
14439
14440         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14441         ldobj or ldind_ref.  
14442         (StoreFromPtr): Handle stobj as well.
14443
14444         * expression.cs (UnaryMutator): Share more code.
14445
14446         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14447         down: I was not tracking the Filter function as well, which
14448         was affecting the results of the cache.
14449
14450 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14451
14452         * attribute.cs: Remove the hack to handle the CharSet property on
14453         StructLayouts. 
14454
14455 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14456
14457         * attribute.cs (DoResolve): More uglyness, we now only try to
14458         resolve the attribute partially, to extract the CharSet
14459         information (only if we are a StructLayout attribute).  Otherwise 
14460
14461         (GetExtraTypeInfo): Add some code to conditionally kill in the
14462         future this.   I am more and more convinced that the .NET
14463         framework has special code to handle the attribute setting on
14464         certain elements.
14465
14466         * expression.cs (IsParamsMethodApplicable): Revert my previous
14467         foreach change here, it was wrong.
14468
14469 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14470
14471         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14472         (pp_expr): do not abort on unknown input, just return.
14473         (eval): abort if there are pending chars.
14474
14475         * attribute.cs (Attribute.Resolve): Positional parameters are
14476         optional.  Deal with that case.
14477
14478         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14479         the Ansi/Unicode/Auto information for the type.
14480
14481         (TypeContainer.DefineType): instantiate the EmitContext here, as
14482         we will be using it during the type definition (to resolve
14483         attributes) and during the emit phase.
14484
14485         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14486         to pull type information out of the attributes
14487
14488         (Attribute.Resolve): track the constructor builder, and allow for
14489         multiple invocations (structs and classes will use this).
14490
14491         * ecore.cs (MemberLookupFinal): new version with all the
14492         parameters customizable.
14493
14494         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14495         constructors.  Return if the result value is null (as the error
14496         would have been flagged already by MemberLookupFinal)
14497
14498         Do not allow instances of abstract classes or interfaces to be
14499         created.
14500
14501         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14502         We have to compare the assembly property here when dealing with
14503         FamANDAssem and Assembly access modifiers, because we might be
14504         creating an assembly from *modules* (that means that we are not
14505         getting TypeBuilders for types defined in other modules that are
14506         part of this assembly).
14507
14508         (Method.Emit): If the method is marked abstract and has a body,
14509         emit an error. 
14510
14511         (TypeContainer.DefineMembers): If both the defined member and the
14512         parent name match are methods, then do not emit any warnings: let
14513         the Method.Define routine take care of flagging warnings.  But if
14514         there is a mismatch (method overrides something else, or method is
14515         overriwritten by something, then emit warning).
14516
14517         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14518         set to null, this means `do not check for the return type on the
14519         signature'. 
14520
14521         (Method.Define): set the return type for the method signature to
14522         null, so that we get methods with the same name and parameters and
14523         different return types.  This is used to flag warning 114 (you are
14524         hiding a method, and you probably want to use the new/override
14525         keywords instead).
14526
14527         * typemanager.cs (MemberLookup): Implemented proper access
14528         control, closing a long standing set of bug reports.  The problem
14529         was that the Framework only has two bits: Public and NonPublic,
14530         and NonPublic includes private and protected methods, but we need
14531         to enforce the FamANDAssem, FamOrAssem and Family. 
14532
14533 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14534
14535         * statement.cs (GotoCase): Return true: Ammounts to giving up
14536         knowledge on whether we return or not, and letting the other case
14537         be responsible for it.
14538
14539 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14540
14541         * driver.cs: Do not load directories for each file processed, only
14542         do it if there is a pattern.
14543
14544         * ecore.cs: Report readonly assigns here as well, as we might have
14545         been resolved only by MemberAccess.
14546
14547         (SimpleName.SimpleNameResolve): Also be useful for LValue
14548         resolution.   We need this to propagate assign to local readonly variables
14549
14550         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14551         do not want to reuse potential criteria memory.
14552
14553         * class.cs (MyEventBuilder): Set reflected_type;
14554
14555         * ecore.cs (Constantify): Added support for constifying bools.
14556
14557         (RootContext.LookupType): Added a cache for values looked up in
14558         the declaration space.
14559
14560         * typemanager.cs (FindMembers): Now is a front-end to
14561         RealFindMembers, and provides a two-level hashtable-based cache to
14562         the request.  
14563
14564         15% performance improvement: from 22.5 to 19.2 seconds.
14565
14566         * expression.cs (IsParamsMethodApplicable): use foreach.
14567         (Invocation.DoResolve): ditto.
14568         (New.DoResolve): ditto.
14569         (ArrayCreation.DoResolve): ditto.
14570
14571         * ecore.cs (FindMostEncompassingType): use foreach.
14572
14573         * delegate.cs (NewDelegate.DoResolve): Use foreach
14574
14575         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14576         (RemoveMethods): use foreach.
14577
14578         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14579         nested foreach statements instead of for, and also break out of
14580         the inner loop once a match is found.
14581
14582         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14583
14584 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14585
14586         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14587         we actually unwrap the expression to allow for extra information
14588         to be extracted. 
14589
14590         * expression.cs: Use Shr_Un on unsigned operations. 
14591
14592 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14593
14594         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14595         applicable operators was not being considered correctly. This closes
14596         the bug Miguel reported.
14597
14598 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14599
14600         * attribute.cs: check that the type derives from System.Attribute
14601         and report the correct error in that case (moved the duplicate code to
14602         its own method, too).
14603
14604 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14605
14606         * attribute.cs: lookup attribute type name as the spec says: first the
14607         bare attribute name and then name + "Attribute" (nant compiles with
14608         mcs after this fix).
14609
14610 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14611
14612         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14613         Because of the way we parse things, we should try to see if a
14614         UIntConstant can fit in an integer.
14615
14616 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14617
14618         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14619         when we are in an explicit context.
14620
14621         (ConvertReferenceExplicit): When converting from Iface type S to Class
14622         T make sure the rules are implemented as an OR.
14623
14624         * parameter.cs (ParameterType): Make it a property for now although the
14625         purpose really isn't anything immediate.
14626
14627         * expression.cs (Is*Applicable): Do better checking on the parameter type
14628         of a ref/out parameter. The ones from the system assemblies are already 
14629         marked with the correct type so we don't need to do any correction.
14630
14631         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14632         the object type is standard too so include that.
14633
14634 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14635
14636         * ecore.cs (StandardConversionExists): Augment with missing code:
14637         deal with IntConstant, LongConstants and Enumerations.
14638
14639         * assign.cs: Report the error, instead of failing silently
14640
14641         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14642         typecontainer that they are declared, because the
14643         typecontainer/namespace will have the list of using clauses that
14644         need to be applied.
14645
14646         Assembly Attributes were escaping the normal registration
14647         mechanism. 
14648
14649         (EmitCode): Apply attributes within an EmitContext that represents
14650         the container they were declared on.
14651
14652         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14653
14654 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14655
14656         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14657         Revamp completely - make much cleaner as we now operate only
14658         on a set of Types.
14659
14660         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14661         to implement the logic detailed in the spec more correctly.
14662
14663         (UserDefinedConversion): Update accordingly.
14664
14665 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14666
14667         * statement.cs: Return flow analysis information up.
14668
14669         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14670         and the default.
14671
14672         (token): Do not consume an extra character before calling
14673         decimal_digits.
14674
14675 2002-05-06  Piers Haken <piersh@friskit.com>
14676
14677         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14678
14679 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14680
14681         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14682         EmitContext during the instance constructor initializer
14683         resolution, to stop access to instance variables.
14684
14685         This is mandated by the spec, last paragraph of the `constructor
14686         initializers' section. 
14687
14688 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14689
14690         * cs-parser.jay, class.cs (Accessor): new class used to represent
14691         an accessor (get or set).  In the past we used `null' to represent
14692         a missing accessor.  But this is ambiguous because there was no
14693         way to tell in abstract indexers/properties if one of them was
14694         specified.
14695
14696         Now there is a way of addressing that.
14697
14698         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14699         instead of FindMembers.
14700
14701         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14702         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14703
14704         * attribute.cs: Treat indexers and properties as the same in terms
14705         of applying attributes
14706
14707         * ecore.cs (FindMostEncompassedType): Use statically initialized
14708         EmptyExpressions()s like we do elsewhere to avoid creating useless
14709         objects (and we take this out of the tight loop).
14710
14711         (GetConversionOperators): Move the code to extract the actual
14712         operators to a separate routine to clean things up.
14713
14714 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14717         events are always registered FieldBuilders.
14718
14719         * class.cs (FieldBase): New class shared by Fields 
14720
14721         * delegate.cs: If we are a toplevel delegate, use our full name.
14722         If we are a nested delegate, then only use our tail name.
14723
14724 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14725
14726         * expression.cs (IsApplicable): Ensure that we add the "&" to
14727         ref/out types before comparing it with the type of the argument.
14728
14729         (IsParamsMethodApplicable): Ditto.
14730
14731         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14732         silly me ;-)
14733
14734         * delegate.cs : Handle the case when we have more than one applicable
14735         method. Flag an error only when we finish checking all.
14736
14737 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14738
14739         * expression.cs: Add support for boolean static initializers.
14740
14741 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14742
14743         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14744
14745         * parameter.cs (ComputeParameterTypes,
14746         ComputeAndDefineParameterTypes): Better error handling: now we
14747         clear the `types' cache if we fail during any of the type lookups.
14748         We also return the status code correctly to our caller
14749
14750         * delegate.cs: If we fail to define a delegate, abort the extra
14751         steps. 
14752
14753         * expression.cs (Binary.ResolveOperator): for
14754         operator==(object,object) and operator !=(object, object) we also
14755         have to verify that there is an implicit conversion from one to
14756         the other.
14757
14758         (ArrayAccess.DoResolve): Array Access can operate on
14759         non-variables. 
14760
14761 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14762
14763         * assign.cs (CompoundAssign): A new class used as a "flag" that
14764         the assignment actually is happening as part of a compound
14765         assignment operator.
14766
14767         During compound assignment, a few new rules exist to enable things
14768         like:
14769
14770         byte b |= 1 + 2
14771
14772         From the spec:
14773
14774         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14775         to the type of x) if y is implicitly convertible to the type of x,
14776         and the operator is a builtin operator and the return type of the
14777         operator is explicitly convertible to the type of x. 
14778
14779         * rootcontext.cs: Reset warning level to 2.  4 catches various
14780         "interesting" features in mcs, we must clean this up at some
14781         point, but currently am trying to kill other bugs ;-)
14782
14783         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14784         in container classes as well.  
14785
14786         * expression.cs (Binary.ResolveOperator): Handle string case
14787         before anything else (as operator overloading does emit an error
14788         before doing anything else).
14789
14790         This code could go away when we move to a table driven model, but
14791         i could not come up with a good plan last night.
14792
14793 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14794
14795         * typemanager.cs (CSharpName): reimplementation using regex.
14796         * class.cs: added null check for fields in Emit
14797         * rootcontext.cs: set warninglevel to 4
14798
14799 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14800
14801         * typemanager.cs (CSharpName): reimplemented with Lupus
14802         suggestion.
14803
14804 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14805
14806         * statement.cs (If): correclty implement Resolve, because we were
14807         not catching sem errors in there.  The same process is needed
14808         everywhere else. 
14809         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14810
14811
14812         (Statement.Warning_DeadCodeFound): Factorize code.
14813         (While): Report dead code here too.
14814
14815         (Statement): Added Resolve virtual method to allow
14816         for resolution split from the emit code.
14817
14818 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14819
14820         * statement.cs (EmitBoolExpression): No longer try to resolve the
14821         expression here.    
14822         (MakeBoolean): New utility function that resolve, implicitly
14823         converts to boolean and tags the expression. 
14824
14825
14826         (If, Do): Implement dead code elimination.
14827         (While): Implement loop inversion
14828
14829         (Do, While, For, If): Resolve the expression prior to calling our
14830         code generation.
14831
14832 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14833
14834         * class.cs:
14835           - added method Report28 (warning: program has more than one entry point)
14836           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14837           - modified method Method.Define, the part at the end of the method
14838
14839         * rootcontext.cs: added static public Location EntryPointLocation;
14840           
14841         * ../errors/cs0028.cs : Add test case for the above warning.              
14842
14843         * typemanager.cs:
14844           - modified method CSharpName to allow arrays of primitive type to
14845             be printed nicely (e.g. instead of System.Int32[][] it now prints
14846             int[][])
14847           - added method CSharpSignature: returns the signature of a method
14848             in string format to be used in reporting errors, warnings, etc.
14849
14850         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14851         with String.Empty.
14852
14853 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14854
14855         * delegate.cs (Define): Fix extremely silly bug where I was
14856         setting the type of the 'object' parameter of the BeginInvoke
14857         method to System.IAsyncResult instead of System.Object ;-)
14858
14859 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14860
14861         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14862         here. 
14863
14864         (Constructor.Emit): return if we fail to initialize the
14865         constructor.  Another door closed!  
14866
14867         * expression.cs (New.DoResolve): Improve error message (from -6 to
14868         1501).  Use DeclaredOnly lookup to find the exact constructor.
14869
14870         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14871         loop.  This is useful.
14872
14873         * cs-parser.jay: Adjust the default parameters so that destructors
14874         have the proper signature.
14875
14876 2002-04-26  Martin Baulig  <martin@gnome.org>
14877
14878         * driver.cs (LoadAssembly): If `assembly' contains any characters
14879         which are only valid in path names and not in assembly names
14880         (currently slash, backslash and point), use Assembly.LoadFrom ()
14881         instead of Assembly.Load () on the `assembly' (before iteration
14882         over the link_paths).
14883
14884 2002-04-26  Martin Baulig  <martin@gnome.org>
14885
14886         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14887
14888 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14889
14890         * class.cs (Property): use the new typemanager.MemberLookup
14891
14892         (TypeContainer.MemberLookup): Implement using the
14893         TypeManager.MemberLookup now. 
14894
14895         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14896         and return MemberInfos, so that these can be used without an
14897         EmitContext (what we had before).
14898
14899 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14900
14901         * expression.cs: Fix the case where the argument to params if the
14902         type of the params.  I omitted handling this before.   Fixed
14903
14904 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14905
14906         * driver.cs: Call BootCorlib_PopulateCoreType
14907
14908         * class.cs (Property.CheckBase): Check for properties only, not
14909         for all members. 
14910
14911         * interface.cs: Temporary hack: try/catch around the
14912         CustomAttributeBuilder, because I am getting an exception that I
14913         do not understand.
14914
14915         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14916         types whose definitions are required to be there (attributes are
14917         defined before standard types).
14918
14919         Compute definitions as we boot the various types, as they are used
14920         immediately (value_type class will need object_type, but if we do
14921         not initialize object_type, we will pass a null, which will let
14922         the runtime pick the System.Object from the existing corlib, which
14923         is not what we want).
14924
14925 2002-04-22  Patrik Torstensson <totte@labs2.com>
14926
14927         * cs-tokenizer.cs: fixed a number of trim() issues.
14928
14929 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14930
14931         * expression.cs (Argument.Type): Ensure that we return the correct
14932         type when we have out or ref parameters [in which case we 
14933         append a "&"].
14934
14935 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14936
14937         * class.cs (Property, Indexer): Allow extern modifier in there. 
14938
14939         * typemanager.cs (InitBaseTypes): Initializes object_type and
14940         value_type, since those will be used early on during the bootstrap
14941         process to compile corlib.
14942
14943         (InitCoreTypes): Move code from here to InitBaseTypes.
14944
14945 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14946
14947         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14948         single-dimension arrays as using the ldlen opcode.  
14949
14950         Daniel Lewis discovered this optimization.  
14951
14952         * typemanager.cs: Add signature for System.Array::get_Length
14953
14954 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14955
14956         * statement.cs: report the error when the foreach does not apply to an
14957         array nor a collection.
14958
14959 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14960
14961         * expression.cs: Add implicit conversions to the operator ~.
14962
14963         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14964
14965         * typemanager.cs: Locate the decimal constructor.
14966
14967 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14968
14969         * attribute.cs: use the new property of TypeOf.
14970         * expression.cs: added 'get' property around typearg.
14971
14972         These changes fix a build breaker reported by NickD. Is this the
14973         correct way to fix?  If not, please, revert my changes and make it
14974         work :-).
14975
14976 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14977
14978         * attribute.cs: Add support for typeof in attribute invocations.
14979         I am not sure that this is right though.
14980
14981 2002-04-14  Duncan Mak  <duncan@ximian.com>
14982
14983         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14984         Binary.Operator.Division case.
14985
14986 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14987
14988         * class.cs (DefineType): Ensure that we do a proper check on
14989         attribute types and also register it with the TypeManager.
14990
14991         (TypeContainer.Targets): The default for attribute types is
14992         AttributeTargets.All.
14993
14994         * attribute.cs (ApplyAttributes): Registering the attribute type
14995         is done elsewhere, not when we discover we have a Usage attribute.
14996
14997 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14998
14999         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15000         and get rid of is_delegate parameter.
15001
15002         * everywhere : update.
15003
15004 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15005
15006         * cs-parser.jay (compilation_unit): Revamp completely to use
15007         some new ideas that I got from Rhys' grammar to solve the problems
15008         with assembly level attributes.
15009
15010         (outer_declaration): New grammar production.
15011
15012         (attribute_sections): Add.
15013
15014         (opt_attributes): Base on attribute_sections
15015
15016         (namespace_declaration): Allow opt_attributes to tackle the case
15017         when we have assembly level attributes - we are clever in this
15018         regard now ;-)
15019
15020         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15021         attributes in the non-global context.
15022
15023         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15024         instead of SetGlobalAttributes.
15025
15026         * class.cs, rootcontext.cs : Ensure we define and generate 
15027         attribute types before anything else.
15028
15029         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15030         and flag the new error -20 for the case when the attribute type
15031         does not have valid targets specified. csc does not catch this.
15032
15033         * ../errors/errors.txt : update for error # -20
15034
15035 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15036
15037         * support.cs (InternalParameters.ParameterModifier): Do some null
15038         checking and return sane values.
15039
15040         * class.cs (Method.Define): If we are a PInvoke method, ensure
15041         that we are static and extern. Report error # 601
15042
15043         * ../errors/cs0601.cs : Add test case for the above error.
15044
15045 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15046
15047         * rootcontext.cs (attribute_types): We need to keep type of
15048         all attribute types separately and emit code for them first.
15049
15050         (RegisterAttribute) : Implement.
15051
15052         * class.cs (DefineType): Check if the current Type is a custom
15053         attribute type and register it accordingly.
15054
15055         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15056         adding the first attribute twice and rename to
15057
15058         (SetGlobalAttributes): this.
15059
15060         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15061         lookups.
15062
15063         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15064         if we are processing global arguments. Hmm, I am unsure of this.
15065
15066 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15067
15068         * expression.cs: added static array of strings to avoid calling
15069         Enum.ToString () for Operator in Binary. Significant recover of
15070         performance.
15071
15072 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15073
15074         * class.cs (FindMembers): Allow the Builders of the various
15075         members to be null.  If they are skip them.  This only happens
15076         during the PInvoke declaration.
15077
15078 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15079
15080         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15081         failure, so we do not keep going afterwards.
15082
15083         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15084         wanted to pass `false' as the `is_delegate' argument.  If this is
15085         the case, why not use delegate_type == null to mean `is_delegate =
15086         false' and anything else as is_delegate = true.
15087
15088 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15089
15090         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15091         code for the section, not the beginning of the tests.
15092
15093 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15094
15095         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15096
15097         * expression.cs (Binary): same.  Warn about errors where we have
15098         Enum/Enum in operator + as well.
15099
15100 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15101
15102         * statement.cs:
15103                 - added support for switch(bool)
15104                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15105                 - add TableSwitchEmit() to handle table-based switch statements
15106
15107 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15108
15109         * expression.cs (Invocation.OverloadResolve): Factor out code which
15110         does parameter compatibility checking with arguments so that we can 
15111         re-use the code even from Delegate.VerifyApplicability
15112
15113         (VerifyArgumentsCompat): Move above code here.
15114
15115         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15116         and instead make a call to the above method.
15117
15118 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15119
15120         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15121         We use it to keep track of classes which are attribute types.
15122
15123 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15124
15125         * delegate.cs (Delegate.Define): Correctly define the types in the
15126         presence of fixed and array parameters.
15127
15128         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15129         doing FindMembers.
15130
15131         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15132         include NonPublic after the first iteration.
15133
15134         * class.cs (Indexer.CheckBase): Only check if both parents are
15135         non-null. 
15136
15137         * cs-parser.jay (accessor_body): If empty, set to null.
15138
15139         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15140         same code path here to resolve constants names that we did have in
15141         MemberAccess.DoResolve.  There is too much code duplicated here.
15142
15143 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15144
15145         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15146
15147         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15148         to MakeUnionSet.
15149
15150         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15151         tokens, numbers and strings.
15152
15153         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15154         parenthesis.
15155
15156         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15157         asyncronous parameters and the regular parameters.  
15158
15159         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15160         specify the target directory.
15161
15162         * expression.cs: (This.DoResolve): Simplify
15163         (As.Emit): Optimize, do not generate IsInst if the expression is
15164         always of the given type.
15165
15166         (Is.DoResolve): Bug fix, we were reporting both always/never for
15167         the is expression.
15168
15169         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15170         creating too many unnecessary arrays.
15171
15172 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15173
15174         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15175         fields instead of rolling our own initializer.   Takes care of all
15176         implicit conversions, and drops unnecessary static checks/argument.
15177
15178 2002-03-31  Dick Porter  <dick@ximian.com>
15179
15180         * driver.cs: use the GetDirectories() return values properly, and
15181         use "/" as path separator.
15182
15183 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15184
15185         * expression.cs (Unary): Optimize - - expr into expr.
15186         (Binary): Optimize a + (-b) into a -b.
15187
15188         * codegen.cs (CodeGen): Made all methods static.
15189
15190 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15191
15192         * rootcontext.cs: 
15193
15194         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15195         TypeBuilder property.
15196
15197         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15198         instead. 
15199
15200         * tree.cs: Removed the various RecordXXXX, and replaced with a
15201         single RecordDecl.  Removed all the accessor methods, and just
15202         left a single access point Type 
15203
15204         * enum.cs: Rename DefineEnum to DefineType.
15205
15206         * decl.cs: New abstract method `DefineType' used to unify the
15207         Defines for Enumerations, Interfaces, TypeContainers and
15208         Delegates.
15209
15210         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15211         LookupBaseClasses method that used to live in class.cs and
15212         interface.cs here, and renamed to FindType.
15213
15214         * delegate.cs: Implement DefineType.  Take advantage of the
15215         refactored pattern for locating the parent builder without taking
15216         the parent_builder argument (which we know does not work if we are
15217         nested, and triggering a toplevel definition).
15218
15219 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15220
15221         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15222         accessibility of a member has changed during override and report
15223         an error if so.
15224
15225         * class.cs (Method.Define, Property.Define): Only complain on
15226         overrides if the method is private, any other accessibility is
15227         fine (and since we just checked the permission is the same, we are
15228         good to go).
15229
15230         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15231         and elif are processed always.  The other pre-processing
15232         directives are only processed if we are "taking" the path
15233
15234 2002-03-29  Martin Baulig  <martin@gnome.org>
15235
15236         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15237         current location is not Null.
15238
15239         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15240         a separate method so we can profile it.
15241
15242         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15243         `span.Seconds' are just seconds, but no minutes or hours.
15244         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15245
15246 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15247
15248         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15249         Remove the gratuitous set of Final:
15250
15251                                 // If an interface implementation, then we can set Final.
15252                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15253                                     implementing.DeclaringType.IsInterface)
15254                                         flags |= MethodAttributes.Final;
15255
15256         I do not know what I was smoking when I used that.
15257
15258
15259         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15260         step into fixing the name resolution issues for delegates and
15261         unifying the toplevel name resolution.
15262
15263 2002-03-28  Martin Baulig  <martin@gnome.org>
15264
15265         * class.cs (Method.Emit): If we have a symbol writer, call its
15266         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15267         tell it about the current method.
15268
15269         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15270         writer that we're going to emit the first byte of IL code for a new
15271         statement (a new source line).
15272         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15273         EmitContext.Mark() before emitting any code.
15274
15275         * location.cs (SymbolDocument): Return null when we're Null.
15276
15277         * statement.cs (Statement): Moved the `Location loc' variable here.
15278         (Statement.EmitBoolExpression): If we have a symbol writer, call
15279         ec.Mark() before emitting any code to tell it that we're at the
15280         beginning of a new statement.
15281         (StatementExpression): Added `Location' argument to the constructor.
15282         (Block): Added public readonly variable `StartLocation' and public
15283         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15284         (Block): Added constructor which takes a start and end location.
15285         (Block.SetEndLocation): New method. This sets the end location.
15286         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15287         local variables we create.
15288         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15289         each statement and do also mark the begin and end of the block.
15290
15291         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15292         tell it the current lexer.Location, use Location.Null for the end of the
15293         block.
15294         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15295         current block, set its end location using SetEndLocation().
15296         (statement_expression): StatementExpression constructor now takes the
15297         lexer.Location as additional argument.
15298         (for_statement, declare_local_variables): Likewise.
15299         (declare_local_variables): When creating a new implicit block, use the
15300         new Block constructor and pass it the lexer.Location.
15301
15302 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15303
15304         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15305         members also on the parent interfaces recursively.
15306
15307 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15308
15309         * report.cs: Use new formats, since Gonzalo finished the missing
15310         bits. 
15311
15312         * expression.cs (Binary.ResolveOperator): added missing operator|
15313         operator& and operator^ for bool/bool.
15314
15315         * cs-parser.jay: CheckDef now takes a Location argument that is
15316         used to report errors more precisly (instead of reporting the end
15317         of a definition, we try to track something which is a lot closer
15318         to the source of the problem).
15319
15320         * cs-tokenizer.cs: Track global token use, so we can properly flag
15321         the use of #define/#undef after the first token has been seen.
15322
15323         Also, rename the reportXXXX to Error_DescriptiveName
15324
15325         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15326         TypeContainer, so that Enum and Interface can use this too.
15327
15328         * class.cs (TypeContainer.LookupInterfaceOrClass,
15329         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15330         `builder' argument.  Typically this was used to pass the parent
15331         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15332         the definition).  
15333
15334         The problem is that a nested class could trigger the definition of
15335         a toplevel class, and the builder would be obviously wrong in that
15336         case. 
15337
15338         So we drop this argument, and we compute dynamically the
15339         TypeBuilder/ModuleBuilder (the correct information was available
15340         to us anyways from DeclSpace.Parent)
15341
15342         * interface.cs (Interface.DefineInterface): Drop builder
15343         parameter cleanup like class.cs
15344
15345         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15346         like class.cs
15347
15348         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15349         values. 
15350
15351         (Try.Emit): Propagate the returns value from the statement.
15352
15353         (Return.Emit): Even if we are leavning 
15354
15355         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15356
15357         * modifiers.cs: Fix the computation of MethodAttributes flags.
15358
15359 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15360
15361         * driver.cs: allow compilation of files that start with '/'.
15362         Add a default case when checking the argument of --target.
15363
15364 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15365
15366         * interface.cs: Implement the same search algorithm for types in
15367         the interface code.
15368
15369         * delegate.cs: Do not allow multiple definition.
15370
15371         * Recovered ChangeLog that got accidentally amputated
15372
15373         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15374
15375         * rootcontext.cs: Load manually enum to allow core classes to
15376         contain enumerations.
15377
15378         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15379         Update to new static methods in TypeManager.
15380
15381         * typemanager.cs (GetMethod, GetConstructor): Use our
15382         implementation of FindMembers to find the members, since during
15383         corlib compilation, the types are TypeBuilders and GetMethod and
15384         GetConstructor do not work.
15385
15386         Make all methods in TypeManager static.
15387
15388         (InitCodeHelpers): Split the functionality from
15389         the InitCodeTypes function.
15390
15391         * driver.cs: Call InitCodeHelpers after we have populated the
15392         types. 
15393
15394         * cs-parser.jay (delegate_declaration): we did not used to compute
15395         the delegate name correctly for void delegates.
15396
15397 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15398
15399         * rootcontext.cs (RootContext): Init the interface_resolve_order
15400         and type_container_resolve_order always.
15401
15402         (ResolveCore, BootstrapCorlib_ResolveClass,
15403         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15404         compiler when compiling with --nostdlib
15405
15406         * class.cs (TypeContainer.DefineType): Check that our parent is
15407         not null.  This test is most important when we are bootstraping
15408         the core types.
15409
15410         * codegen.cs: Split out the symbol writing code.
15411
15412 2002-03-25  Martin Baulig  <martin@gnome.org>
15413
15414         * driver.cs (-g): Made -g an alias for --debug.
15415
15416 2002-03-24  Martin Baulig  <martin@gnome.org>
15417
15418         * codegen.cs (SymbolWriter): New public variable. Returns the
15419         current symbol writer.
15420         (CodeGen): Added `bool want_debugging_support' argument to the
15421          constructor. If true, tell the ModuleBuild that we want debugging
15422         support and ask it for the ISymbolWriter.
15423         (Save): If we have a symbol writer, call it's Close() method after
15424         saving the assembly.
15425
15426         * driver.c (--debug): New command line argument to create a
15427         debugger information file.
15428
15429         * location.cs (SymbolDocument): New public property. Returns an
15430         ISymbolDocumentWriter object for the current source file or null
15431         if we don't have a symbol writer.
15432
15433 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15434
15435         * driver.cs (LoadAssembly): Correctly return when all the paths
15436         have been tried and not before.
15437
15438         * statement.cs (Switch.Emit): return the actual coverage for this
15439         statement (returns/not-returns)
15440
15441         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15442         switch of the statement if we are the last switch section.  That
15443         kills two problems: try/catch problems (we used to emit an empty
15444         nop at the end) and switch statements where all branches would
15445         return. 
15446
15447 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15448
15449         * driver.cs: Add default assemblies (the equivalent to the
15450         Microsoft CSC.RSP file)
15451
15452         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15453         also update tokens_seen and set it to false.
15454
15455         * driver.cs: Implement --recurse for Mike.
15456
15457         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15458         correctly splitting out the paths.
15459
15460 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15461
15462         * interface.cs (Interface.PopulateProperty): Instead of using
15463         `parent' as the declaration space for the set parameters, use
15464         `this' 
15465
15466         * support.cs (InternalParameters): InternalParameters constructor
15467         takes a DeclSpace instead of a TypeContainer.
15468
15469         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15470         types are being initialized, load the address of it before calling
15471         the function.  
15472
15473         (New): Provide a mechanism to disable the generation of local
15474         value type temporaries when the caller will be providing us with
15475         an address to store it.
15476
15477         (ArrayCreation.EmitDynamicInitializers): Use it.
15478
15479 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15480
15481         * expression.cs (Invocation.EmitArguments): Only probe for array
15482         property if there is more than one argument.  Sorry about that.
15483
15484         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15485         empty param arrays.
15486
15487         * class.cs (Method.LabelParameters): Fix incorrect code path that
15488         prevented the `ParamArrayAttribute' from being applied to the
15489         params attribute.
15490
15491 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15492
15493         * support.cs (ReflectionParameters): Correctly compute whether the
15494         last argument is a params array.  Fixes the problem with
15495         string.Split ('a')
15496
15497         * typemanager.cs: Make the assemblies array always be non-null
15498         (empty, but non-null)
15499
15500         * tree.cs (RecordDecl): New function that abstracts the recording
15501         of names.  This reports error 101, and provides a pointer to the
15502         previous declaration.  Fixes a crash in the compiler.
15503
15504         * cs-parser.jay (constructor_declaration): Update to new grammar,
15505         and provide a constructor_body that can be empty.
15506
15507 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15508
15509         * driver.cs: Add support for --resources.
15510
15511         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15512         Make all types for the various array helper methods be integer.
15513
15514         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15515         CheckState to ConvCast.
15516
15517         (ConvCast): Now it takes a `checked' state argument, to avoid
15518         depending on the emit context for the conversion, and just using
15519         the resolve time setting.
15520
15521         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15522         instead of Invocation.EmitArguments.  We do not emit the original
15523         arguments, instead we emit those which have been converted to
15524         unsigned int expressions.
15525
15526         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15527
15528         * codegen.cs: ditto.
15529
15530         * expression.cs (LocalVariableReference): Drop the use of the
15531         Store function that depended on the variable index.
15532
15533         * statement.cs (VariableInfo): Drop the `Idx' property from this
15534         class, as this is not taking into account the indexes for
15535         temporaries tat we generate during the execution, getting the
15536         indexes wrong.
15537
15538         * class.cs: First emit class initializers, then call the parent
15539         constructor. 
15540
15541         * expression.cs (Binary): Fix opcode emision.
15542         (UnaryMutator.EmitCode): Support checked code generation
15543
15544         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15545         matches for events for both the Static and Instance scans,
15546         pointing to the same element.   Fix that.
15547
15548 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15549
15550         * rootcontext.cs (ResolveTree): Always set the
15551         interface_resolve_order, because nested interfaces will be calling
15552         into us.
15553
15554         * class.cs (GetInterfaceOrClass): Track the same resolution
15555         process used by TypeManager.LookupType.  This fixes the nested
15556         type lookups in class declarations (separate path from
15557         LookupType). 
15558
15559         (TypeContainer.DefineType): Also define nested interfaces.
15560         (TypeContainer.RegisterOrder): New public function used to
15561         register the order in which child interfaces need to be closed.
15562
15563         Nested interfaces need to be closed after their parents have been
15564         created. 
15565
15566         * interface.cs (InterfaceAttr): Put all the logic for computing
15567         the interface attribute here. 
15568
15569         (DefineInterface): Register our interface order with the
15570         RootContext or with the TypeContainer depending on the case.
15571
15572 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15573
15574         * cs-parser.jay: rework foreach statement to work with the new
15575         changes to the policy on SimpleNames.
15576
15577         * report.cs: support Stacktrace on warnings as well.
15578
15579         * makefile: drop --unsafe and /unsafe from the compile.
15580
15581 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15582
15583         * ecore.cs (StandardConversionExists): Modify to take an Expression
15584         as the first parameter. Ensure we do null -> reference type conversion
15585         checking.
15586
15587         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15588         temporary Expression objects.
15589
15590 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15591
15592         * interface.cs: workaround bug in method overloading resolution
15593         (there is already a bugzilla bug for it).
15594
15595 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15596
15597         We could also solve this problem by having a separate path for
15598         performing type lookups, instead of DoResolve, we could have a
15599         ResolveType entry point, and only participating pieces of the
15600         production (simplename, deref, array) would implement this. 
15601
15602         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15603         signal SimpleName to only resolve type names and not attempt to
15604         resolve anything else.
15605
15606         * expression.cs (Cast): Set the flag.
15607
15608         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15609
15610         * class.cs: Only report 108 if there is no `new' modifier.
15611
15612         * cs-parser.jay: rework foreach statement to work with the new
15613         changes to the policy on SimpleNames.
15614
15615         * report.cs: support Stacktrace on warnings as well.
15616
15617         * makefile: drop --unsafe and /unsafe from the compile.
15618
15619 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15620
15621         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15622         lookups here, instead of doing that at parse time.  This means
15623         that our grammar will not introduce `LocalVariableReferences' as
15624         expressions at this point.  That solves the problem of code like
15625         this:
15626
15627         class X {
15628            static void Main ()
15629            { int X = 1;
15630             { X x = null }}}
15631
15632         This is only half the fix.  The full fix requires parameters to
15633         also be handled in this way.
15634
15635         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15636         makes the use more obvious of the DeclSpace.  The
15637         ec.TypeContainer.TypeBuilder is now only used to pull the
15638         TypeBuilder for it.
15639
15640         My theory is that I can get rid of the TypeBuilder completely from
15641         the EmitContext, and have typecasts where it is used (from
15642         DeclSpace to where it matters).  
15643
15644         The only pending problem is that the code that implements Aliases
15645         is on TypeContainer, and probably should go in DeclSpace.
15646
15647         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15648         lookups here, instead of doing that at parse time.  This means
15649         that our grammar will not introduce `LocalVariableReferences' as
15650         expressions at this point.  That solves the problem of code like
15651         this:
15652
15653         class X {
15654            static void Main ()
15655            { int X = 1;
15656             { X x = null }}}
15657
15658         This is only half the fix.  The full fix requires parameters to
15659         also be handled in this way.
15660
15661         * class.cs (Property.DefineMethod): When implementing an interface
15662         method, set newslot, when implementing an abstract method, do not
15663         set the flag (before we tried never setting it, or always setting
15664         it, which is the difference).
15665         (Indexer.DefineMethod): same.
15666         (Method.DefineMethod): same.
15667
15668         * ecore.cs: Only set the status used flag if we get back a Field.
15669
15670         * attribute.cs: Temporary hack, so Paolo can keep working.
15671
15672 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15673
15674         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15675         the unmanaged type in the case we have a MarshalAs attribute.
15676
15677         (Resolve): Handle the case when we are parsing the special MarshalAs
15678         attribute [we need to store the unmanaged type to use later]
15679
15680         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15681         MarshalAs Attribute.
15682
15683         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15684         on parameters and accordingly set the marshalling info.
15685
15686 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15687
15688         * class.cs: Optimizing slightly by removing redundant code after
15689         we switched to the `NoTypes' return value.
15690         (Property.DefineMethod): use NoTypes here too.
15691
15692         This fixes the bug I introduced in my last batch of changes.
15693
15694 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15695
15696         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15697
15698         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15699         Enums since those are types too. 
15700
15701         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15702
15703         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15704         thanks to a call during the lookup process.
15705
15706 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * statement.cs (Foreach): Lots of work to accomodate a particular
15709         kind of foreach statement that I had not kept in mind.  It is
15710         possible to have foreachs on classes that provide a GetEnumerator
15711         method that return objects that implement the "pattern" for using
15712         a foreach, there is no need to support GetEnumerator
15713         specifically. 
15714
15715         This is needed to compile nant.
15716
15717         * decl.cs: Only report 114 if the member is not `Finalize' and if
15718         the warning level is at least 2.
15719
15720         * class.cs: Moved the compare function from Method to
15721         MethodSignature. 
15722
15723         (MethodSignature.InheritableMemberSignatureCompare): Add new
15724         filter function that is used to extract inheritable methods from a
15725         class. 
15726
15727         (Method.Define): Use the new `inheritable_method_signature_filter'
15728         delegate
15729
15730         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15731         command. 
15732
15733 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15734
15735         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15736
15737         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15738
15739         * expression.cs: Pass location information to
15740         ConvertImplicitStandard. 
15741
15742         * class.cs: Added debugging code to track return values from
15743         interfaces. 
15744
15745 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15746
15747         * expression.cs (Is.DoResolve): If either side of the `is' is an
15748         interface, do not flag the warning.
15749
15750         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15751         for interfaces
15752
15753         * report.cs: Allow for --fatal to be used with --probe.
15754
15755         * typemanager.cs (NoTypes): Move the definition for the empty Type
15756         array here. 
15757
15758         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15759         properties. 
15760         (TypeContainer.DefineProxy): New function used to proxy to parent
15761         implementations when implementing interfaces.
15762         (TypeContainer.ParentImplements): used to lookup if our parent
15763         implements a public function that is required by an interface.
15764         (TypeContainer.VerifyPendingMethods): Hook this up.
15765
15766         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15767         `modules' and `assemblies' arraylists into arrays.  We only grow
15768         these are the very early start up of the program, so this improves
15769         the speedof LookupType (nicely measured).
15770
15771         * expression.cs (MakeByteBlob): Replaced unsafe code with
15772         BitConverter, as suggested by Paolo.
15773
15774         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15775         folding of string concatenation, but if either side is a string,
15776         and the other is not, then return null, and let the runtime use
15777         the concatenation on the string plus the object (using
15778         `Object.ToString'). 
15779
15780 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15781
15782         Constant Folding has been implemented now.
15783
15784         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15785         the error instead on types that are not supported in one's
15786         complement. 
15787
15788         * constant.cs (Constant and all children): New set of functions to
15789         perform implict and explicit conversions.
15790
15791         * ecore.cs (EnumConstant): Implement the new functions to perform
15792         conversion by proxying to the child expression.
15793
15794         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15795         own separate setting that can not be turned off from the command
15796         line using --unchecked or --checked and is only controlled using
15797         the checked/unchecked statements and expressions.  This setting is
15798         used by the constant folder to flag errors.
15799
15800         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15801         ConstantCheckState as well.   
15802
15803         During Resolve, they also have to flag the state, because the
15804         constant folder runs completely in the Resolve phase.
15805
15806         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15807         well.
15808
15809 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15810
15811         * cfold.cs: New file, this file contains the constant folder.
15812
15813         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15814         argument to track whether we are using the resulting address to
15815         load or store a value and provide better error messages. 
15816
15817         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15818         new AddressOf arguments.
15819
15820         * statement.cs (Foreach.EmitCollectionForeach): Update
15821
15822         * expression.cs (Argument.Emit): Call AddressOf with proper
15823         arguments to track usage.
15824
15825         (New.DoEmit): Call AddressOf with new arguments.
15826
15827         (Unary.Emit): Adjust AddressOf call.
15828
15829 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15830
15831         * cs-parser.jay (member_access): Change the case for pre-defined types
15832         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15833         this suggestion.
15834
15835         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15836         a method body.
15837
15838         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15839         essentially like methods and apply attributes like MethodImplOptions to them too.
15840
15841         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15842         not being null.
15843
15844         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15845         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15846         is the DeclSpace.
15847
15848         * Update code everywhere accordingly.
15849
15850         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15851
15852         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15853
15854 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15855
15856         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15857         try performing lookups against those instead of jumping straight into using
15858         the 'using' clauses.
15859
15860         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15861
15862         (LookupType): Perform lookups in implicit parents too.
15863
15864         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15865         sequence as RootContext.LookupType. 
15866
15867         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15868         the various cases of namespace lookups into this method.
15869
15870 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15871
15872         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15873         in positional arguments)
15874
15875         * class.cs (Operator): Update the AllowedModifiers to contain
15876         extern. 
15877
15878         * cs-parser.jay: Update operator declaration to allow for the
15879         operator body to be empty.
15880
15881         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15882         values. 
15883
15884 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15885
15886         * class.cs (Method.Emit): Label parameters.
15887
15888         * driver.cs: Return 1 or 0 as the program exit code.
15889
15890 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15891
15892         * expression.cs: Special case the `null' object when trying to
15893         auto-compute the type, as anything can be explicitly converted to
15894         that. 
15895
15896         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15897         spotting this Paolo.
15898
15899         (Expression.ImplicitNumericConversion): Perform comparissions of
15900         the type using the underlying type in the case of an enumeration
15901         rather than using the enumeration type for the compare.
15902
15903         Cope with the underlying == type case, which is not possible to
15904         catch before. 
15905
15906         (Expression.ConvertNumericExplicit): Perform comparissions of
15907         the type using the underlying type in the case of an enumeration
15908         rather than using the enumeration type for the compare.
15909
15910         * driver.cs: If the user does not supply an extension, assume .exe
15911
15912         * cs-parser.jay (if_statement): Rewrote so that we can track the
15913         location for the if statement.
15914
15915         * expression.cs (Binary.ConstantFold): Only concat strings when
15916         the operation is "+", not everything ;-)
15917
15918         * statement.cs (Statement.EmitBoolExpression): Take a location
15919         argument. 
15920         (If, While, Do): Track location.
15921
15922         * expression.cs (Binary.ResolveOperator): In the object + string
15923         case, I was missing a call to ConvertImplicit
15924
15925 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15926
15927         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15928         Location arguments. Ensure we use RootContext.LookupType to do our work
15929         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15930
15931         * interface.cs (PopulateMethod): Handle the type of the parameter being
15932         null gracefully.
15933
15934         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15935         have a params method with no fixed arguments and a call is made with no
15936         arguments.
15937
15938 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15939
15940         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15941         the verbatim-string-literal
15942
15943         * support.cs (InternalParameters.ParameterModifier): handle null
15944         fixed parameters.
15945         (InternalParameters.ParameterType): ditto.
15946
15947         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15948         duplicating the name of the variable parameter.
15949         (GetParameterByName): Fix bug where we were not looking up array
15950         paramters if they were the only present (thanks Paolo!).
15951         (GetParameterInfo): We only have an empty set of types if both
15952         fixed and array are set to null.
15953         (GetParameterInfo-idx): Handle FixedParameter == null
15954
15955         * cs-parser.jay: Handle the case where there is no catch
15956         statements (missing null test).
15957
15958 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * driver.cs (MainDriver): Be conservative on our command line
15961         handling.
15962
15963         Catch DirectoryNotFoundException when calling GetFiles.
15964
15965         (SplitPathAndPattern): Used to split the input specification into
15966         a path and a pattern that we can feed to Directory.GetFiles.
15967
15968 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15969
15970         * statement.cs (Fixed): Implement the last case of the Fixed
15971         statement (string handling).
15972
15973         * expression.cs (StringPtr): New class used to return a char * to
15974         a string;  Used by the Fixed statement.
15975
15976         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15977
15978         * expression.cs (Binary.ResolveOperator): Remove redundant
15979         MemberLookup pn parent type.
15980         Optimize union call, we do not need a union if the types are the same.
15981         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15982         type.
15983
15984         Specialize the use of MemberLookup everywhere, instead of using
15985         the default settings. 
15986
15987         (StackAlloc): Implement stackalloc keyword.
15988
15989         * cs-parser.jay: Add rule to parse stackalloc.
15990
15991         * driver.cs: Handle /h, /help, /?
15992
15993         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15994         before we supported unsafe code.
15995
15996         * makefile: add --unsafe to the self compilation of mcs.
15997
15998 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15999
16000         * expression.cs (PointerArithmetic): New class that is used to
16001         perform pointer arithmetic.
16002         (Binary.Resolve): Handle pointer arithmetic
16003         Handle pointer comparission.
16004         (ArrayPtr): Utility expression class that is used to take the
16005         address of an array.
16006
16007         (ElementAccess): Implement array access for pointers
16008
16009         * statement.cs (Fixed): Implement fixed statement for arrays, we
16010         are missing one more case before we are done.
16011
16012         * expression.cs (Indirection): Implement EmitAssign and set the
16013         ExprClass to Variable.  This allows pointer dereferences to be
16014         treated as variables, and to have values assigned to them.
16015
16016         * ecore.cs (Expression.StoreFromPtr): New utility function to
16017         store values dereferencing.
16018
16019 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16020
16021         * expression.cs (Binary.ResolveOperator): Ensure that we are
16022         not trying to operate on a void type - this fixes the reported
16023         bug.
16024
16025         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16026         the parent implementation is sealed.
16027
16028         * ../errors/cs0239.cs : Add.
16029
16030         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16031
16032         * typemanager.cs (unverifiable_code_type): Corresponds to 
16033         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16034         which have unsafe code in them.
16035
16036         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16037         unsafe context.
16038
16039 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16040
16041         * cs-tokenizer.cs: Add support for @"litreal strings"
16042
16043         Make tokenizer accept pre-processor directives
16044         on any column (remove the old C-like limitation). 
16045
16046         * rootcontext.cs (EmitCode): Emit any global attributes.
16047         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16048
16049         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16050
16051         * cs-parser.jay: Add support for global attributes.  
16052
16053 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16054
16055         * expression.cs (Indirection): New helper class.  Unary will
16056         create Indirection classes to be able to implement the
16057         IMemoryLocation interface on it.
16058
16059 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16060
16061         * cs-parser.jay (fixed_statement): reference the right statement.
16062
16063         * statement.cs (Fixed.Emit): Finish implementing the fixed
16064         statement for the &x case.
16065
16066 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * class.cs (Property.Define, Method.Define): Remove newslot when
16069         `implementing'.  
16070
16071         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16072         wrong.  NewSlot should only be used if the `new' keyword is present.
16073
16074         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16075         locating our system dir.  Sorry about this.
16076
16077 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16078
16079         * driver.cs (GetSystemDir): Compute correctly the location of our
16080         system assemblies.  I was using the compiler directory instead of
16081         the library directory.
16082
16083 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16084
16085         * expression.cs (BetterFunction): Put back in what Miguel commented out
16086         since it is the correct fix. The problem is elsewhere ;-)
16087
16088         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16089         parameters of the parms method are themselves compatible or not !
16090
16091         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16092         to check that a class implements an interface before saying that an implicit
16093         conversion was allowed. Use ImplementsInterface to do the checking.
16094
16095 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16096
16097         * class.cs (Method.Define): Track whether we are an explicit
16098         implementation or not.  And only call DefineMethodOverride if we
16099         are an explicit implementation.
16100
16101         (Property.DefineMethod): Ditto.
16102
16103 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16104
16105         * expression.cs (BetterFunction): Catch hideous bug which was
16106          preventing us from detecting ambiguous calls due to implicit casts i.e
16107         cs0121.
16108
16109 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16110
16111         * support.cs (Pair): Remove un-needed method.  I figured why I was
16112         getting the error in cs-parser.jay, the variable in a foreach loop
16113         is readonly, and the compiler does not really treat this as a variable.
16114
16115         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16116         instead of EQUALS in grammar.  
16117
16118         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16119
16120         * expression.cs (Unary.DoResolve): Check whether the argument is
16121         managed or not.
16122
16123 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16124
16125         * support.cs: Api for Pair to set a value.  Despite the fact that
16126         the variables are public the MS C# compiler refuses to compile
16127         code that accesses the field if the variable is part of a foreach
16128         statement. 
16129
16130         * statement.cs (Fixed): Begin implementation of the fixed
16131         statement.
16132
16133         (Block.AddVariable): Return the VariableInfo on success and null
16134         on failure instead of true/false. 
16135
16136         * cs-parser.jay (foreach): Catch errors on variables already
16137         defined (we were ignoring this value before) and properly unwind
16138         the block hierarchy
16139
16140         (fixed_statement): grammar for the fixed statement.
16141
16142 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16143
16144         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16145         pointer types to be incretemented.
16146
16147         (SizeOf): Implement.
16148
16149         * cs-parser.jay (pointer_member_access): Implement
16150         expr->IDENTIFIER production.
16151
16152         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16153         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16154         on safe contexts.
16155
16156         (Unary): Implement indirection.
16157
16158         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16159         use in non-unsafe context).
16160
16161         (SimpleName.DoResolve): Check for pointers in field access on safe
16162         contexts. 
16163
16164         (Expression.LoadFromPtr): Factor the load-indirect code in this
16165         function.  This was duplicated in UnboxCast and ParameterReference
16166
16167 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16168
16169         * expression.cs (ComposedCast): report an error if a pointer cast
16170         is used in a safe region.
16171
16172         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16173         pointer type casts in unsafe context.
16174
16175         * codegen.cs (EmitContext): Set up IsUnsafe.
16176
16177         * cs-parser.jay (non_expression_type): Add productions for pointer
16178         casts. 
16179
16180         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16181         code.  We should not use force into static mode if the method is
16182         not virtual.  Fixes bug in MIS
16183
16184         * statement.cs (Do.Emit, While.Emit, For.Emit,
16185         Statement.EmitBoolExpression): Add support to Do and While to
16186         propagate infinite loop as `I do return' semantics.
16187
16188         Improve the For case to also test for boolean constants.
16189
16190         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16191         to the list of attributes we can add.
16192
16193         Remove `EmitContext' argument.
16194
16195         * class.cs (Method.Define): Apply parameter attributes.
16196         (Constructor.Define): Apply parameter attributes.
16197         (MethodCore.LabelParameters): Move here the core of labeling
16198         parameters. 
16199
16200         * support.cs (ReflectionParameters.ParameterModifier,
16201         InternalParameters.ParameterModifier): Use IsByRef on the type and
16202         only return the OUT bit for these parameters instead of in/out/ref
16203         flags.
16204
16205         This is because I miss-understood things.  The ParameterInfo.IsIn
16206         and IsOut represent whether the parameter has the [In] and [Out]
16207         attributes set.  
16208
16209 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16210
16211         * ecore.cs (FieldExpr.Emit): Release temporaries.
16212
16213         * assign.cs (LocalTemporary.Release): new function.
16214
16215         * codegen.cs (EmitContext.GetTemporaryStorage,
16216         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16217         temporary storage.  Now we can "put back" localbuilders when we
16218         are done with them
16219
16220 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16221
16222         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16223         need to make a copy of the variable to generate verifiable code.
16224
16225 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16226
16227         * driver.cs: Compute dynamically the system directory.
16228
16229         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16230         Slower, but more generally useful.  Used by the abstract
16231         registering implementation. 
16232
16233         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16234         the rules for the special rule on Type/instances.  First check if
16235         we have the same name, and if so, try that special static path
16236         rather than the instance path.
16237
16238 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16239
16240         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16241         for, while and if.
16242
16243         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16244         Enum, ValueType, Delegate or Array for non-corlib compiles.
16245
16246         * cs-tokenizer.cs: Catch long identifiers (645)
16247
16248         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16249         piece of code.
16250
16251         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16252         fix, we were returning too early, so we were not registering
16253         pending methods from abstract classes.
16254
16255         Do not register pending methods if the class is abstract.
16256
16257         * expression.cs (Conditional.DoResolve): Report circular implicit
16258         conversions when we neecd to compute it for conditional
16259         expressions. 
16260
16261         (Is.DoResolve): If the expression is always of the provided type,
16262         flag warning 183.  If the expression can not ever be of the
16263         provided type flag warning 184.
16264
16265         * class.cs: Catch 169 as well.
16266
16267         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16268         read. 
16269
16270 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16271
16272         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16273
16274 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16275
16276         * interface.cs: (PopulateMethod): Check for pointers being defined
16277         only if the unsafe context is active.
16278         (PopulateProperty): ditto.
16279         (PopulateIndexer): ditto.
16280
16281         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16282         specified.  If pointers are present, make sure that they are
16283         present in an unsafe context.
16284         (Constructor, Constructor.Define): ditto.
16285         (Field, Field.Define): ditto.
16286         (Property, Property.Define): ditto.
16287         (Event, Event.Define): ditto.
16288
16289         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16290         hashtable if there are classes or structs defined.
16291
16292         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16293         code, as the constant resolution moved.
16294
16295         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16296         the metadata, so we can flag error 133. 
16297
16298         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16299         pointer is being declared in an unsafe context.
16300
16301 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16302
16303         * modifiers.cs (Modifiers.Check): Require a Location argument.
16304         Report error 227 for Unsafe use.
16305
16306         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16307
16308         * statement.cs (For.Emit): If the test is null, then report that
16309         we do `return', as we wont reach anything afterwards.
16310
16311         (Switch.SwitchGoverningType): Track the expression that matched
16312         the conversion.
16313
16314         * driver.cs: Allow negative numbers as an error code to flag.
16315
16316         * cs-parser.jay: Handle 1551.
16317
16318         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16319
16320 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16321
16322         * cs-parser.jay: Report 1518 (type declaration can only contain
16323         class, struct, interface, enum or delegate)
16324
16325         (switch_label): Report 1523 (keywords `case' or `default' must
16326         preced code)
16327
16328         (opt_switch_sections): Report 1522 (empty switch)
16329
16330         * driver.cs: Report 1515 (response file specified multiple times)
16331         Report 1516 (Source file specified multiple times).
16332
16333         * expression.cs (Argument.Resolve): Signal 1510
16334
16335         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16336         access not allowed in static code)
16337
16338 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16339
16340         * typemanager.cs (IsPointerType): Utility method which we are going
16341         to need a lot.
16342
16343         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16344         the object type, so we take care of that.
16345
16346         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16347
16348         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16349         added to non-params parameters :-)
16350
16351         * typemanager.cs (CSharpName): Include 'void' type too. 
16352
16353         (void_ptr_type): Include in the set of core types.
16354
16355         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16356         duplicating code.
16357
16358         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16359         an unsafe context.
16360
16361         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16362         completely forgotten about it.
16363
16364 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16365
16366         * cs-parser.jay (pointer_type): Add. This begins our implementation
16367         of parsing rules for unsafe code.
16368
16369         (unsafe_statement): Implement.
16370
16371         (embedded_statement): Modify to include the above.
16372
16373         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16374
16375         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16376         if the current context is an unsafe one.
16377
16378         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16379         are handled differently, we need separate rules for them.
16380
16381         (local_variable_declaration): Update to use local_variable_pointer_type
16382         to allow variable declarations of unmanaged pointer types.
16383
16384         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16385         in unsafe contexts.
16386
16387         * ../errors/cs0214.cs : Add.
16388
16389 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16390
16391         * makefile: remove 'response' file when cleaning.
16392
16393 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16394
16395         * cs-parser.jay: Report 1524.
16396
16397 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16398
16399         * typemanager.cs (RegisterMethod): drop checking if we have
16400         registered this from here
16401
16402 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16403
16404         * class.cs (Method.EmitDestructor): Implement calling our base
16405         destructor. 
16406
16407         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16408         value of InFinally.
16409
16410         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16411         this routine and will wrap the call in a try/catch block.  Deal
16412         with the case.
16413
16414 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16415
16416         * ecore.cs (Expression.MemberLookup): instead of taking a
16417         parameter `same_type' that was used to tell whether we could
16418         access private members we compute our containing type from the
16419         EmitContext.
16420
16421         (FieldExpr): Added partial support for volatile fields.  This does
16422         not work for volatile fields exposed from assemblies, as I can not
16423         figure out how to extract the modreq from it.
16424
16425         Updated all the source files to use this.
16426
16427         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16428         because it is referenced by MemberLookup very often. 
16429
16430 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16431
16432         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16433         TypeBuilder.GetCustomAttributes to retrieve what we need.
16434
16435         Get rid of redundant default_member_attr_type as this is the same as
16436         default_member_type which already exists.
16437
16438         * interface.cs, attribute.cs : Update accordingly.
16439
16440 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16441
16442         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16443         work for TYpeBuilders though.  Ravi, can you please fix this?
16444
16445         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16446
16447         * expression.cs (Argument.Emit): Handle the case of ref objects
16448         being passed to ref functions;  
16449
16450         (ParameterReference.EmitLoad): Loads the content of the pointer
16451         without dereferencing.
16452
16453 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16454
16455         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16456
16457 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16458
16459         * class.cs (Indexer.DefineMethod): Incorporate the interface
16460         type in the name of the method if we are doing explicit interface
16461         implementation.
16462
16463         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16464
16465         (BetterConversion): Fix extremely trivial bug where we were referring to
16466         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16467         again !
16468
16469         * ../errors/bug16.cs : Add although we have fixed it.
16470
16471 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16472
16473         * expression.cs (BaseIndexer): Begin implementation.
16474
16475         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16476
16477         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16478         production directly to remove a shift/reduce, and implement
16479         explicit interface implementation.
16480
16481         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16482         after a floating point suffix.
16483
16484         * expression.cs (DoNumericPromotions): Improved the conversion for
16485         uint/uint.  If we have a constant, we avoid doing a typecast to a
16486         larger type.
16487
16488         * class.cs (Indexer): Implement explicit interface implementation
16489         for indexers.
16490
16491 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16492
16493         * class.cs: make the default instance constructor public and hidebysig.
16494
16495 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16496
16497         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16498         so we can call it from elsewhere.
16499
16500         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16501         we emit it internally if the class has a defined indexer; otherwise the user
16502         emits it by decorating the class definition with the DefaultMemberAttribute.
16503
16504         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16505         attribute is not used on a type which defines an indexer.
16506
16507         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16508         character when we skip whitespace.
16509
16510         * ../errors/cs0646.cs : Add.
16511
16512 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16513
16514         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16515         again. 
16516
16517         * makefile: Add practical target `mcs3.exe' which builds the third
16518         generation compiler. 
16519
16520         * expression.cs (New): Fix structures constructor calling.
16521
16522         * class.cs (Property, Method, Indexer): Emit Final flag on the
16523         method if we are an interface implementation and we are not
16524         abstract. 
16525
16526         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16527         whether this property is referencing a `base' method.
16528
16529         * expression.cs (Invocation.EmitCall): take an extra argument:
16530         is_base, this is used to determine whether the `call' or
16531         `callvirt' opcode should be used.
16532
16533
16534         * delegate.cs: update EmitCall.
16535
16536         * class.cs (Method.Define): Set NewSlot for the cases where we are
16537         not implementing an interface method.
16538
16539         (Property.Define): ditto.
16540
16541 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16542
16543         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16544         'r'.  Allows mcs to parse itself fully.
16545
16546 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16547
16548         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16549         of the number of initializers that require the InitializeArray method.
16550
16551         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16552         update the above field where necessary.
16553
16554         (MakeByteBlob): Update accordingly.
16555
16556         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16557         greater than 2.
16558
16559         (EmitDynamicInitializers): Update in accordance with the new optimization.
16560
16561         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16562         same OpCode applies.
16563
16564         * cs-parser.jay : Fix some glaring errors I introduced.
16565
16566 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16567
16568         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16569         so that we can check for name clashes there too.
16570
16571         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16572         for interface indexers.
16573
16574         * interfaces.cs (Define): Emit the default member attribute.
16575
16576         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16577         variable was being referred to while setting the value ;-)
16578
16579 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16580
16581         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16582         byte-by-byte information when we know the data is zero.
16583
16584         Make the block always a multiple of 4, because
16585         DefineInitializedData has a bug.
16586
16587         * assign.cs: Fix, we should assign from the temporary, not from
16588         the source. 
16589
16590         * expression.cs (MakeByteBlob): Fix my incorrect code.
16591
16592 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16593
16594         * typemanager.cs (EnumToUnderlying): This function is used to get
16595         the underlying type from an enumeration, because it does not
16596         always work. 
16597
16598         * constant.cs: Use the I4_S form for values between -128 and 127.
16599
16600         * statement.cs (Block.LookupLabel): Looks up a label.
16601         (Block): Drop support for labeled blocks.
16602
16603         (LabeledStatement): New kind of statement that represents a label
16604         only.
16605
16606         (Goto): Finally implement this bad boy.
16607
16608         * cs-parser.jay: Update to reflect new mechanism to implement
16609         labels.
16610
16611 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16612
16613         * codegen.cs (EmitContext.This): a codegen property that keeps the
16614         a single instance of this instead of creating many different this
16615         instances. 
16616
16617         * delegate.cs (Delegate.DoResolve): Update to use the property;
16618
16619         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16620
16621         * expression.cs (BaseAccess.DoResolve): Ditto.
16622
16623 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16624
16625         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16626         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16627
16628         (InitCoreTypes): Update accordingly.
16629
16630         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16631         so we can quickly store the state.
16632
16633         (ApplyAttributes): Set the correct implementation flags
16634         for InternalCall methods.
16635
16636 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16637
16638         * expression.cs (EmitCall): if a method is not virtual, then do
16639         not use callvirt on it.
16640
16641         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16642         user defined stuff) requires the use of stobj, which takes an
16643         address on the stack instead of an array and an index.  So emit
16644         the Ldelema operation for it.
16645
16646         (EmitStoreOpcode): Use stobj for valuetypes.
16647
16648         (UnaryMutator.EmitCode): Use the right 1 value depending on
16649         whether we are dealing with int64/uint64, float or doubles.
16650
16651         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16652         constructors that I implemented last night.
16653
16654         (Constructor.IsDefault): Fix to work properly for static
16655         constructors.
16656
16657         * cs-parser.jay (CheckDef): report method signature errors.
16658         Update error number 103 to be 132.
16659
16660         * decl.cs: New AdditionResult enumeration value: MethodExists.
16661         Although we do this check for methods later on in the semantic
16662         analysis, catching repeated default constructors is so easy that
16663         we catch these here. 
16664
16665         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16666         promotions code.
16667
16668         (ParameterReference.EmitAssign, Emit): handle
16669         bools as bytes.
16670
16671         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16672         (ArrayAccess.EmitStoreOpcode): ditto.
16673
16674         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16675
16676         * expression.cs (MakeByteBlob): Complete all the missing types
16677         (uint, short, ushort, byte, sbyte)
16678
16679         * class.cs: Only init instance field initializers on instance
16680         constructors. 
16681
16682         Rename `constructors' to instance_constructors. 
16683
16684         (TypeContainer.AddConstructor): Only add constructors to the list
16685         if it is not static.
16686
16687         Make sure that we handle default_static_constructor independently
16688         everywhere where we handle instance_constructors
16689
16690 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16691
16692         * class.cs: Do not lookup or create a base initializer for a
16693         static constructor.
16694
16695         (ConstructorInitializer.Resolve): use the proper type to lookup
16696         for constructors.
16697
16698         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16699
16700         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16701         in DeclSpace. 
16702
16703         * decl.cs: CloseType is now an virtual method, the default
16704         implementation just closes this type.
16705
16706 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16707
16708         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16709         to PreserveSig by default. Also emit HideBySig on such methods.
16710
16711         Basically, set the defaults to standard values.
16712
16713         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16714         argument, if candidate is better, it can't be worse than the best !
16715
16716         (Invocation): Re-write bits to differentiate between methods being
16717         applicable in their expanded form and their normal form - for params
16718         methods of course.
16719
16720         Get rid of use_standard everywhere as only standard conversions are allowed
16721         in overload resolution. 
16722
16723         More spec conformance.
16724
16725 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16726
16727         * driver.cs: Add --timestamp, to see where the compiler spends
16728         most of its time.
16729
16730         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16731         `this' in static code.
16732
16733         (SimpleName.DoResolve): Implement in terms of a helper function
16734         that allows static-references to be passed upstream to
16735         MemberAccess.
16736
16737         (Expression.ResolveWithSimpleName): Resolve specially simple
16738         names when called by MemberAccess to implement the special
16739         semantics. 
16740
16741         (Expression.ImplicitReferenceConversion): Handle conversions from
16742         Null to reference types before others, as Null's type is
16743         System.Object. 
16744
16745         * expression.cs (Invocation.EmitCall): Handle the special case of
16746         calling methods declared on a reference type from a ValueType
16747         (Base classes System.Object and System.Enum)
16748
16749         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16750         the left hand side is a TypeExpr, not on every enumeration. 
16751
16752         (Binary.Resolve): If types are reference types, then do a cast to
16753         object on operators != and == of both arguments.
16754
16755         * typemanager.cs (FindMembers): Extract instance and static
16756         members if requested.
16757
16758         * interface.cs (PopulateProperty): Use void_type instead of null
16759         as the return type for the setter method.
16760
16761         (PopulateIndexer): ditto.
16762
16763 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16764
16765         * support.cs (ReflectionParameters): Fix minor bug where we
16766         were examining the wrong parameter for the ParamArray attribute.
16767
16768         Cope with requests for the type of the parameter at position
16769         greater than the params parameter's. We now return the element
16770         type of the params array as that makes more sense.
16771
16772         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16773         accordingly as we no longer have to extract the element type
16774         ourselves.
16775
16776         (Invocation.OverloadResolve): Update.
16777
16778 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16781         against IEnumerator, test whether the return value is a descendant
16782         of the IEnumerator interface.
16783
16784         * class.cs (Indexer.Define): Use an auxiliary method to implement
16785         the other bits of the method definition.  Begin support for
16786         explicit interface implementation.
16787
16788         (Property.DefineMethod): Use TypeManager.void_type instead of null
16789         for an empty return value.
16790
16791 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16792
16793         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16794         dealing with a FieldExpr which is composed of a FieldBuilder, in
16795         the code path we did extract the constant, but we should have
16796         obtained the underlying value to be able to cast it (otherwise we
16797         end up in an infinite loop, this is what Ravi was running into).
16798
16799         (ArrayCreation.UpdateIndices): Arrays might be empty.
16800
16801         (MemberAccess.ResolveMemberAccess): Add support for section
16802         14.5.4.1 that deals with the special case of E.I when E is a type
16803         and something else, that I can be a reference to a static member.
16804
16805         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16806         handle a particular array type to create byte blobs, it is just
16807         something we dont generate byteblobs for.
16808
16809         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16810         arguments. 
16811
16812         * location.cs (Push): remove the key from the hashtable that we
16813         are about to add.   This happens for empty files.
16814
16815         * driver.cs: Dispose files after we have parsed them.
16816
16817         (tokenize): new function that only runs the tokenizer on its
16818         input, for speed testing.
16819
16820 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16821
16822         * class.cs (Event.Define): Define the private field only if there
16823         are no accessors defined.
16824
16825         * expression.cs (ResolveMemberAccess): If there is no associated
16826         field with the event, that means we have an event defined with its
16827         own accessors and we should flag error cs0070 since transforming
16828         ourselves into a field is not valid in that case.
16829
16830         * ecore.cs (SimpleName.DoResolve): Same as above.
16831
16832         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16833         and charset to sane values.
16834
16835 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16836
16837         * assign.cs (DoResolve): Perform check on events only if they 
16838         are being accessed outside the declaring type.
16839
16840         * cs-parser.jay (event_declarations): Update rules to correctly
16841         set the type of the implicit parameter etc.
16842
16843         (add_accessor, remove_accessor): Set current local parameters.
16844
16845         * expression.cs (Binary): For delegate addition and subtraction,
16846         cast the return value from the method into the appropriate delegate
16847         type.
16848
16849 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16850
16851         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16852         of these as the workaround is unnecessary.
16853
16854         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16855         delegate data - none of that is needed at all.
16856
16857         Re-write bits to extract the instance expression and the delegate method
16858         correctly.
16859
16860         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16861         on delegates too.
16862
16863         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16864         of attaching attributes instead of duplicating code everywhere.
16865
16866         * everywhere : Update code to do attribute emission using the above method.
16867
16868 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16869
16870         * expression.cs (IsParamsMethodApplicable): if there are not
16871         parameters, return immediately.
16872
16873         * ecore.cs: The 0 literal can be implicity converted to an enum
16874         type. 
16875
16876         (SimpleName.DoResolve): First lookup the type, then lookup the
16877         members. 
16878
16879         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16880         want to get its address.  If the InstanceExpression is not
16881         addressable, store the result in a temporary variable, then get
16882         the address of it.
16883
16884         * codegen.cs: Only display 219 errors on warning level or above. 
16885
16886         * expression.cs (ArrayAccess): Make it implement the
16887         IMemoryLocation interface.
16888
16889         (Binary.DoResolve): handle the operator == (object a, object b)
16890         and operator != (object a, object b) without incurring into a
16891         BoxedCast (because 5 != o should never be performed).
16892
16893         Handle binary enumerator operators.
16894
16895         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16896         value type, otherwise use Ldelem_ref.
16897
16898         Use precomputed names;
16899
16900         (AddressOf): Implement address of
16901
16902         * cs-parser.jay (labeled_statement): Fix recursive block
16903         addition by reworking the production.
16904
16905         * expression.cs (New.DoEmit): New has a special case:
16906                 
16907                  If we are dealing with a ValueType, we have a few
16908                  situations to deal with:
16909                 
16910                     * The target of New is a ValueType variable, that is
16911                       easy, we just pass this as the variable reference
16912                 
16913                     * The target of New is being passed as an argument,
16914                       to a boxing operation or a function that takes a
16915                       ValueType.
16916                 
16917                       In this case, we need to create a temporary variable
16918                       that is the argument of New.
16919
16920
16921 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16922
16923         * rootcontext.cs (LookupType): Check that current_type is not null before
16924         going about looking at nested types.
16925
16926         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16927         not implement the IAssignMethod interface any more.
16928
16929         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16930         where we tranform them into FieldExprs if they are being resolved from within
16931         the declaring type.
16932
16933         * ecore.cs (SimpleName.DoResolve): Do the same here.
16934
16935         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16936
16937         * ../errors/bug10.cs : Add.
16938
16939         * ../errors/cs0070.cs : Add.
16940
16941         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16942
16943         * assign.cs : Get rid of EventIsLocal everywhere.
16944
16945 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16946
16947         * ecore.cs (ConvertIntLiteral): finished the implementation.
16948
16949         * statement.cs (SwitchLabel): Convert the value we are using as a
16950         key before looking up the table.
16951
16952 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16953
16954         * codegen.cs (EmitTopBlock): Require a Location argument now.
16955
16956         * cs-parser.jay (constructor_declarator): We need to setup
16957         current_local_parameters before we parse the
16958         opt_constructor_initializer, to allow the variables to be bound
16959         to the constructor arguments.
16960
16961         * rootcontext.cs (LookupType): First lookup nested classes in our
16962         class and our parents before we go looking outside our class.
16963
16964         * expression.cs (ConstantFold): Extract/debox the values at the
16965         beginnning. 
16966
16967         * rootcontext.cs (EmitCode): Resolve the constants first before we
16968         resolve the types.  This is not really needed, but it helps debugging.
16969
16970         * statement.cs: report location.
16971
16972         * cs-parser.jay: pass location to throw statement.
16973
16974         * driver.cs: Small bug fix.
16975
16976         * report.cs: Updated format to be 4-zero filled digits.
16977
16978 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16979
16980         * expression.cs (CheckIndices): Fix minor bug where the wrong
16981         variable was being referred to ;-)
16982
16983         (DoEmit): Do not call EmitStaticInitializers when the 
16984         underlying type is System.Object.
16985
16986 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16987
16988         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16989         and do the usual workaround for SRE.
16990
16991         * class.cs (MyEventBuilder.EventType): New member to get at the type
16992         of the event, quickly.
16993
16994         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16995
16996         * assign.cs (Assign.DoResolve): Handle the case when the target
16997         is an EventExpr and perform the necessary checks.
16998
16999         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17000         interface.
17001
17002         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17003
17004         (EventExpr): Set the type in the constructor itself since we 
17005         are meant to be born fully resolved.
17006
17007         (EventExpr.Define): Revert code I wrote earlier.
17008                 
17009         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17010         instance expression is null. The instance expression is a This in that case
17011         or a null, depending on whether it is a static method or not.
17012
17013         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17014         refers to more than one method.
17015
17016         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17017         and accordingly flag errors.
17018
17019 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17020
17021         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17022
17023 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17024
17025         * location.cs (ToString): Provide useful rutine.
17026
17027 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17028
17029         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17030         objects, return the actual integral boxed.
17031
17032         * statement.cs (SwitchLabel): define an ILLabel for each
17033         SwitchLabel. 
17034
17035         (Switch.CheckSwitch): If the value is a Literal, extract
17036         the underlying literal.
17037
17038         Also in the unused hashtable we had, add the SwitchLabel so we can
17039         quickly look this value up.
17040
17041         * constant.cs: Implement a bunch of new constants.  Rewrite
17042         Literal based on this.  Made changes everywhere to adapt to this.
17043
17044         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17045         dereferencing array only once, and also copes with enumrations.
17046
17047         bytes are two bytes wide, not one.
17048
17049         (Cast): Perform constant conversions.
17050
17051         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17052         wrappers to the literals here.
17053
17054         * expression.cs (DoNumericPromotions): long literals can converted
17055         to ulong implicity (this is taken care of elsewhere, but I was
17056         missing this spot).
17057
17058         * ecore.cs (Expression.Literalize): Make the return type Literal,
17059         to improve type checking.
17060
17061         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17062
17063 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17064
17065         * literal.cs: Revert code from ravi that checked the bounds.  The
17066         bounds are sane by the definition of the type itself. 
17067
17068         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17069         need to actually look up in our parent hierarchy for interfaces
17070         implemented. 
17071
17072         * const.cs: Use the underlying type for enumerations
17073
17074         * delegate.cs: Compute the basename for the delegate creation,
17075         that should fix the delegate test case, and restore the correct
17076         Type Lookup semantics in rootcontext
17077
17078         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17079         referencing a nested type with the Reflection API is using the "+"
17080         sign. 
17081
17082         * cs-parser.jay: Do not require EOF token at the end.
17083
17084 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17085
17086         * rootcontext.cs (LookupType): Concatenate type names with
17087         a '.' instead of a '+' The test suite passes again.
17088
17089         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17090         field of the enumeration.
17091
17092         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17093         the case when the member is an EventExpr.
17094
17095         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17096         static has an associated instance expression.
17097
17098         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17099
17100         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17101
17102         * class.cs (Event.Define): Register event and perform appropriate checks
17103         for error #111.
17104
17105         We define the Add and Remove methods even if the use provides none because
17106         in that case, we provide default implementations ourselves.
17107
17108         Define a private field of the type of the event. This is done by the CSC compiler
17109         and we should be doing it too ;-)
17110
17111         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17112         More methods we use in code we generate.
17113
17114         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17115         is important.
17116
17117         (InitCoreTypes): Update accordingly for the above.
17118
17119         * class.cs (Event.Emit): Generate code for default accessors that we provide
17120
17121         (EmitDefaultMethod): Do the job in the above.
17122
17123         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17124         appropriate place.
17125
17126 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17127
17128         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17129         builders even if we were missing one.
17130
17131         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17132         pass the Basename as our class name instead of the Name.  The
17133         basename will be correctly composed for us.
17134
17135         * parameter.cs (Paramters): Now takes a Location argument.
17136
17137         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17138         make all the code call directly LookupType in RootContext and take
17139         this chance to pass the Location information everywhere.
17140
17141         * Everywhere: pass Location information.
17142
17143 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17144
17145         * class.cs (Constructor.Define): Updated way of detecting the
17146         length of the parameters.
17147
17148         (TypeContainer.DefineType): Use basename as the type name for
17149         nested types.
17150
17151         (TypeContainer.Define): Do not recursively define types here, as
17152         definition is taken care in order by the RootContext.
17153
17154         * tree.cs: Keep track of namespaces in a per-file basis.
17155
17156         * parameter.cs (Parameter.ComputeSignature): Update to use
17157         DeclSpace. 
17158
17159         (Parameters.GetSignature): ditto.
17160
17161         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17162         instead of a TypeContainer.
17163
17164         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17165         resolve names.  Because we need to be resolve in our context, not
17166         our parents.
17167
17168         * driver.cs: Implement response files.
17169
17170         * class.cs (TypeContainer.DefineType): If we are defined, do not
17171         redefine ourselves.
17172
17173         (Event.Emit): Emit the code for add/remove handlers.
17174         (Event.Define): Save the MethodBuilders for add/remove.
17175
17176         * typemanager.cs: Use pair here too.
17177
17178         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17179         DictionaryEntry requires the first argument to be non-null.  
17180
17181         (enum_declaration): Compute full name for registering the
17182         enumeration.
17183
17184         (delegate_declaration): Instead of using
17185         formal_parameter_list, use opt_formal_parameter_list as the list
17186         can be empty.
17187
17188         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17189         (EventParsing): New property that controls whether `add' and
17190         `remove' are returned as tokens or identifiers (for events);
17191
17192 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17193
17194         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17195         use MyEventBuilder only and let it wrap the real builder for us.
17196
17197         (MyEventBuilder): Revamp constructor etc.
17198
17199         Implement all operations that we perform on EventBuilder in precisely the same
17200         way here too.
17201
17202         (FindMembers): Update to use the EventBuilder member.
17203
17204         (Event.Emit): Update accordingly.
17205
17206 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17207
17208         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17209         by calling the appropriate methods.
17210
17211         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17212         useful.
17213
17214         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17215
17216 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17217
17218         * delegate.cs (Delegate.Populate): Check that the return type
17219         and various parameters types are indeed accessible.
17220
17221         * class.cs (Constructor.Define): Same here.
17222
17223         (Field.Define): Ditto.
17224
17225         (Event.Define): Ditto.
17226
17227         (Operator.Define): Check that the underlying Method defined itself
17228         correctly - so it's MethodBuilder should not be null.
17229
17230         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17231         expression happens to be null.
17232
17233         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17234         members but as of now we don't seem to be able to do anything really useful with it.
17235
17236         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17237         not the EventBuilder.
17238
17239 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17240
17241         * cs-tokenizer.cs: Add support for defines.
17242         Add support for #if, #elif, #else, #endif
17243
17244         (eval_var): evaluates a variable.
17245         (eval): stubbed for evaluating functions.
17246
17247         * cs-parser.jay: Pass the defines information
17248
17249         * driver.cs: Add --define command line option.
17250
17251         * decl.cs: Move MemberCore here.
17252
17253         Make it the base class for DeclSpace.  This allows us to catch and
17254         report 108 and 109 for everything now.
17255
17256         * class.cs (TypeContainer.Define): Extract all the members
17257         before populating and emit the warning 108 (new keyword required
17258         to override) instead of having each member implement this.
17259
17260         (MemberCore.Define): New abstract method, we will be using this in
17261         the warning reporting engine in Populate.
17262
17263         (Operator.Define): Adjust to new MemberCore protocol. 
17264
17265         * const.cs (Const): This does not derive from Expression, it is a
17266         temporary object we use to create fields, it is a MemberCore. 
17267
17268         * class.cs (Method.Define): Allow the entry point to be in a
17269         specific class.
17270
17271         * driver.cs: Rewrite the argument handler to clean it up a bit.
17272
17273         * rootcontext.cs: Made it just an auxiliary namespace feature by
17274         making everything static.
17275
17276         * driver.cs: Adapt code to use RootContext type name instead of
17277         instance variable.
17278
17279         * delegate.cs: Remove RootContext argument.
17280
17281         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17282         argument. 
17283
17284         * class.cs (Event.Define): The lookup can fail.
17285
17286         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17287
17288         * expression.cs: Resolve the this instance before invoking the code.
17289
17290 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17291
17292         * cs-parser.jay: Add a production in element_access that allows
17293         the thing to become a "type" reference.  This way we can parse
17294         things like "(string [])" as a type.
17295
17296         Note that this still does not handle the more complex rules of
17297         casts. 
17298
17299
17300         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17301
17302         * ecore.cs: (CopyNewMethods): new utility function used to
17303         assemble the list of methods from running FindMembers.
17304
17305         (MemberLookup): Rework FindMembers so that 
17306
17307 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17308
17309         * class.cs (TypeContainer): Remove Delegates who fail to be
17310         defined.
17311
17312         * delegate.cs (Populate): Verify that we dont get null return
17313         values.   TODO: Check for AsAccessible.
17314
17315         * cs-parser.jay: Use basename to emit error 574 (destructor should
17316         have the same name as container class), not the full name.
17317
17318         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17319         possible representation.  
17320
17321         Also implements integer type suffixes U and L.
17322
17323 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17324
17325         * expression.cs (ArrayCreation.DoResolve): We need to do the
17326         argument resolution *always*.
17327
17328         * decl.cs: Make this hold the namespace.  Hold the root context as
17329         well.
17330         (LookupType): Move here.
17331
17332         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17333
17334         * location.cs (Row, Name): Fixed the code, it was always returning
17335         references to the first file.
17336
17337         * interface.cs: Register properties defined through interfaces.
17338
17339         * driver.cs: Add support for globbing on the command line
17340
17341         * class.cs (Field): Make it derive from MemberCore as well.
17342         (Event): ditto.
17343
17344 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17345
17346         * class.cs (Event::Define): Check that the type of the event is a delegate
17347         type else flag error #66.
17348
17349         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17350         same.
17351
17352         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17353         values of EntryPoint, CharSet etc etc.
17354
17355         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17356
17357         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17358         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17359         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17360         which needs this to do its work.
17361
17362         * ../errors/cs0066.cs : Add.
17363
17364 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17365
17366         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17367         helper functions.
17368
17369         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17370         clears out the parameters field.
17371         (MemberSignatureCompare): Cleanup
17372
17373         (MemberCore): New base class used to share code between MethodCore
17374         and Property.
17375
17376         (RegisterRequiredImplementations) BindingFlags.Public requires
17377         either BindingFlags.Instace or Static.  Use instance here.
17378
17379         (Property): Refactored code to cope better with the full spec.
17380
17381         * parameter.cs (GetParameterInfo): Return an empty array instead
17382         of null on error.
17383
17384         * class.cs (Property): Abstract or extern properties have no bodies.
17385
17386         * parameter.cs (GetParameterInfo): return a zero-sized array.
17387
17388         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17389         method modifier validation to the typecontainer so we can reuse
17390         this on properties.
17391
17392         (MethodCore.ParameterTypes): return an empty sized array of types.
17393
17394         (Property.Define): Test property modifier validity.
17395
17396         Add tests for sealed/override too.
17397
17398         (Method.Emit): abstract or extern methods have no bodies.
17399
17400 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17401
17402         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17403         thing.
17404
17405         (Method::Define, ::Emit): Modify accordingly.
17406
17407         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17408
17409         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17410
17411         * makefile: Pass in /unsafe.
17412
17413 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17414
17415         * class.cs (MakeKey): Kill routine.
17416
17417         * class.cs (TypeContainer.Define): Correctly define explicit
17418         method implementations (they require the full interface name plus
17419         the method name).
17420
17421         * typemanager.cs: Deply the PtrHashtable here and stop using the
17422         lame keys.  Things work so much better.
17423
17424         This of course broke everyone who depended on `RegisterMethod' to
17425         do the `test for existance' test.  This has to be done elsewhere.
17426
17427         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17428         the object stupid Equals method (because, that like fails all over
17429         the place).  We still do not use it.
17430
17431         * class.cs (TypeContainer.SetRequiredInterface,
17432         TypeContainer.RequireMethods): Killed these two routines and moved
17433         all the functionality to RegisterRequiredImplementations.
17434
17435         (TypeContainer.RegisterRequiredImplementations): This routine now
17436         registers all the implementations required in an array for the
17437         interfaces and abstract methods.  We use an array of structures
17438         which can be computed ahead of time to reduce memory usage and we
17439         also assume that lookups are cheap as most classes will not
17440         implement too many interfaces.
17441
17442         We also avoid creating too many MethodSignatures.
17443
17444         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17445         clear the "pending" bit if we find that there are problems with
17446         the declaration.
17447
17448         (TypeContainer.VerifyPendingMethods): Update to report errors of
17449         methods that look like implementations but are not.
17450
17451         (TypeContainer.Define): Add support for explicit interface method
17452         implementation. 
17453
17454 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17455
17456         * typemanager.cs: Keep track of the parameters here instead of
17457         being a feature of the TypeContainer.
17458
17459         * class.cs: Drop the registration of parameters here, as
17460         InterfaceMethods are also interface declarations.
17461
17462         * delegate.cs: Register methods with the TypeManager not only with
17463         the TypeContainer.  This code was buggy.
17464
17465         * interface.cs: Full registation here.
17466
17467 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17468
17469         * expression.cs: Remove reducer for binary expressions, it can not
17470         be done this way.
17471
17472         * const.cs: Put here the code that used to go into constant.cs
17473
17474         * constant.cs: Put here the code for constants, this is a new base
17475         class for Literals.
17476
17477         * literal.cs: Make Literal derive from Constant.
17478
17479 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17480
17481         * statement.cs (Return.Emit): Report error 157 if the user
17482         attempts to return from a finally block.
17483
17484         (Return.Emit): Instead of emitting a return, jump to the end of
17485         the function.
17486
17487         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17488         LocalBuilder to store the result of the function.  ReturnLabel is
17489         the target where we jump.
17490
17491
17492 2001-12-09  Radek Doulik  <rodo@ximian.com>
17493
17494         * cs-parser.jay: remember alias in current namespace
17495
17496         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17497         namespaces
17498
17499         * class.cs (LookupAlias): lookup alias in my_namespace
17500
17501         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17502         aliases hashtable
17503         (LookupAlias): lookup alias in this and if needed in parent
17504         namespaces
17505
17506 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17507
17508         * support.cs: 
17509
17510         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17511         making things static.  I need this to avoid passing the
17512         TypeContainer when calling ParameterType.
17513
17514         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17515         that did string manipulation to compute the type and then call
17516         GetType.  Use Parameter.ParameterType instead.
17517
17518         * cs-tokenizer.cs: Consume the suffix for floating values.
17519
17520         * expression.cs (ParameterReference): figure out whether this is a
17521         reference parameter or not.  Kill an extra variable by computing
17522         the arg_idx during emission.
17523
17524         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17525         function that returns whether a parameter is an out/ref value or not.
17526
17527         (Parameter.ParameterType): The type of the parameter (base,
17528         without ref/out applied).
17529
17530         (Parameter.Resolve): Perform resolution here.
17531         (Parameter.ExternalType): The full type (with ref/out applied).
17532
17533         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17534         support for expressions on the using statement.
17535
17536 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17537
17538         * statement.cs (Using.EmitLocalVariableDecls): Split the
17539         localvariable handling of the using statement.
17540
17541         (Block.EmitMeta): Keep track of variable count across blocks.  We
17542         were reusing slots on separate branches of blocks.
17543
17544         (Try.Emit): Emit the general code block, we were not emitting it. 
17545
17546         Check the type of the declaration to be an IDisposable or
17547         something that can be implicity converted to it. 
17548
17549         Emit conversions if required.
17550
17551         * ecore.cs (EmptyExpression): New utility class.
17552         (Expression.ImplicitConversionExists): New utility function.
17553
17554 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17555
17556         * statement.cs (Using): Implement.
17557
17558         * expression.cs (LocalVariableReference): Support read only variables.
17559
17560         * statement.cs: Remove the explicit emit for the Leave opcode.
17561         (VariableInfo): Add a readonly field.
17562
17563 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17564
17565         * ecore.cs (ConvCast): new class used to encapsulate the various
17566         explicit integer conversions that works in both checked and
17567         unchecked contexts.
17568
17569         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17570         properly generate the overflow opcodes.
17571
17572 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17573
17574         * statement.cs: The correct type for the EmptyExpression is the
17575         element_type, not the variable type.  Ravi pointed this out.
17576
17577 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17578
17579         * class.cs (Method::Define): Handle PInvoke methods specially
17580         by using DefinePInvokeMethod instead of the usual one.
17581
17582         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17583         above to do the task of extracting information and defining the method.
17584
17585 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17586
17587         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17588         of the condition for string type.
17589
17590         (Emit): Move that here. 
17591
17592         (ArrayCreation::CheckIndices): Keep string literals in their expression
17593         form.
17594
17595         (EmitDynamicInitializers): Handle strings appropriately.
17596
17597 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17598
17599         * codegen.cs (EmitContext): Replace multiple variables with a
17600         single pointer to the current Switch statement.
17601
17602         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17603         EmitContext.
17604
17605 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17606
17607         * statement.cs 
17608
17609         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17610         default'.
17611
17612         (Foreach.Emit): Foreach on arrays was not setting
17613         up the loop variables (for break/continue).
17614
17615         (GotoCase): Semi-implented.
17616
17617 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17618
17619         * attribute.cs (CheckAttribute): Handle system attributes by using
17620         Attribute.GetAttributes to examine information we need.
17621
17622         (GetValidPlaces): Same here.
17623
17624         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17625
17626         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17627
17628         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17629
17630         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17631
17632         (Method::Emit): Handle the case when we are a PInvoke method.
17633
17634 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17635
17636         * expression.cs: Use ResolveWithSimpleName on compound names.
17637
17638 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17639
17640         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17641         before trying to reduce it.
17642
17643         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17644
17645         * constant.cs (LookupConstantValue): Implement.
17646
17647         (EmitConstant): Use the above in emitting the constant.
17648
17649         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17650         that are user-defined by doing a LookupConstantValue on them.
17651
17652         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17653         too, like above.
17654
17655 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17658
17659         (BaseAccess.DoResolve): Implement.
17660
17661         (MemberAccess.DoResolve): Split this routine into a
17662         ResolveMemberAccess routine that can be used independently
17663
17664 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17665
17666         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17667         As that share bits of the implementation.  Is returns a boolean,
17668         while As returns the Type that is being probed.
17669
17670 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17671
17672         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17673         instead of a Literal - much easier.
17674
17675         (EnumInTransit): Remove - utterly useless :-)
17676
17677         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17678
17679         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17680
17681         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17682         chain when we have no associated expression.
17683
17684 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17685
17686         * constant.cs (Define): Use Location while reporting the errror.
17687
17688         Also emit a warning when 'new' is used and there is no inherited
17689         member to hide.
17690
17691         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17692         populated.
17693
17694         (LookupEnumValue): Implement to lookup an enum member's value and define it
17695         if necessary.
17696
17697         (Populate): Re-write accordingly to use the above routine.
17698
17699 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17700
17701         * expression.cs (This): Fix prototype for DoResolveLValue to
17702         override the base class DoResolveLValue.
17703
17704         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17705         declarations) 
17706
17707         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17708         (we need to load the address of the field here).  This fixes
17709         test-22. 
17710
17711         (FieldExpr.DoResolveLValue): Call the DoResolve
17712         function to initialize the Instance expression.
17713
17714         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17715         correctly the GetEnumerator operation on a value type.
17716
17717         * cs-parser.jay: Add more simple parsing error catches.
17718
17719         * statement.cs (Switch): Add support for string switches.
17720         Handle null specially.
17721
17722         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17723
17724 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17725
17726         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17727
17728         (declare_local_constant): New helper function.
17729
17730         * statement.cs (AddConstant): Keep a separate record of constants
17731
17732         (IsConstant): Implement to determine if a variable is a constant.
17733
17734         (GetConstantExpression): Implement.
17735
17736         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17737
17738         * statement.cs (IsVariableDefined): Re-write.
17739
17740 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17741
17742         * class.cs (TypeContainer::FindMembers): Look for constants
17743         in the case when we are looking for MemberTypes.Field
17744
17745         * expression.cs (MemberAccess::DoResolve): Check that in the
17746         case we are a FieldExpr and a Literal, we are not being accessed
17747         by an instance reference.
17748
17749         * cs-parser.jay (local_constant_declaration): Implement.
17750
17751         (declaration_statement): Implement for constant declarations.
17752
17753 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17754
17755         * statement.cs (Switch): Catch double defaults.
17756
17757         (Switch): More work on the switch() statement
17758         implementation.  It works for integral values now, need to finish
17759         string support.
17760
17761
17762 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17763
17764         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17765         integer literals into other integer literals.  To be used by
17766         switch. 
17767
17768 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17769
17770         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17771         some memory.
17772
17773         (EmitDynamicInitializers): Cope with the above since we extract data
17774         directly from ArrayData now.
17775
17776         (ExpectInitializers): Keep track of whether initializers are mandatory
17777         or not.
17778
17779         (Bounds): Make it a hashtable to prevent the same dimension being 
17780         recorded for every element in that dimension.
17781
17782         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17783         from being found.
17784
17785         Also fix bug which was causing the indices to be emitted in the reverse
17786         order.
17787
17788 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17789
17790         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17791         unfinished.  They do not work, because the underlying code is
17792         sloppy.
17793
17794 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17795
17796         * cs-parser.jay: Remove bogus fixme.
17797
17798         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17799         on Switch statement.
17800
17801 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17802
17803         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17804         the same. 
17805
17806         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17807         parameter. Apparently, any expression is allowed. 
17808
17809         (ValidateInitializers): Update accordingly.
17810
17811         (CheckIndices): Fix some tricky bugs thanks to recursion.
17812
17813         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17814         I was being completely brain-dead.
17815
17816         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17817         and re-write acordingly.
17818
17819         (DelegateInvocation): Re-write accordingly.
17820
17821         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17822
17823         (MakeByteBlob): Handle types more correctly.
17824
17825         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17826         initialization from expressions but it is incomplete because I am a complete
17827         Dodo :-|
17828
17829 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17830
17831         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17832         on If.  Basically, we have to return `true' (ie, we do return to
17833         our caller) only if both branches of the if return.
17834
17835         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17836         short-circuit operators, handle them as short circuit operators. 
17837
17838         (Cast.DoResolve): Resolve type.
17839         (Cast.Cast): Take an expression as the target type.
17840
17841         * cs-parser.jay (cast_expression): Remove old hack that only
17842         allowed a limited set of types to be handled.  Now we take a
17843         unary_expression and we resolve to a type during semantic
17844         analysis.
17845
17846         Use the grammar productions from Rhys to handle casts (this is
17847         not complete like Rhys syntax yet, we fail to handle that corner
17848         case that C# has regarding (-x), but we will get there.
17849
17850 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17851
17852         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17853         field which is an array type.
17854
17855         * cs-parser.jay (declare_local_variables): Support array initialization too.
17856
17857         * typemanager.cs (MakeKey): Implement.
17858
17859         (everywhere): Use the above appropriately.
17860
17861         * cs-parser.jay (for_statement): Update for array initialization while
17862         declaring variables.
17863
17864         * ecore.cs : The error message was correct, it's the variable's names that
17865         were misleading ;-) Make the code more readable.
17866
17867         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17868         the correct type etc.
17869
17870         (ConvertExplicit): Handle Enum types by examining the underlying type.
17871
17872 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17873
17874         * parameter.cs (GetCallingConvention): Always return
17875         CallingConventions.Standard for now.
17876
17877 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17878
17879         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17880         and `r' after calling DoNumericPromotions.
17881
17882         * ecore.cs: Fix error message (the types were in the wrong order).
17883
17884         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17885         BindingFlags.Instance as well 
17886
17887         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17888         implicit int literal conversion in an empty cast so that we
17889         propagate the right type upstream.
17890
17891         (UnboxCast): new class used to unbox value types.
17892         (Expression.ConvertExplicit): Add explicit type conversions done
17893         by unboxing.
17894
17895         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17896         the target type before applying the implicit LongLiterals to ULong
17897         literal cast.
17898
17899 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17900
17901         * cs-parser.jay (for_statement): Reworked the way For works: now
17902         we declare manually any variables that are introduced in
17903         for_initializer to solve the problem of having out-of-band code
17904         emition (that is what got for broken).
17905
17906         (declaration_statement): Perform the actual variable declaration
17907         that used to be done in local_variable_declaration here.
17908
17909         (local_variable_declaration): Do not declare anything, just pass
17910         the information on a DictionaryEntry
17911
17912 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17913
17914         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17915         re-write of the logic to now make it recursive.
17916
17917         (UpdateIndices): Re-write accordingly.
17918
17919         Store element data in a separate ArrayData list in the above methods.
17920
17921         (MakeByteBlob): Implement to dump the array data into a byte array.
17922
17923 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17924
17925         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17926         into CheckIndices.
17927
17928         * constant.cs (Define): Implement.
17929
17930         (EmitConstant): Re-write fully.
17931
17932         Pass in location info.
17933
17934         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17935         respectively.
17936
17937         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17938         DictionaryEntry since we need location info too.
17939
17940         (constant_declaration): Update accordingly.
17941
17942         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17943         code into another method : UpdateIndices.
17944
17945 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17946
17947         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17948         some type checking etc.
17949
17950 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17951
17952         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17953         bits to provide dimension info if the user skips doing that.
17954
17955         Update second constructor to store the rank correctly.
17956
17957 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17958
17959         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17960         and try to implement.
17961
17962         * ../errors/cs0150.cs : Add.
17963
17964         * ../errors/cs0178.cs : Add.
17965
17966 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17967
17968         * statement.cs: Implement foreach on multi-dimensional arrays. 
17969
17970         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17971         name of the params argument.
17972
17973         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17974         initializing the array.
17975
17976         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17977         we can use this elsewhere.
17978
17979         * statement.cs: Finish implementation of foreach for single
17980         dimension arrays.
17981
17982         * cs-parser.jay: Use an out-of-band stack to pass information
17983         around, I wonder why I need this.
17984
17985         foreach_block: Make the new foreach_block the current_block.
17986
17987         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17988         function used to return a static Parameters structure.  Used for
17989         empty parameters, as those are created very frequently.
17990
17991         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17992
17993 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17994
17995         * interface.cs : Default modifier is private, not public. The
17996         make verify test passes again.
17997
17998 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17999
18000         * support.cs (ReflectionParameters): Fix logic to determine
18001         whether the last parameter is a params one. Test 9 passes again.
18002
18003         * delegate.cs (Populate): Register the builders we define with
18004         RegisterParameterForBuilder. Test 19 passes again.
18005
18006         * cs-parser.jay (property_declaration): Reference $6 instead
18007         of $$ to get at the location.
18008
18009         (indexer_declaration): Similar stuff.
18010
18011         (attribute): Ditto.
18012
18013         * class.cs (Property): Register parameters for the Get and Set methods
18014         if they exist. Test 23 passes again.
18015
18016         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18017         call to EmitArguments as we are sure there aren't any params arguments. 
18018         Test 32 passes again.
18019
18020         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18021         IndexOutOfRangeException. 
18022
18023         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18024         Test 33 now passes again.
18025
18026 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18027
18028         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18029         broke a bunch of things.  Will have to come up with a better way
18030         of tracking locations.
18031
18032         * statement.cs: Implemented foreach for single dimension arrays.
18033
18034 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18035
18036         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18037         an error.  This removes the lookup from the critical path.
18038
18039         * cs-parser.jay: Removed use of temporary_loc, which is completely
18040         broken. 
18041
18042 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18043
18044         * support.cs (ReflectionParameters.ParameterModifier): Report
18045         whether the argument is a PARAMS argument or not.
18046
18047         * class.cs: Set the attribute `ParamArrayAttribute' on the
18048         parameter argument.
18049
18050         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18051         and cons_param_array_attribute (ConstructorInfo for
18052         ParamArrayAttribute)., 
18053
18054         * codegen.cs: Emit the return using the `Return' statement, that
18055         way we can report the error correctly for missing return values. 
18056
18057         * class.cs (Method.Emit): Clean up.
18058
18059         * expression.cs (Argument.Resolve): Take another argument: the
18060         location where this argument is used.  Notice that this is not
18061         part of the "Argument" class as to reduce the size of the
18062         structure (we know the approximate location anyways).
18063
18064         Test if the argument is a variable-reference, if not, then
18065         complain with a 206.
18066
18067         (Argument.Emit): Emit addresses of variables.
18068
18069         (Argument.FullDesc): Simplify.
18070
18071         (Invocation.DoResolve): Update for Argument.Resolve.
18072
18073         (ElementAccess.DoResolve): ditto.
18074
18075         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18076         method should be virtual, as this method is always virtual.
18077
18078         (NewDelegate.DoResolve): Update for Argument.Resolve.
18079
18080         * class.cs (ConstructorInitializer.DoResolve): ditto.
18081
18082         * attribute.cs (Attribute.Resolve): ditto.
18083
18084 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18085
18086         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18087
18088         * expression.cs (ParameterReference): Drop IStackStorage and implement
18089         IAssignMethod instead. 
18090
18091         (LocalVariableReference): ditto.
18092
18093         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18094         IAssignMethod instead. 
18095
18096 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18097
18098         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18099         enumerations that are used in heavily used structures derive from
18100         byte in a laughable and pathetic attempt to reduce memory usage.
18101         This is the kind of pre-optimzations that you should not do at
18102         home without adult supervision.
18103
18104         * expression.cs (UnaryMutator): New class, used to handle ++ and
18105         -- separatedly from the other unary operators.  Cleans up the
18106         code, and kills the ExpressionStatement dependency in Unary.
18107
18108         (Unary): Removed `method' and `Arguments' from this class, making
18109         it smaller, and moving it all to SimpleCall, so I can reuse this
18110         code in other locations and avoid creating a lot of transient data
18111         strucutres when not required.
18112
18113         * cs-parser.jay: Adjust for new changes.
18114
18115 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18116
18117         * enum.cs (Enum.Populate): If there is a failure during
18118         definition, return
18119
18120         * cs-parser.jay (opt_enum_base): we used to catch type errors
18121         here, but this is really incorrect.  The type error should be
18122         catched during semantic analysis.
18123
18124 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18125
18126         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18127         current_local_parameters as expected since I, in my stupidity, had forgotten
18128         to do this :-)
18129
18130         * attribute.cs (GetValidPlaces): Fix stupid bug.
18131
18132         * class.cs (Method::Emit): Perform check on applicability of attributes.
18133
18134         (Constructor::Emit): Ditto.
18135
18136         (Field::Emit): Ditto.
18137
18138         (Field.Location): Store location information.
18139
18140         (Property, Event, Indexer, Operator): Ditto.
18141
18142         * cs-parser.jay (field_declaration): Pass in location for each field.
18143
18144         * ../errors/cs0592.cs : Add.
18145
18146 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18147
18148         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18149
18150         (InitCoreTypes): Update accordingly.
18151
18152         (RegisterAttrType, LookupAttr): Implement.
18153
18154         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18155         info about the same.
18156
18157         (Resolve): Update to populate the above as necessary.
18158
18159         (Error592): Helper.
18160
18161         (GetValidPlaces): Helper to the above.
18162
18163         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18164
18165         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18166
18167 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18168
18169         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18170
18171         * ../errors/cs0617.cs : Add.
18172
18173 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18174
18175         * enum.cs (Emit): Rename to Populate to be more consistent with what
18176         we expect it to do and when exactly it is called.
18177
18178         * class.cs, rootcontext.cs : Update accordingly.
18179
18180         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18181         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18182
18183         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18184
18185         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18186         of a fieldinfo using the above, when dealing with a FieldBuilder.
18187
18188 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18189
18190         * ../errors/cs0031.cs : Add.
18191
18192         * ../errors/cs1008.cs : Add.
18193
18194         * ../errrors/cs0543.cs : Add.
18195
18196         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18197         enum type.
18198
18199         (FindMembers): Implement.
18200
18201         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18202         enums and delegates too.
18203
18204         (enum_types): Rename to builder_to_enum.
18205
18206         (delegate_types): Rename to builder_to_delegate.
18207
18208         * delegate.cs (FindMembers): Implement.
18209
18210 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18211
18212         * typemanager.cs (IsEnumType): Implement.
18213
18214         * enum.cs (Emit): Re-write parts to account for the underlying type
18215         better and perform checking etc.
18216
18217         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18218         of the underlying type.
18219
18220         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18221         value
18222
18223         * enum.cs (error31): Helper to report error #31.
18224
18225         * cs-parser.jay (enum_declaration): Store location of each member too.
18226
18227         * enum.cs (member_to_location): New hashtable. 
18228
18229         (AddEnumMember): Update location hashtable.
18230
18231         (Emit): Use the location of each member while reporting errors.
18232
18233 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18234
18235         * cs-parser.jay: A for_initializer if is a
18236         local_variable_declaration really ammount to have an implicit
18237         block with the variable declaration and no initializer for for.
18238
18239         * statement.cs (For.Emit): Cope with null initializers.
18240
18241         This fixes the infinite loop on for initializers.
18242
18243 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18244
18245         * enum.cs: More cleanup.
18246
18247         * ecore.cs: Remove dead code.
18248
18249         * class.cs (Property.Emit): More simplification.
18250         (Event.Emit): ditto.
18251
18252         Reworked to have less levels of indentation.
18253
18254 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18255
18256         * class.cs (Property): Emit attributes.
18257
18258         (Field): Ditto.
18259
18260         (Event): Ditto.
18261
18262         (Indexer): Ditto.
18263
18264         (Operator): Ditto.
18265
18266         * enum.cs (Emit): Ditto.
18267
18268         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18269         Enums too.
18270
18271         * class.cs (Field, Event, etc.): Move attribute generation into the
18272         Emit method everywhere.
18273
18274         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18275         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18276         as we had no way of defining nested enums !
18277
18278         * rootcontext.cs : Adjust code accordingly.
18279
18280         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18281
18282 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18283
18284         * expression.cs (EvalConstantExpression): Move into ecore.cs
18285
18286         * enum.cs (Enum): Rename some members and make them public and readonly
18287         according to our convention.
18288
18289         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18290         nothing else.
18291
18292         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18293
18294         (Enum::Emit): Write a simple version for now which doesn't try to compute
18295         expressions. I shall modify this to be more robust in just a while.
18296
18297         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18298
18299         (TypeContainer::CloseType): Create the Enum types too.
18300
18301         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18302
18303         * expression.cs (EvalConstantExpression): Get rid of completely.
18304
18305         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18306         user-defined values and other cases.
18307
18308         (IsValidEnumLiteral): Helper function.
18309
18310         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18311         out there in the case we had a literal FieldExpr.
18312
18313         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18314
18315         (Literalize): Revamp a bit to take two arguments.
18316
18317         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18318
18319 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18320
18321         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18322
18323         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18324
18325         (Resolve): Use the above to ensure we have proper initializers.
18326
18327 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18328
18329         * expression.cs (Expression::EvalConstantExpression): New method to 
18330         evaluate constant expressions.
18331
18332         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18333
18334 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18337         in an array.
18338
18339         (Binary.ResolveOperator): Handle operator != (object a, object b)
18340         and operator == (object a, object b);
18341
18342         (Binary.DoNumericPromotions): Indicate whether the numeric
18343         promotion was possible.
18344
18345         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18346         Implement.  
18347
18348         Made the ArrayAccess implement interface IAssignMethod instead of
18349         IStackStore as the order in which arguments are passed reflects
18350         this.
18351
18352         * assign.cs: Instead of using expr.ExprClass to select the way of
18353         assinging, probe for the IStackStore/IAssignMethod interfaces.
18354
18355         * typemanager.cs: Load InitializeArray definition.
18356
18357         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18358         static data that can be used to initialize arrays. 
18359
18360 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18361
18362         * expression.cs: Handle operator== and operator!= for booleans.
18363
18364         (Conditioal.Reduce): Implement reducer for the ?: operator.
18365
18366         (Conditional.Resolve): Implement dead code elimination.
18367
18368         (Binary.Resolve): Catch string literals and return a new
18369         concatenated string.
18370
18371         (Unary.Reduce): Implement reduction of unary expressions.
18372
18373         * ecore.cs: Split out the expression core handling here.
18374
18375         (Expression.Reduce): New method used to perform constant folding
18376         and CSE.  This is needed to support constant-expressions. 
18377
18378         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18379         targets, and optimize for !x.
18380
18381 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18382
18383         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18384         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18385         set custom atttributes.
18386
18387         * literal.cs (Literal::GetValue): New abstract method to return the actual
18388         value of the literal, cast as an object.
18389
18390         (*Literal): Implement GetValue method.
18391
18392         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18393         expressions to the arraylist but objects of type Argument.
18394
18395         * class.cs (TypeContainer::Emit): Emit our attributes too.
18396
18397         (Method::Emit, Constructor::Emit): Ditto.
18398
18399         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18400         to be ignoring earlier.
18401
18402 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18403
18404         * attribute.cs (AttributeSection::Define): Implement to do the business
18405         of constructing a CustomAttributeBuilder.
18406
18407         (Attribute): New trivial class. Increases readability of code.  
18408
18409         * cs-parser.jay : Update accordingly.
18410
18411         (positional_argument_list, named_argument_list, named_argument): New rules
18412
18413         (attribute_arguments): Use the above so that we are more correct.
18414
18415 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18416
18417         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18418         to perform all checks for a method with a params parameter.
18419
18420         (Invocation::OverloadResolve): Update to use the above method and therefore
18421         cope correctly with params method invocations.
18422
18423         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18424         params too.
18425
18426         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18427         constructors in our parent too because we can't afford to miss out on 
18428         protected ones ;-)
18429
18430         * attribute.cs (AttributeSection): New name for the class Attribute
18431
18432         Other trivial changes to improve readability.
18433
18434         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18435         use the new class names.
18436
18437 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18438
18439         * class.cs (Method::Define): Complete definition for params types too
18440
18441         (Indexer::Define): Ditto.
18442
18443         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18444         Cope everywhere with a request for info about the array parameter.
18445
18446 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18447
18448         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18449
18450         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18451         local_variable_type to extract the string corresponding to the type.
18452
18453         (local_variable_type): Fixup the action to use the new helper method.
18454
18455         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18456         go.
18457
18458         * expression.cs : Clean out code which uses the above.
18459
18460 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18461
18462         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18463         and bale out if necessary by returning a false.
18464
18465         (RegisterProperty): Ditto.
18466
18467         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18468         and print out appropriate error messages.
18469
18470         * interface.cs (everywhere): Ditto.
18471
18472         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18473         location to constructor.
18474
18475         * class.cs (Property, Event, Indexer): Update accordingly.
18476
18477         * ../errors/cs111.cs : Added.
18478
18479         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18480         of a method, as laid down by the spec.
18481
18482         (Invocation::OverloadResolve): Use the above method.
18483
18484 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18485
18486         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18487         now take a TypeContainer and a Parameters object.
18488
18489         (ParameterData): Modify return type of ParameterModifier method to be 
18490         Parameter.Modifier and not a string.
18491
18492         (ReflectionParameters, InternalParameters): Update accordingly.
18493
18494         * expression.cs (Argument::GetParameterModifier): Same here.
18495
18496         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18497         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18498         symbol in it at all so maybe this is only for now.
18499
18500 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18501
18502         * support.cs (InternalParameters): Constructor now takes an extra argument 
18503         which is the actual Parameters class.
18504
18505         (ParameterDesc): Update to provide info on ref/out modifiers.
18506
18507         * class.cs (everywhere): Update call to InternalParameters to pass in
18508         the second argument too.
18509
18510         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18511         to return the modifier info [ref/out etc]
18512
18513         (InternalParameters, ReflectionParameters): Implement the above.
18514
18515         * expression.cs (Argument::ParameterModifier): Similar function to return
18516         info about the argument's modifiers.
18517
18518         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18519         too.
18520
18521         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18522         a new SetFormalParameters object which we pass to InternalParameters.
18523
18524 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18525
18526         * expression.cs (NewArray): Merge into the ArrayCreation class.
18527
18528 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18529
18530         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18531         NewUserdefinedArray into one as there wasn't much of a use in having
18532         two separate ones.
18533
18534         * expression.cs (Argument): Change field's name to ArgType from Type.
18535
18536         (Type): New readonly property which returns the proper type, taking into 
18537         account ref/out modifiers.
18538
18539         (everywhere): Adjust code accordingly for the above.
18540
18541         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18542         whether we are emitting for a ref or out parameter.
18543
18544         * expression.cs (Argument::Emit): Use the above field to set the state.
18545
18546         (LocalVariableReference::Emit): Update to honour the flag and emit the
18547         right stuff.
18548
18549         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18550
18551         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18552
18553         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18554
18555         (ReflectionParameters, InternalParameters): Implement the above method.
18556
18557         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18558         reporting errors.
18559
18560         (Invocation::FullMethodDesc): Ditto. 
18561
18562 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18563
18564         * cs-parser.jay: Add extra production for the second form of array
18565         creation. 
18566
18567         * expression.cs (ArrayCreation): Update to reflect the above
18568         change. 
18569
18570         * Small changes to prepare for Array initialization.
18571
18572 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18573
18574         * typemanager.cs (ImplementsInterface): interface might be null;
18575         Deal with this problem;
18576
18577         Also, we do store negative hits on the cache (null values), so use
18578         this instead of calling t.GetInterfaces on the type everytime.
18579
18580 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18581
18582         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18583
18584         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18585         split functionality out into different classes.
18586
18587         (New::FormArrayType): Move into NewBuiltinArray.
18588
18589         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18590         quite useless.
18591
18592         (NewBuiltinArray): New class to handle creation of built-in arrays.
18593
18594         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18595         account creation of one-dimensional arrays.
18596
18597         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18598
18599         (NewUserdefinedArray::DoResolve): Implement.
18600
18601         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18602
18603         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18604         we maintain inside the TypeManager. This is necessary to perform lookups on the
18605         module builder.
18606
18607         (LookupType): Update to perform GetType on the module builders too.     
18608
18609         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18610
18611         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18612
18613 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18614
18615         * expression.cs (New::DoResolve): Implement guts of array creation.
18616
18617         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18618
18619 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18620
18621         * expression.cs: Fix bug I introduced lsat night that broke
18622         Delegates. 
18623
18624         (Expression.Resolve): Report a 246 error (can not resolve name)
18625         if we find a SimpleName in the stream.
18626
18627         (Expression.ResolveLValue): Ditto.
18628
18629         (Expression.ResolveWithSimpleName): This function is a variant of
18630         ResolveName, this one allows SimpleNames to be returned without a
18631         warning.  The only consumer of SimpleNames is MemberAccess
18632
18633 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18634
18635         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18636         might arrive here.  I have my doubts that this is correct.
18637
18638         * statement.cs (Lock): Implement lock statement.
18639
18640         * cs-parser.jay: Small fixes to support `lock' and `using'
18641
18642         * cs-tokenizer.cs: Remove extra space
18643
18644         * driver.cs: New flag --checked, allows to turn on integer math
18645         checking. 
18646
18647         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18648         Threading.Monitor.Exit 
18649
18650 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18651
18652         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18653         Expression Class to be IndexerAccess.
18654
18655         Notice that Indexer::DoResolve sets the eclass to Value.
18656
18657 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18658
18659         * class.cs (TypeContainer::Emit): Emit code for indexers.
18660
18661         * assign.cs (IAssignMethod): New interface implemented by Indexers
18662         and Properties for handling assignment.
18663
18664         (Assign::Emit): Simplify and reuse code. 
18665
18666         * expression.cs (IndexerAccess, PropertyExpr): Implement
18667         IAssignMethod, clean up old code. 
18668
18669 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18670
18671         * typemanager.cs (ImplementsInterface): New method to determine if a type
18672         implements a given interface. Provides a nice cache too.
18673
18674         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18675         method.
18676
18677         (ConvertReferenceExplicit): Ditto.
18678
18679         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18680         various methods, with correct names etc.
18681
18682         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18683         Operator.UnaryNegation.
18684
18685         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18686         we have a unary plus or minus operator.
18687
18688         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18689         UnaryMinus.
18690
18691         * everywhere : update accordingly.
18692
18693         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18694         respectively.
18695
18696         * class.cs (Method::Define): For the case where we are implementing a method
18697         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18698         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18699
18700 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18701
18702         * interface.cs (FindMembers): Implement to work around S.R.E
18703         lameness.
18704
18705         * typemanager.cs (IsInterfaceType): Implement.
18706
18707         (FindMembers): Update to handle interface types too.
18708
18709         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18710         use IsAssignableFrom as that is not correct - it doesn't work.
18711
18712         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18713         and accordingly override EmitStatement.
18714
18715         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18716         using the correct logic :-)
18717
18718 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18719
18720         * ../errors/cs-11.cs : Add to demonstrate error -11 
18721
18722 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18723
18724         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18725         then pass this as a hint to ResolveLValue.
18726
18727         * expression.cs (FieldExpr): Add Location information
18728
18729         (FieldExpr::LValueResolve): Report assignment to readonly
18730         variable. 
18731
18732         (Expression::ExprClassFromMemberInfo): Pass location information.
18733
18734         (Expression::ResolveLValue): Add new method that resolves an
18735         LValue. 
18736
18737         (Expression::DoResolveLValue): Default invocation calls
18738         DoResolve. 
18739
18740         (Indexers): New class used to keep track of indexers in a given
18741         Type. 
18742
18743         (IStackStore): Renamed from LValue, as it did not really describe
18744         what this did.  Also ResolveLValue is gone from this interface and
18745         now is part of Expression.
18746
18747         (ElementAccess): Depending on the element access type
18748
18749         * typemanager.cs: Add `indexer_name_type' as a Core type
18750         (System.Runtime.CompilerServices.IndexerNameAttribute)
18751
18752         * statement.cs (Goto): Take a location.
18753
18754 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18755
18756         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18757         if two delegates are compatible.
18758
18759         (NewDelegate::DoResolve): Update to take care of the case when
18760         we instantiate a delegate from another delegate.
18761
18762         * typemanager.cs (FindMembers): Don't even try to look up members
18763         of Delegate types for now.
18764
18765 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18766
18767         * delegate.cs (NewDelegate): New class to take care of delegate
18768         instantiation.
18769
18770         * expression.cs (New): Split the delegate related code out into 
18771         the NewDelegate class.
18772
18773         * delegate.cs (DelegateInvocation): New class to handle delegate 
18774         invocation.
18775
18776         * expression.cs (Invocation): Split out delegate related code into
18777         the DelegateInvocation class.
18778
18779 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18780
18781         * expression.cs (New::DoResolve): Implement delegate creation fully
18782         and according to the spec.
18783
18784         (New::DoEmit): Update to handle delegates differently.
18785
18786         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18787         because of which we were printing out arguments in reverse order !
18788
18789         * delegate.cs (VerifyMethod): Implement to check if the given method
18790         matches the delegate.
18791
18792         (FullDelegateDesc): Implement.
18793
18794         (VerifyApplicability): Implement.
18795
18796         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18797         delegate invocations too.
18798
18799         (Invocation::Emit): Ditto.
18800
18801         * ../errors/cs1593.cs : Added.
18802
18803         * ../errors/cs1594.cs : Added.
18804
18805         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18806
18807 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18808
18809         * typemanager.cs (intptr_type): Core type for System.IntPtr
18810
18811         (InitCoreTypes): Update for the same.
18812
18813         (iasyncresult_type, asynccallback_type): Ditto.
18814
18815         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18816         correct.
18817
18818         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18819         too.
18820
18821         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18822         the builders for the 4 members of a delegate type :-)
18823
18824         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18825         type.
18826
18827         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18828
18829         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18830
18831 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18832
18833         * statement.cs (Break::Emit): Implement.   
18834         (Continue::Emit): Implement.
18835
18836         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18837         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18838         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18839         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18840         end loop
18841
18842         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18843         properties that track the label for the current loop (begin of the
18844         loop and end of the loop).
18845
18846 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18847
18848         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18849         use of emitting anything at all.
18850
18851         * class.cs, rootcontext.cs : Get rid of calls to the same.
18852
18853         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18854
18855         (Populate): Define the constructor correctly and set the implementation
18856         attributes.
18857
18858         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18859         have been defined.
18860
18861         (AddDelegateType): Implement.
18862
18863         (IsDelegateType): Implement helper method.
18864
18865         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18866
18867         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18868         and accordingly handle it.
18869
18870         * delegate.cs (Populate): Take TypeContainer argument.
18871         Implement bits to define the Invoke method. However, I still haven't figured out
18872         how to take care of the native int bit :-(
18873
18874         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18875         Qualify the name of the delegate, not its return type !
18876
18877         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18878         conversion.
18879
18880         (StandardConversionExists): Checking for array types turns out to be recursive.
18881
18882         (ConvertReferenceExplicit): Implement array conversion.
18883
18884         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18885
18886 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18887
18888         * cs-parser.jay (delegate_declaration): Store the fully qualified
18889         name as it is a type declaration.
18890
18891         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18892         readonly.
18893
18894         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18895         as TypeContainer::DefineType.
18896
18897         (Populate): Method in which all the definition of the various methods (Invoke)
18898         etc is done.
18899
18900         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18901         see.
18902
18903         (CloseDelegate): Finally creates the delegate.
18904
18905         * class.cs (TypeContainer::DefineType): Update to define delegates.
18906         (Populate, Emit and CloseType): Do the same thing here too.
18907
18908         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18909         delegates in all these operations.
18910
18911 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18912
18913         * expression.cs: LocalTemporary: a new expression used to
18914         reference a temporary that has been created.
18915
18916         * assign.cs: Handle PropertyAccess back here, so that we can
18917         provide the proper semantic access to properties.
18918
18919         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18920         a few more explicit conversions. 
18921
18922         * modifiers.cs: `NEW' modifier maps to HideBySig.
18923
18924         * expression.cs (PropertyExpr): Make this into an
18925         ExpressionStatement, and support the EmitStatement code path. 
18926
18927         Perform get/set error checking, clean up the interface.
18928
18929         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18930         them into toplevel access objects.
18931
18932 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18933
18934         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18935         SRE.
18936
18937         * typemanager.cs: Keep track here of our PropertyBuilders again to
18938         work around lameness in SRE.
18939
18940 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18941
18942         * expression.cs (LValue::LValueResolve): New method in the
18943         interface, used to perform a second resolution pass for LValues. 
18944
18945         (This::DoResolve): Catch the use of this in static methods.
18946
18947         (This::LValueResolve): Implement.
18948
18949         (This::Store): Remove warning, assigning to `this' in structures
18950         is 
18951
18952         (Invocation::Emit): Deal with invocation of
18953         methods on value types.  We need to pass the address to structure
18954         methods rather than the object itself.  (The equivalent code to
18955         emit "this" for structures leaves the entire structure on the
18956         stack instead of a pointer to it). 
18957
18958         (ParameterReference::DoResolve): Compute the real index for the
18959         argument based on whether the method takes or not a `this' pointer
18960         (ie, the method is static).
18961
18962         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18963         value types returned from functions when we need to invoke a
18964         method on the sturcture.
18965
18966
18967 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18968
18969         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18970         defining the type in the Modulebuilder or Typebuilder. This is to take
18971         care of nested types which need to be defined on the TypeBuilder using
18972         DefineNestedMethod.
18973
18974         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18975         methods in RootContext, only ported to be part of TypeContainer.
18976
18977         (TypeContainer::GetInterfaceOrClass): Ditto.
18978
18979         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18980
18981         * interface.cs (Interface::DefineInterface): New method. Does exactly
18982         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18983         too.
18984
18985         (Interface::GetInterfaces): Move from RootContext here and port.
18986
18987         (Interface::GetInterfaceByName): Same here.
18988
18989         * rootcontext.cs (ResolveTree): Re-write.
18990
18991         (PopulateTypes): Re-write.
18992
18993         * class.cs (TypeContainer::Populate): Populate nested types too.
18994         (TypeContainer::Emit): Emit nested members too.
18995
18996         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18997         instead just use the name argument passed in as it is already fully
18998         qualified.
18999
19000         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19001         to TypeContainer mapping to see if a type is user-defined.
19002
19003         * class.cs (TypeContainer::CloseType): Implement. 
19004
19005         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19006         the default constructor.
19007
19008         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19009         twice.
19010
19011         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19012
19013         * interface.cs (CloseType): Create the type here.
19014
19015         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19016         the hierarchy.
19017
19018         Remove all the methods which are now in TypeContainer.
19019
19020 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19021
19022         * delegate.cs (Define): Re-write bits to define the delegate
19023         correctly.
19024
19025 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19026
19027         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19028
19029         * expression.cs (ImplicitReferenceConversion): handle null as well
19030         as a source to convert to any reference type.
19031
19032         * statement.cs (Return): Perform any implicit conversions to
19033         expected return type.  
19034
19035         Validate use of return statement.  
19036
19037         * codegen.cs (EmitContext): Pass the expected return type here.
19038
19039         * class.cs (Method, Constructor, Property): Pass expected return
19040         type to EmitContext.
19041
19042 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * expression.cs: Make DoResolve take an EmitContext instead of a
19045         TypeContainer.
19046
19047         Replaced `l' and `location' for `loc', for consistency.
19048
19049         (Error, Warning): Remove unneeded Tc argument.
19050
19051         * assign.cs, literal.cs, constant.cs: Update to new calling
19052         convention. 
19053
19054         * codegen.cs: EmitContext now contains a flag indicating whether
19055         code is being generated in a static method or not.
19056
19057         * cs-parser.jay: DecomposeQI, new function that replaces the old
19058         QualifiedIdentifier.  Now we always decompose the assembled
19059         strings from qualified_identifier productions into a group of
19060         memberaccesses.
19061
19062 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19063
19064         * rootcontext.cs: Deal with field-less struct types correctly now
19065         by passing the size option to Define Type.
19066
19067         * class.cs: Removed hack that created one static field. 
19068
19069 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19070
19071         * statement.cs: Moved most of the code generation here. 
19072
19073 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19074
19075         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19076         seem very right.
19077
19078         (ElementAccess): Remove useless bits for now - keep checks as the spec
19079         says.
19080
19081 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19082
19083         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19084         and start performing checks according to the spec.
19085
19086 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19087
19088         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19089         rank_specifiers instead.
19090
19091         (rank_specifiers): Change the order in which the rank specifiers are stored
19092
19093         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19094
19095         * expression.cs (ElementAccess): Implement the LValue interface too.
19096
19097 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19098
19099         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19100         except that user defined conversions are not included.
19101
19102         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19103         perform the conversion of the return type, if necessary.
19104
19105         (New::DoResolve): Check whether we are creating an array or an object
19106         and accordingly do the needful.
19107
19108         (New::Emit): Same here.
19109
19110         (New::DoResolve): Implement guts of array creation.
19111
19112         (New::FormLookupType): Helper function.
19113
19114 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * codegen.cs: Removed most of the code generation here, and move the
19117         corresponding code generation bits to the statement classes. 
19118
19119         Added support for try/catch/finalize and throw.
19120
19121         * cs-parser.jay: Added support for try/catch/finalize.
19122
19123         * class.cs: Catch static methods having the flags override,
19124         virtual or abstract.
19125
19126         * expression.cs (UserCast): This user cast was not really doing
19127         what it was supposed to do.  Which is to be born in fully resolved
19128         state.  Parts of the resolution were being performed at Emit time! 
19129
19130         Fixed this code.
19131
19132 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19133
19134         * expression.cs: Implicity convert the result from UserCast.
19135
19136 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19137
19138         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19139         prevented it from working correctly. 
19140
19141         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19142         merely ConvertImplicit.
19143
19144 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19145
19146         * typemanager.cs: Make the LookupTypeContainer function static,
19147         and not per-instance.  
19148
19149         * class.cs: Make static FindMembers (the one that takes a Type
19150         argument). 
19151
19152         * codegen.cs: Add EmitForeach here.
19153
19154         * cs-parser.jay: Make foreach a toplevel object instead of the
19155         inline expansion, as we need to perform semantic analysis on it. 
19156
19157 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19158
19159         * expression.cs (Expression::ImplicitUserConversion): Rename to
19160         UserDefinedConversion.
19161
19162         (Expression::UserDefinedConversion): Take an extra argument specifying 
19163         whether we look for explicit user conversions too.
19164
19165         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19166
19167         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19168
19169         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19170         with the appropriate arguments.
19171
19172         * cs-parser.jay (cast_expression): Record location too.
19173
19174         * expression.cs (Cast): Record location info.
19175
19176         (Expression::ConvertExplicit): Take location argument.
19177
19178         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19179         to determine if we are doing explicit conversions.
19180
19181         (UserCast::Emit): Update accordingly.
19182
19183         (Expression::ConvertExplicit): Report an error if everything fails.
19184
19185         * ../errors/cs0030.cs : Add.
19186
19187 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19188
19189         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19190         virtual and newslot bits. 
19191
19192         * class.cs (TypeContainer::RegisterRequiredImplementations):
19193         Record methods we need.
19194
19195         (TypeContainer::MakeKey): Helper function to make keys for
19196         MethodBases, since the Methodbase key is useless.
19197
19198         (TypeContainer::Populate): Call RegisterRequiredImplementations
19199         before defining the methods.   
19200
19201         Create a mapping for method_builders_to_methods ahead of time
19202         instead of inside a tight loop.
19203
19204         (::RequireMethods):  Accept an object as the data to set into the
19205         hashtable so we can report interface vs abstract method mismatch.
19206
19207 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19208
19209         * report.cs: Make all of it static.
19210
19211         * rootcontext.cs: Drop object_type and value_type computations, as
19212         we have those in the TypeManager anyways.
19213
19214         Drop report instance variable too, now it is a global.
19215
19216         * driver.cs: Use try/catch on command line handling.
19217
19218         Add --probe option to debug the error reporting system with a test
19219         suite. 
19220
19221         * report.cs: Add support for exiting program when a probe
19222         condition is reached.
19223
19224 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19225
19226         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19227         we do a forcible conversion regardless of type, to check if 
19228         ForceConversion returns a null.
19229
19230         (Binary::error19): Use location to report error.
19231
19232         (Unary::error23): Use location here too.
19233
19234         * ../errors/cs0019.cs : Check in.
19235
19236         * ../errors/cs0023.cs : Check in.
19237
19238         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19239         case of a non-null MethodInfo object with a length of 0 !
19240
19241         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19242         an applicable member - according to the spec :-)
19243         Also fix logic to find members in base types.
19244
19245         (Unary::ResolveOperator): Same here.
19246
19247         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19248         as I was getting thoroughly confused between this and error19 :-)
19249
19250         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19251         (::FindMostEncompassedType): Implement.
19252         (::FindMostEncompassingType): Implement.
19253         (::StandardConversionExists): Implement.
19254
19255         (UserImplicitCast): Re-vamp. We now need info about most specific
19256         source and target types so that we can do the necessary conversions.
19257
19258         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19259         mathematical union with no duplicates.
19260
19261 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19262
19263         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19264         in order from base classes to child classes, so that we can in
19265         child classes look up in our parent for method names and
19266         attributes (required for handling abstract, virtual, new, override
19267         constructs: we need to instrospect our base class, and if we dont
19268         populate the classes in order, the introspection might be
19269         incorrect.  For example, a method could query its parent before
19270         the parent has any methods and would determine that the parent has
19271         no abstract methods (while it could have had them)).
19272
19273         (RootContext::CreateType): Record the order in which we define the
19274         classes.
19275
19276 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19277
19278         * class.cs (TypeContainer::Populate): Also method definitions can
19279         fail now, keep track of this.
19280
19281         (TypeContainer::FindMembers): Implement support for
19282         DeclaredOnly/noDeclaredOnly flag.
19283
19284         (Constructor::Emit) Return the ConstructorBuilder.
19285
19286         (Method::Emit) Return the MethodBuilder. 
19287         Check for abstract or virtual methods to be public.
19288
19289         * rootcontext.cs (RootContext::CreateType): Register all the
19290         abstract methods required for the class to be complete and the
19291         interface methods that must be implemented. 
19292
19293         * cs-parser.jay: Report error 501 (method requires body if it is
19294         not marked abstract or extern).
19295
19296         * expression.cs (TypeOf::Emit): Implement.
19297
19298         * typemanager.cs: runtime_handle_type, new global type.
19299
19300         * class.cs (Property::Emit): Generate code for properties.
19301
19302 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19303
19304         * expression.cs (Unary::ResolveOperator): Find operators on base type
19305         too - we now conform exactly to the spec.
19306
19307         (Binary::ResolveOperator): Same here.
19308
19309         * class.cs (Operator::Define): Fix minor quirk in the tests.
19310
19311         * ../errors/cs0215.cs : Added.
19312
19313         * ../errors/cs0556.cs : Added.
19314
19315         * ../errors/cs0555.cs : Added.
19316
19317 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19318
19319         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19320         single integer which is really efficient
19321
19322 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19323
19324         *  expression.cs (Expression::ImplicitUserConversion): Use location
19325         even in the case when we are examining True operators.
19326  
19327         * class.cs (Operator::Define): Perform extensive checks to conform
19328         with the rules for operator overloading in the spec.
19329
19330         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19331         some of the other conversions mentioned in the spec.
19332
19333         * typemanager.cs (array_type): New static member for the System.Array built-in
19334         type.
19335
19336         (cloneable_interface): For System.ICloneable interface.
19337
19338         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19339         we start resolving the tree and populating types.
19340
19341         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19342  
19343 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19344
19345         * expression.cs (Expression::ExprClassFromMemberInfo,
19346         Expression::Literalize): Create literal expressions from
19347         FieldInfos which are literals.
19348
19349         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19350         type casts, because they were wrong.  The test suite in tests
19351         caught these ones.
19352
19353         (ImplicitNumericConversion): ushort to ulong requires a widening
19354         cast. 
19355
19356         Int32 constant to long requires widening cast as well.
19357
19358         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19359         for integers because the type on the stack is not i4.
19360
19361 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19362
19363         * expression.cs (report118): require location argument. 
19364
19365         * parameter.cs: Do not dereference potential null value.
19366
19367         * class.cs: Catch methods that lack the `new' keyword when
19368         overriding a name.  Report warnings when `new' is used without
19369         anything being there to override.
19370
19371         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19372
19373         * class.cs: Only add constructor to hashtable if it is non-null
19374         (as now constructors can fail on define).
19375
19376         (TypeManager, Class, Struct): Take location arguments.
19377
19378         Catch field instance initialization in structs as errors.
19379
19380         accepting_filter: a new filter for FindMembers that is static so
19381         that we dont create an instance per invocation.
19382
19383         (Constructor::Define): Catch errors where a struct constructor is
19384         parameterless 
19385
19386         * cs-parser.jay: Pass location information for various new
19387         constructs. 
19388
19389         * delegate.cs (Delegate): take a location argument.
19390
19391         * driver.cs: Do not call EmitCode if there were problesm in the
19392         Definition of the types, as many Builders wont be there. 
19393
19394         * decl.cs (Decl::Decl): Require a location argument.
19395
19396         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19397         into integers, and find the most appropiate integer for it.
19398
19399         * literal.cs: Implement ULongLiteral.
19400
19401         * rootcontext.cs: Provide better information about the location of
19402         failure when CreateType fails.
19403
19404 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19405
19406         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19407         as well.
19408
19409         * expression.cs (Binary::CheckShiftArguments): Add missing type
19410         computation.
19411         (Binary::ResolveOperator): Add type to the logical and and logical
19412         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19413         before.
19414
19415         (Binary::DoNumericPromotions): In the case where either argument
19416         is ulong (and most signed types combined with ulong cause an
19417         error) perform implicit integer constant conversions as well.
19418
19419 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19420
19421         * expression.cs (UserImplicitCast): Method should always be
19422         non-null. 
19423         (Invocation::BetterConversion): Simplified test for IntLiteral.
19424
19425         (Expression::ImplicitNumericConversion): Split this routine out.
19426         Put the code that performs implicit constant integer conversions
19427         here. 
19428
19429         (Expression::Resolve): Become a wrapper around DoResolve so we can
19430         check eclass and type being set after resolve.
19431
19432         (Invocation::Badness): Remove this dead function
19433
19434         (Binary::ResolveOperator): Do not compute the expensive argumnets
19435         unless we have a union for it.
19436
19437         (Probe::Emit): Is needs to do an isinst and then
19438         compare against null.
19439
19440         (::CanConvert): Added Location argument.  If the Location argument
19441         is null (Location.Null), then we do not report errors.  This is
19442         used by the `probe' mechanism of the Explicit conversion.  We do
19443         not want to generate an error for something that the user
19444         explicitly requested to be casted.  But the pipeline for an
19445         explicit cast first tests for potential implicit casts.
19446
19447         So for now, if the Location is null, it means `Probe only' to
19448         avoid adding another argument.   Might have to revise this
19449         strategy later.
19450
19451         (ClassCast): New class used to type cast objects into arbitrary
19452         classes (used in Explicit Reference Conversions).
19453
19454         Implement `as' as well.
19455
19456         Reverted all the patches from Ravi below: they were broken:
19457
19458                 * The use of `level' as a mechanism to stop recursive
19459                   invocations is wrong.  That was there just to catch the
19460                   bug with a strack trace but not as a way of addressing
19461                   the problem.
19462
19463                   To fix the problem we have to *understand* what is going
19464                   on and the interactions and come up with a plan, not
19465                   just get things going.
19466
19467                 * The use of the type conversion cache that I proposed
19468                   last night had an open topic: How does this work across
19469                   protection domains.  A user defined conversion might not
19470                   be public in the location where we are applying the
19471                   conversion, a different conversion might be selected
19472                   (ie, private A->B (better) but public B->A (worse),
19473                   inside A, A->B applies, but outside it, B->A will
19474                   apply).
19475
19476                 * On top of that (ie, even if the above is solved),
19477                   conversions in a cache need to be abstract.  Ie, `To
19478                   convert from an Int to a Short use an OpcodeCast', not
19479                   `To convert from an Int to a Short use the OpcodeCast on
19480                   the variable 5' (which is what this patch was doing).
19481
19482 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19483
19484         * expression.cs (Invocation::ConversionExists): Re-write to use
19485         the conversion cache
19486
19487         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19488         cache all conversions done, not just user-defined ones.
19489
19490         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19491         to determine if a conversion exists instead of acutually trying to 
19492         perform the conversion. It's faster too.
19493
19494         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19495         and only then attempt the implicit conversion.
19496
19497 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19498
19499         * expression.cs (ConvertImplicit): Use a cache for conversions
19500         already found. Check level of recursion and bail out if necessary.
19501
19502 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19503
19504         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19505         Export standard methods that we expect for string operations.
19506
19507         * statement.cs (Block::UsageWarning): Track usage of variables and
19508         report the errors for not used variables.
19509
19510         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19511         operator. 
19512
19513 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19514
19515         * codegen.cs: remove unnneded code 
19516
19517         * expression.cs: Removed BuiltinTypeAccess class
19518
19519         Fix the order in which implicit conversions are
19520         done.  
19521
19522         The previous fixed dropped support for boxed conversions (adding a
19523         test to the test suite now)
19524
19525         (UserImplicitCast::CanConvert): Remove test for source being null,
19526         that code is broken.  We should not feed a null to begin with, if
19527         we do, then we should track the bug where the problem originates
19528         and not try to cover it up here.
19529
19530         Return a resolved expression of type UserImplicitCast on success
19531         rather than true/false.  Ravi: this is what I was talking about,
19532         the pattern is to use a static method as a "constructor" for
19533         objects. 
19534
19535         Also, do not create arguments until the very last minute,
19536         otherwise we always create the arguments even for lookups that
19537         will never be performed. 
19538
19539         (UserImplicitCast::Resolve): Eliminate, objects of type
19540         UserImplicitCast are born in a fully resolved state. 
19541
19542         * typemanager.cs (InitCoreTypes): Init also value_type
19543         (System.ValueType). 
19544
19545         * expression.cs (Cast::Resolve): First resolve the child expression.
19546
19547         (LValue): Add new method AddressOf to be used by
19548         the `&' operator.  
19549
19550         Change the argument of Store to take an EmitContext instead of an
19551         ILGenerator, because things like FieldExpr need to be able to call
19552         their children expression to generate the instance code. 
19553
19554         (Expression::Error, Expression::Warning): Sugar functions for
19555         reporting errors.
19556
19557         (Expression::MemberLookup): Accept a TypeContainer instead of a
19558         Report as the first argument.
19559
19560         (Expression::ResolvePrimary): Killed.  I still want to improve
19561         this as currently the code is just not right.
19562
19563         (Expression::ResolveMemberAccess): Simplify, but it is still
19564         wrong. 
19565
19566         (Unary::Resolve): Catch errors in AddressOf operators.
19567
19568         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19569         index to a byte for the short-version, or the compiler will choose
19570         the wrong Emit call, which generates the wrong data.
19571
19572         (ParameterReference::Emit, ::Store): same.
19573
19574         (FieldExpr::AddressOf): Implement.
19575
19576         * typemanager.cs: TypeManager: made public variable instead of
19577         property.
19578
19579         * driver.cs: document --fatal.
19580
19581         * report.cs (ErrorMessage, WarningMessage): new names for the old
19582         Error and Warning classes.
19583
19584         * cs-parser.jay (member_access): Turn built-in access to types
19585         into a normal simplename
19586
19587 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19588
19589         * expression.cs (Invocation::BetterConversion): Fix to cope
19590         with q being null, since this was introducing a bug.
19591
19592         * expression.cs (ConvertImplicit): Do built-in conversions first.
19593
19594 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19595
19596         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19597
19598 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19599
19600         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19601         I had introduced long ago (what's new ?).
19602
19603         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19604         the work of all the checking. 
19605         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19606         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19607
19608         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19609         that is the right way. 
19610
19611         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19612         overloading resolution. Use everywhere instead of cutting and pasting code.
19613
19614         (Binary::ResolveOperator): Use MakeUnionSet.
19615
19616         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19617         we have to convert to bool types. Not complete yet.
19618
19619 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19620
19621         * typemanager.cs (TypeManager::CSharpName): support ushort.
19622
19623         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19624         to provide an expression that performsn an implicit constant int
19625         conversion (section 6.1.6).
19626         (Expression::ConvertImplicitRequired): Reworked to include
19627         implicit constant expression conversions.
19628
19629         (Expression::ConvertNumericExplicit): Finished.
19630
19631         (Invocation::Emit): If InstanceExpression is null, then it means
19632         that we perform a call on this.
19633
19634 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19635
19636         * expression.cs (Unary::Emit): Remove some dead code.
19637         (Probe): Implement Resolve and Emit for `is'.
19638         (Expression::ConvertImplicitRequired): Attempt to do constant
19639         expression conversions here.  Maybe should be moved to
19640         ConvertImplicit, but I am not sure.
19641         (Expression::ImplicitLongConstantConversionPossible,
19642         Expression::ImplicitIntConstantConversionPossible): New functions
19643         that tell whether is it possible to apply an implicit constant
19644         expression conversion.
19645
19646         (ConvertNumericExplicit): Started work on explicit numeric
19647         conversions.
19648
19649         * cs-parser.jay: Update operator constants.
19650
19651         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19652         (Parameters::GetSignature): Hook up VerifyArgs here.
19653         (Parameters::VerifyArgs): Verifies that no two arguments have the
19654         same name. 
19655
19656         * class.cs (Operator): Update the operator names to reflect the
19657         ones that the spec expects (as we are just stringizing the
19658         operator names).
19659
19660         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19661         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19662         previous usage did only work for our methods.
19663         (Expression::ConvertImplicit): Handle decimal implicit numeric
19664         conversions as well.
19665         (Expression::InternalTypeConstructor): Used to invoke constructors
19666         on internal types for default promotions.
19667
19668         (Unary::Emit): Implement special handling for the pre/post
19669         increment/decrement for overloaded operators, as they need to have
19670         the same semantics as the other operators.
19671
19672         (Binary::ResolveOperator): ditto.
19673         (Invocation::ConversionExists): ditto.
19674         (UserImplicitCast::Resolve): ditto.
19675
19676 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19677
19678         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19679         operator, return after emitting body. Regression tests pass again !
19680
19681         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19682         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19683         (Invocation::OverloadResolve): Ditto.
19684         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19685
19686         * everywhere : update calls to the above methods accordingly.
19687
19688 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19689
19690         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19691
19692         * expression.cs (ExpressionStatement): New base class used for
19693         expressions that can appear in statements, so that we can provide
19694         an alternate path to generate expression that do not leave a value
19695         on the stack.
19696
19697         (Expression::Emit, and all the derivatives): We no longer return
19698         whether a value is left on the stack or not.  Every expression
19699         after being emitted leaves a single value on the stack.
19700
19701         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19702         facilties of ExpressionStatement if possible.
19703
19704         * cs-parser.jay: Update statement_expression.
19705
19706 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19707
19708         * driver.cs: Change the wording of message
19709
19710 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19711
19712         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19713         the type of the expression to the return type of the method if
19714         we have an overloaded operator match ! The regression tests pass again !
19715         (Unary::ResolveOperator): Ditto.
19716
19717         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19718         to find "op_Implicit", not "implicit" ;-)
19719         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19720         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19721
19722         * everywhere : Correct calls to the above accordingly.
19723
19724         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19725         (ConvertImplicit): Do user-defined conversion if it exists.
19726
19727 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19728
19729         * assign.cs: track location.
19730         (Resolve): Use implicit conversions on assignment.
19731
19732         * literal.cs: Oops.  Not good, Emit of short access values should
19733         pass (Bytes) or the wrong argument will be selected.
19734
19735         * expression.cs (Unary::Emit): Emit code for -expr.
19736
19737         (Unary::ResolveOperator): Handle `Substract' for non-constants
19738         (substract from zero from the non-constants).
19739         Deal with Doubles as well. 
19740
19741         (Expression::ConvertImplicitRequired): New routine that reports an
19742         error if no implicit conversion exists. 
19743
19744         (Invocation::OverloadResolve): Store the converted implicit
19745         expressions if we make them
19746
19747 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19748
19749         * class.cs (ConstructorInitializer): Take a Location argument.
19750         (ConstructorBaseInitializer): Same here.
19751         (ConstructorThisInitializer): Same here.
19752
19753         * cs-parser.jay : Update all calls accordingly.
19754
19755         * expression.cs (Unary, Binary, New): Take location argument.
19756         Update accordingly everywhere.
19757
19758         * cs-parser.jay : Update all calls to the above to take a location
19759         argument.
19760
19761         * class.cs : Ditto.
19762
19763 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19764
19765         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19766         (Invocation::BetterConversion): Same here
19767         (Invocation::ConversionExists): Ditto.
19768
19769         (Invocation::ConversionExists): Implement.
19770
19771 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19772
19773         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19774         Also take an additional TypeContainer argument.
19775
19776         * All over : Pass in TypeContainer as argument to OverloadResolve.
19777
19778         * typemanager.cs (CSharpName): Update to check for the string type and return
19779         that too.
19780
19781         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19782         a given method.
19783
19784 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19785
19786         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19787         (Invocation::BetterFunction): Implement.
19788         (Invocation::BetterConversion): Implement.
19789         (Invocation::ConversionExists): Skeleton, no implementation yet.
19790
19791         Okay, things work fine !
19792
19793 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * typemanager.cs: declare and load enum_type, delegate_type and
19796         void_type. 
19797
19798         * expression.cs (Expression::Emit): Now emit returns a value that
19799         tells whether a value is left on the stack or not.  This strategy
19800         might be reveted tomorrow with a mechanism that would address
19801         multiple assignments.
19802         (Expression::report118): Utility routine to report mismatches on
19803         the ExprClass.
19804
19805         (Unary::Report23): Report impossible type/operator combination
19806         utility function.
19807
19808         (Unary::IsIncrementableNumber): Whether the type can be
19809         incremented or decremented with add.
19810         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19811         complemented. 
19812         (Unary::ResolveOperator): Implement ++, !, ~,
19813
19814         (Invocation::Emit): Deal with new Emit convetion.
19815
19816         * All Expression derivatives: Updated their Emit method to return
19817         whether they leave values on the stack or not.
19818
19819         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19820         stack for expressions that are statements. 
19821
19822 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * expression.cs (LValue): New interface.  Must be implemented by
19825         LValue objects.
19826         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19827         LValue interface.
19828
19829         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19830         interface for generating code, simplifies the code.
19831
19832 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19833
19834         * expression.cs (everywhere): Comment out return statements in ::Resolve
19835         methods to avoid the warnings.
19836
19837 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19838
19839         * driver.cs (parse): Report error 2001 if we can not open the
19840         source file.
19841
19842         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19843         not resolve it.
19844
19845         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19846         object. 
19847
19848         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19849         otherwise nested blocks end up with the same index.
19850
19851         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19852
19853         * expression.cs:  Instead of having FIXMEs in the Resolve
19854         functions, throw exceptions so it is obvious that we are facing a
19855         bug. 
19856
19857         * cs-parser.jay (invocation_expression): Pass Location information.
19858
19859         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19860         Use a basename for those routines because .NET does not like paths
19861         on them. 
19862
19863         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19864         already defined.
19865
19866 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19867
19868         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19869         are loading the correct data types (throws an exception if not).
19870         (TypeManager::InitCoreTypes): Use CoreLookupType
19871
19872         * expression.cs (Unary::ResolveOperator): return the child
19873         expression for expressions which are just +expr.
19874         (Unary::ResolveOperator): Return negative literals for -LITERAL
19875         expressions (otherwise they are Unary {Literal}).
19876         (Invocation::Badness): Take into account `Implicit constant
19877         expression conversions'.
19878
19879         * literal.cs (LongLiteral): Implement long literal class.
19880         (IntLiteral): export the `Value' of the intliteral. 
19881
19882 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19883
19884         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19885
19886         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19887         instead of 'Operator'
19888
19889         * expression.cs (Binary::ResolveOperator): Update accordingly.
19890         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19891         and 'Minus'
19892
19893         * cs-parser.jay (unary_expression): Update to use the new names.
19894
19895         * gen-treedump.cs (GetUnary): Same here.
19896
19897         * expression.cs (Unary::Resolve): Implement.
19898         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19899         operators are found instead of making noise ;-)
19900         (Unary::ResolveOperator): New method to do precisely the same thing which
19901         Binary::ResolveOperator does for Binary expressions.
19902         (Unary.method, .Arguments): Add.
19903         (Unary::OperName): Implement.   
19904         (Unary::ForceConversion): Copy and Paste !
19905
19906         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19907         a unary operator.
19908
19909         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19910         for the inbuilt operators. Only overloading works for now ;-)
19911
19912 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19913
19914         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19915         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19916
19917         * expression.cs (This::Emit): Implement. 
19918         (This::Resolve): Implement.
19919         (TypeOf:Resolve): Implement.
19920         (Expression::ResolveSimpleName): Add an implicit this to instance
19921         field references. 
19922         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19923         Bind instance variable to Field expressions.
19924         (FieldExpr::Instance): New field used to track the expression that
19925         represents the object instance.
19926         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19927         binding 
19928         (FieldExpr::Emit): Implement.
19929
19930         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19931         the last instruction contains a return opcode to avoid generating
19932         the last `ret' instruction (this generates correct code, and it is
19933         nice to pass the peverify output).
19934
19935         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19936         initializer for static and instance variables.
19937         (Constructor::Emit): Allow initializer to be null in the case of
19938         static constructors.  Only emit initializer for instance
19939         constructors. 
19940
19941         (TypeContainer::FindMembers): Return a null array if there are no
19942         matches.
19943
19944         Also fix the code for the MemberTypes.Method branch, as it was not
19945         scanning that for operators (or tried to access null variables before).
19946
19947         * assign.cs (Assign::Emit): Handle instance and static fields. 
19948
19949         * TODO: Updated.
19950
19951         * driver.cs: Stop compilation if there are parse errors.
19952
19953         * cs-parser.jay (constructor_declaration): Provide default base
19954         initializer for non-static constructors.
19955         (constructor_declarator): Do not provide a default base
19956         initializers if none was specified.
19957         Catch the fact that constructors should not have parameters.
19958
19959         * class.cs: Do not emit parent class initializers for static
19960         constructors, that should be flagged as an error.
19961
19962 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19963
19964         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19965         Move back code into TypeContainer::Populate.
19966
19967 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19968
19969         * class.cs (TypeContainer::AddConstructor): Fix the check to
19970         compare against Name, not Basename. 
19971         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19972
19973         * cs-parser.jay : Update accordingly.
19974
19975         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19976         for methods, don't forget to look into the operators too.
19977         (RegisterMethodBuilder): Helper method to take care of this for
19978         methods, constructors and operators.
19979         (Operator::Define): Completely revamp.
19980         (Operator.OperatorMethod, MethodName): New fields.
19981         (TypeContainer::Populate): Move the registering of builders into
19982         RegisterMethodBuilder.
19983         (Operator::Emit): Re-write.
19984
19985         * expression.cs (Binary::Emit): Comment out code path to emit method
19986         invocation stuff for the case when we have a user defined operator. I am
19987         just not able to get it right !
19988
19989 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19990
19991         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19992         argument. 
19993
19994         (Expression::MemberLookup): Provide a version that allows to
19995         specify the MemberTypes and BindingFlags. 
19996
19997         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19998         so it was not fetching variable information from outer blocks.
19999
20000         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20001         Beforefieldinit as it was buggy.
20002
20003         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20004         that Ravi put here.  
20005
20006         * class.cs (Constructor::Emit): Only emit if block is not null.
20007         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20008         deal with this by semantically definining it as if the user had
20009         done it.
20010
20011         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20012         constructors as we now "emit" them at a higher level.
20013
20014         (TypeContainer::DefineDefaultConstructor): Used to define the
20015         default constructors if none was provided.
20016
20017         (ConstructorInitializer): Add methods Resolve and Emit. 
20018
20019         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20020
20021 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20022
20023         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20024         the default constructor builder with our hashtable for methodbuilders
20025         to methodcores.
20026
20027         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20028         and argument_count is 0 in which case we have a match.
20029         (Binary::ResolveOperator): More null checking and miscellaneous coding
20030         style cleanup.
20031
20032 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20033
20034         * rootcontext.cs (IsNameSpace): Compare against null.
20035
20036         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20037
20038         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20039         and Unary::Operator.
20040
20041         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20042         accordingly.
20043
20044         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20045         we have overloaded operators.
20046         (Binary::ResolveOperator): Implement the part which does the operator overload
20047         resolution.
20048
20049         * class.cs (Operator::Emit): Implement.
20050         (TypeContainer::Emit): Emit the operators we have too.
20051
20052         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20053         the case when we have a user-defined operator.
20054
20055 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20056
20057         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20058
20059 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20060
20061         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20062         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20063         (Constructor::Emit): Implement.
20064         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20065         if we have no work to do. 
20066         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20067         Emit method.
20068
20069         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20070         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20071
20072         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20073         of parent.parent.
20074
20075 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20076
20077         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20078         in the source.
20079         (Tree::RecordNamespace): Method to do what the name says ;-)
20080         (Tree::Namespaces): Property to get at the namespaces hashtable.
20081
20082         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20083         keep track.
20084
20085         * rootcontext.cs (IsNamespace): Fixed it :-)
20086
20087 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * class.cs (TypeContainer::FindMembers): Add support for
20090         constructors. 
20091         (MethodCore): New class that encapsulates both the shared aspects
20092         of a Constructor and a Method.  
20093         (Method, Constructor): Factored pieces into MethodCore.
20094
20095         * driver.cs: Added --fatal which makes errors throw exceptions.
20096         Load System assembly as well as part of the standard library.
20097
20098         * report.cs: Allow throwing exceptions on errors for debugging.
20099
20100         * modifiers.cs: Do not use `parent', instead use the real type
20101         container to evaluate permission settings.
20102
20103         * class.cs: Put Ravi's patch back in.  He is right, and we will
20104         have to cope with the
20105
20106 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20107
20108         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20109         FamORAssem, not FamANDAssem.
20110
20111 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20112
20113         * driver.cs: Added --parse option that only parses its input files
20114         and terminates.
20115
20116         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20117         incorrect.  IsTopLevel is not used to tell whether an object is
20118         root_types or not (that can be achieved by testing this ==
20119         root_types).  But to see if this is a top-level *class* (not
20120         necessarly our "toplevel" container). 
20121
20122 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20123
20124         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20125         parent instead of a direct call to GetType.
20126
20127 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20128
20129         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20130         Modifiers.TypeAttr. This should just be a call to that method.
20131
20132         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20133         object so that we can determine if we are top-level or not.
20134
20135         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20136         TypeContainer too.
20137
20138         * enum.cs (Enum::Define): Ditto.
20139
20140         * modifiers.cs (FieldAttr): Re-write.
20141
20142         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20143         (TypeContainer::HaveStaticConstructor): New property to provide access
20144         to precisely that info.
20145
20146         * modifiers.cs (MethodAttr): Re-write.
20147         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20148
20149         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20150         of top-level types as claimed.
20151
20152 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20153
20154         * expression.cs (MemberLookup): Fruitless attempt to lookup
20155         constructors.  Maybe I need to emit default constructors?  That
20156         might be it (currently .NET emits this for me automatically).
20157         (Invocation::OverloadResolve): Cope with Arguments == null.
20158         (Invocation::EmitArguments): new function, shared by the new
20159         constructor and us.
20160         (Invocation::Emit): Handle static and instance methods.  Emit
20161         proper call instruction for virtual or non-virtual invocations.
20162         (New::Emit): Implement.
20163         (New::Resolve): Implement.
20164         (MemberAccess:Resolve): Implement.
20165         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20166         to track instances.
20167         (FieldExpr::Resolve): Set type.
20168
20169         * support.cs: Handle empty arguments.
20170                 
20171         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20172         SimpleLookup): Auxiliary routines to help parse a qualifier
20173         identifier.  
20174
20175         Update qualifier_identifier rule.
20176
20177         * codegen.cs: Removed debugging messages.
20178
20179         * class.cs: Make this a global thing, this acts just as a "key" to
20180         objects that we might have around.
20181
20182         (Populate): Only initialize method_builders_to_methods once.
20183
20184         * expression.cs (PropertyExpr): Initialize type from the
20185         PropertyType. 
20186
20187         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20188         Resolve pattern.  Attempt to implicitly convert value to boolean.
20189         Emit code.
20190
20191         * expression.cs: Set the type for the int32/int32 argument case.
20192         (Binary::ResolveOperator): Set the return type to boolean for
20193         comparission operators
20194
20195         * typemanager.cs: Remove debugging print code.
20196
20197         (Invocation::Resolve): resolve type.
20198
20199         * class.cs: Allocate a MemberInfo of the correct size, as the code
20200         elsewhere depends on the test to reflect the correct contents.
20201
20202         (Method::) Keep track of parameters, due to System.Reflection holes
20203
20204         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20205         mapping here.
20206
20207         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20208         of the exact size and return that.
20209
20210         (Class::LookupMethodByBuilder): New function that maps
20211         MethodBuilders to its methods.  Required to locate the information
20212         on methods because System.Reflection bit us again.
20213
20214         * support.cs: New file, contains an interface ParameterData and
20215         two implementations: ReflectionParameters and InternalParameters
20216         used to access Parameter information.  We will need to grow this
20217         as required.
20218
20219         * expression.cs (Invocation::GetParameterData): implement a cache
20220         and a wrapper around the ParameterData creation for methods. 
20221         (Invocation::OverloadResolve): Use new code.
20222
20223 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20224
20225         * class.cs (TypeContainer::EmitField): Remove and move into 
20226         (Field::Define): here and modify accordingly.
20227         (Field.FieldBuilder): New member.
20228         (TypeContainer::Populate): Update accordingly.
20229         (TypeContainer::FindMembers): Implement.
20230
20231 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20232
20233         * statement.cs: (VariableInfo::VariableType): New field to be
20234         initialized with the full type once it is resolved. 
20235
20236 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20237
20238         * parameter.cs (GetParameterInfo): Use a type cache to compute
20239         things only once, and to reuse this information
20240
20241         * expression.cs (LocalVariableReference::Emit): Implement.
20242         (OpcodeCast::Emit): fix.
20243
20244         (ParameterReference::Resolve): Implement.
20245         (ParameterReference::Emit): Implement.
20246
20247         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20248         that are expressions need to stay as Expressions.
20249
20250         * typemanager.cs (CSharpName): Returns the C# name of a type if
20251         possible. 
20252
20253         * expression.cs (Expression::ConvertImplicit): New function that
20254         implements implicit type conversions.
20255
20256         (Expression::ImplicitReferenceConversion): Implements implicit
20257         reference conversions.
20258
20259         (EmptyCast): New type for transparent casts.
20260
20261         (OpcodeCast): New type for casts of types that are performed with
20262         a sequence of bytecodes.
20263
20264         (BoxedCast): New type used for casting value types into reference
20265         types.  Emits a box opcode.
20266
20267         (Binary::DoNumericPromotions): Implements numeric promotions of
20268         and computation of the Binary::Type.
20269
20270         (Binary::EmitBranchable): Optimization.
20271
20272         (Binary::Emit): Implement code emission for expressions.
20273
20274         * typemanager.cs (TypeManager): Added two new core types: sbyte
20275         and byte.
20276
20277 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20278
20279         * class.cs (TypeContainer::FindMembers): Method which does exactly
20280         what Type.FindMembers does, only we don't have to use reflection. No
20281         implementation yet.
20282
20283         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20284         typecontainer objects as we need to get at them.
20285         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20286
20287         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20288         typecontainer object.
20289
20290         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20291         of just a Report object.
20292
20293 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20294
20295         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20296         "remove_"
20297         (TypeContainer::Populate): Now define the delegates of the type too.
20298         (TypeContainer.Delegates): Property to access the list of delegates defined
20299         in the type.
20300
20301         * delegates.cs (Delegate::Define): Implement partially.
20302
20303         * modifiers.cs (TypeAttr): Handle more flags.
20304
20305 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20306
20307         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20308         and not <=
20309         (Operator::Define): Re-write logic to get types by using the LookupType method
20310         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20311         (Indexer::Define): Ditto.
20312         (Event::Define): Ditto.
20313         (Property::Define): Ditto.
20314
20315 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20316
20317         * class.cs (TypeContainer::Populate): Now define operators too. 
20318         (TypeContainer.Operators): New property to access the list of operators
20319         in a type.
20320         (Operator.OperatorMethodBuilder): New member to hold the method builder
20321         for the operator we are defining.
20322         (Operator::Define): Implement.
20323
20324 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20325
20326         * class.cs (Event::Define): Make the prefixes of the accessor methods
20327         addOn_ and removeOn_ 
20328
20329         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20330         of the location being passed in too. Ideally, this should go later since all
20331         error reporting should be done through the Report object.
20332
20333         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20334         (Populate): Iterate thru the indexers we have and define them too.
20335         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20336         for the get and set accessors.
20337         (Indexer::Define): Implement.
20338
20339 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20340
20341         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20342         my previous implementation, did not work.
20343
20344         * typemanager.cs: Add a couple of missing types (the longs).
20345
20346         * literal.cs: Use TypeManager.bool_type instead of getting it.
20347
20348         * expression.cs (EventExpr): New kind of expressions.
20349         (Expressio::ExprClassFromMemberInfo): finish
20350
20351 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20352
20353         * assign.cs: Emit stores to static fields differently.
20354
20355 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20356
20357         * Merge in changes and adjust code to tackle conflicts. Backed out my
20358         code in Assign::Resolve ;-) 
20359
20360 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20361
20362         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20363         instead Report.Error and also pass in the location.
20364         (CSharpParser::Lexer): New readonly property to return the reference
20365         to the Tokenizer object.
20366         (declare_local_variables): Use Report.Error with location instead of plain 
20367         old error.
20368         (CheckDef): Ditto.
20369
20370         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20371         (Operator.CheckBinaryOperator): Ditto.
20372
20373         * cs-parser.jay (operator_declarator): Update accordingly.
20374
20375         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20376         (CheckBinaryOperator): Same here.
20377
20378         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20379         on the name without any prefixes of namespace names etc. This is because we
20380         already might have something already fully qualified like 
20381         'System.Console.WriteLine'
20382
20383         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20384
20385 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20386
20387         * cs-tokenizer.cs (location): Return a string which also contains
20388         the file name.
20389
20390         * expression.cs (ElementAccess): New class for expressions of the
20391         type 'element access.'
20392         (BaseAccess): New class for expressions of the type 'base access.'
20393         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20394         respectively.
20395
20396         * cs-parser.jay (element_access): Implement action.
20397         (base_access): Implement actions.
20398         (checked_expression, unchecked_expression): Implement.
20399
20400         * cs-parser.jay (local_variable_type): Correct and implement.
20401         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20402
20403         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20404
20405         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20406         name and the specifiers.
20407
20408         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20409
20410         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20411         making them all public ;-)
20412
20413         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20414         class anyways.
20415
20416 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20417
20418         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20419         PropertyExprs.
20420         (FieldExpr, PropertyExprs): New resolved expressions.
20421         (SimpleName::MemberStaticCheck): Perform static checks for access
20422         to non-static fields on static methods. Maybe this should be
20423         generalized for MemberAccesses. 
20424         (SimpleName::ResolveSimpleName): More work on simple name
20425         resolution. 
20426
20427         * cs-parser.jay (primary_expression/qualified_identifier): track
20428         the parameter index.
20429
20430         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20431         (EmitContext::EmitBoolExpression): Chain to expression generation
20432         instead of temporary hack.
20433         (::EmitStatementExpression): Put generic expression code generation.
20434
20435         * assign.cs (Assign::Emit): Implement variable assignments to
20436         local variables, parameters and fields.
20437
20438 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * statement.cs (Block::GetVariableInfo): New method, returns the
20441         VariableInfo for a variable name in a block.
20442         (Block::GetVariableType): Implement in terms of GetVariableInfo
20443
20444         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20445         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20446
20447 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20448
20449         * cs-parser.jay (operator_declaration): Continue on my quest : update
20450         to take attributes argument.
20451         (event_declaration): Ditto.
20452         (enum_declaration): Ditto.
20453         (indexer_declaration): Ditto.
20454
20455         * class.cs (Operator::Operator): Update constructor accordingly.
20456         (Event::Event): Ditto.
20457
20458         * delegate.cs (Delegate::Delegate): Same here.
20459
20460         * enum.cs (Enum::Enum): Same here.
20461
20462 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20463
20464         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20465
20466         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20467
20468         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20469         being passed around as an arraylist.
20470         (Attributes::AddAttribute): Method to add attribute sections.
20471
20472         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20473         (struct_declaration): Update accordingly.
20474         (constant_declaration): Update.
20475         (field_declaration): Update.
20476         (method_header): Update.
20477         (fixed_parameter): Update.
20478         (parameter_array): Ditto.
20479         (property_declaration): Ditto.
20480         (destructor_declaration): Ditto.
20481
20482         * class.cs (Struct::Struct): Update constructors accordingly.
20483         (Class::Class): Ditto.
20484         (Field::Field): Ditto.
20485         (Method::Method): Ditto.
20486         (Property::Property): Ditto.
20487         (TypeContainer::OptAttribute): update property's return type.
20488
20489         * interface.cs (Interface.opt_attributes): New member.
20490         (Interface::Interface): Update to take the extra Attributes argument.
20491
20492         * parameter.cs (Parameter::Parameter): Ditto.
20493
20494         * constant.cs (Constant::Constant): Ditto.
20495
20496         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20497         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20498         the attributes as a parameter.
20499         (InterfaceProperty): Update constructor call.
20500         (InterfaceEvent): Ditto.
20501         (InterfaceMethod): Ditto.
20502         (InterfaceIndexer): Ditto.
20503
20504         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20505         pass the attributes too.
20506         (interface_event_declaration): Ditto.
20507         (interface_property_declaration): Ditto.
20508         (interface_method_declaration): Ditto.
20509         (interface_declaration): Ditto.
20510
20511 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20512
20513         * class.cs (Method::Define): Track the "static Main" definition to
20514         create an entry point. 
20515
20516         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20517         EntryPoint if we find it. 
20518
20519         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20520         (EmitContext::ig): Make this variable public.
20521
20522         * driver.cs: Make the default output file be the first file name
20523         with the .exe extension.  
20524
20525         Detect empty compilations
20526
20527         Handle various kinds of output targets.  Handle --target and
20528         rename -t to --dumper.
20529
20530         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20531         methods inherited from Expression return now an Expression.  This
20532         will is used during the tree rewriting as we resolve them during
20533         semantic analysis.
20534
20535         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20536         the spec.  Missing entirely is the information about
20537         accessability of elements of it.
20538
20539         (Expression::ExprClassFromMemberInfo): New constructor for
20540         Expressions that creates a fully initialized Expression based on
20541         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20542         a Type.
20543
20544         (Invocation::Resolve): Begin implementing resolution of invocations.
20545
20546         * literal.cs (StringLiteral):  Implement Emit.
20547
20548 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20549
20550         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20551         member.
20552
20553 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20554
20555         * cs-parser.jay (attribute_arguments): Implement actions.
20556         (attribute): Fix bug in production. Implement action.
20557         (attribute_list): Implement.
20558         (attribute_target): Implement.
20559         (attribute_target_specifier, opt_target_specifier): Implement
20560         (CheckAttributeTarget): New method to check if the attribute target
20561         is valid.
20562         (attribute_section): Implement.
20563         (opt_attributes): Implement.
20564
20565         * attribute.cs : New file to handle attributes.
20566         (Attribute): Class to hold attribute info.
20567
20568         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20569         (attribute_section): Modify production to use 2 different rules to 
20570         achieve the same thing. 1 s/r conflict down !
20571         Clean out commented, useless, non-reducing dimension_separator rules.
20572
20573         * class.cs (TypeContainer.attributes): New member to hold list
20574         of attributes for a type.
20575         (Struct::Struct): Modify to take one more argument, the attribute list.
20576         (Class::Class): Ditto.
20577         (Field::Field): Ditto.
20578         (Method::Method): Ditto.
20579         (Property::Property): Ditto.
20580
20581         * cs-parser.jay (struct_declaration): Update constructor call to
20582         pass in the attributes too.
20583         (class_declaration): Ditto.
20584         (constant_declaration): Ditto.
20585         (field_declaration): Ditto.
20586         (method_header): Ditto.
20587         (fixed_parameter): Ditto.
20588         (parameter_array): Ditto.
20589         (property_declaration): Ditto.
20590
20591         * constant.cs (Constant::Constant): Update constructor similarly.
20592         Use System.Collections.
20593
20594         * parameter.cs (Parameter::Parameter): Update as above.
20595
20596 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20597
20598         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20599         (TypeContainer.delegates): New member to hold list of delegates.
20600
20601         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20602         this time as I seem to be on crack ;-)
20603
20604 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20605
20606         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20607         tell whether an identifier represents a namespace.
20608
20609         * expression.cs (NamespaceExpr): A namespace expression, used only
20610         temporarly during expression resolution.
20611         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20612         utility functions to resolve names on expressions.
20613
20614 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20615
20616         * codegen.cs: Add hook for StatementExpressions. 
20617
20618         * class.cs: Fix inverted test for static flag in methods.
20619
20620 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20621
20622         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20623         to make it coincide with MS' number.
20624         (Operator::CheckBinaryOperator): Ditto.
20625
20626         * ../errors/errors.txt : Remove error numbers added earlier.
20627
20628         * ../errors/cs1019.cs : Test case for error # 1019
20629
20630         * ../errros/cs1020.cs : Test case for error # 1020
20631
20632         * cs-parser.jay : Clean out commented cruft.
20633         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20634         used anywhere - non-reducing rule.
20635         (namespace_declarations): Non-reducing rule - comment out.
20636
20637         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20638         with TypeContainer::AddEnum.
20639
20640         * delegate.cs : New file for delegate handling classes.
20641         (Delegate): Class for declaring delegates.
20642
20643         * makefile : Update.
20644
20645         * cs-parser.jay (delegate_declaration): Implement.
20646
20647 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20648
20649         * class.cs (Event::Define): Implement.
20650         (Event.EventBuilder): New member.
20651
20652         * class.cs (TypeContainer::Populate): Update to define all enums and events
20653         we have.
20654         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20655         readonly fields for all these cases ?
20656
20657 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20658
20659         * class.cs (Property): Revamp to use the convention of making fields readonly.
20660         Accordingly modify code elsewhere.
20661
20662         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20663         the Define method of the Property class.
20664
20665         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20666         trivial bug.
20667         (TypeContainer::Populate): Update to define all the properties we have. Also
20668         define all enumerations.
20669
20670         * enum.cs (Define): Implement.
20671
20672 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20673
20674         * cs-parser.jay (overloadable_operator): The semantic value is an
20675         enum of the Operator class.
20676         (operator_declarator): Implement actions.
20677         (operator_declaration): Implement.
20678
20679         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20680         validity of definitions.
20681         (Operator::CheckBinaryOperator): Static method to check for binary operators
20682         (TypeContainer::AddOperator): New method to add an operator to a type.
20683
20684         * cs-parser.jay (indexer_declaration): Added line to actually call the
20685         AddIndexer method so it gets added ;-)
20686
20687         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20688         already taken care of by the MS compiler ?  
20689
20690 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20691
20692         * class.cs (Operator): New class for operator declarations.
20693         (Operator::OpType): Enum for the various operators.
20694
20695 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20696
20697         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20698         ostensibly handle this in semantic analysis.
20699
20700         * cs-parser.jay (general_catch_clause): Comment out
20701         (specific_catch_clauses, specific_catch_clause): Ditto.
20702         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20703         (catch_args, opt_catch_args): New productions.
20704         (catch_clause): Rewrite to use the new productions above
20705         (catch_clauses): Modify accordingly.
20706         (opt_catch_clauses): New production to use in try_statement
20707         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20708         and re-write the code in the actions to extract the specific and
20709         general catch clauses by being a little smart ;-)
20710
20711         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20712         Hooray, try and catch statements parse fine !
20713
20714 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20715
20716         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20717         string from the hashtable of variables.
20718
20719         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20720         I end up making that mistake ;-)
20721         (catch_clauses): Fixed gross error which made Key and Value of the 
20722         DictionaryEntry the same : $1 !!
20723
20724 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20725
20726         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20727
20728         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20729         when the add and remove accessors are specified. 
20730
20731 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20732
20733         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20734         information about indexer_declarator.
20735         (indexer_declarator): Implement actions.
20736         (parsing_indexer): New local boolean used to keep track of whether
20737         we are parsing indexers or properties. This is necessary because 
20738         implicit_parameters come into picture even for the get accessor in the 
20739         case of an indexer.
20740         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20741
20742         * class.cs (Indexer): New class for indexer declarations.
20743         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20744         (TypeContainer::indexers): New member to hold list of indexers for the
20745         type.
20746
20747 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20748
20749         * cs-parser.jay (add_accessor_declaration): Implement action.
20750         (remove_accessor_declaration): Implement action.
20751         (event_accessors_declaration): Implement
20752         (variable_declarators): swap statements for first rule - trivial.
20753
20754         * class.cs (Event): New class to hold information about event
20755         declarations.
20756         (TypeContainer::AddEvent): New method to add an event to a type
20757         (TypeContainer::events): New member to hold list of events.
20758
20759         * cs-parser.jay (event_declaration): Implement actions.
20760
20761 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20762
20763         * cs-parser.jay (dim_separators): Implement. Make it a string
20764         concatenating all the commas together, just as they appear.
20765         (opt_dim_separators): Modify accordingly
20766         (rank_specifiers): Update accordingly. Basically do the same
20767         thing - instead, collect the brackets here.
20768         (opt_rank_sepcifiers): Modify accordingly.
20769         (array_type): Modify to actually return the complete type string
20770         instead of ignoring the rank_specifiers.
20771         (expression_list): Implement to collect the expressions
20772         (variable_initializer): Implement. We make it a list of expressions
20773         essentially so that we can handle the array_initializer case neatly too.
20774         (variable_initializer_list): Implement.
20775         (array_initializer): Make it a list of variable_initializers
20776         (opt_array_initializer): Modify accordingly.
20777
20778         * expression.cs (New::NType): Add enumeration to help us
20779         keep track of whether we have an object/delegate creation
20780         or an array creation.
20781         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20782         members to hold data about array creation.
20783         (New:New): Modify to update NewType
20784         (New:New): New Overloaded contructor for the array creation
20785         case.
20786
20787         * cs-parser.jay (array_creation_expression): Implement to call
20788         the overloaded New constructor.
20789
20790 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20791
20792         * class.cs (TypeContainer::Constructors): Return member
20793         constructors instead of returning null.
20794
20795 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20796
20797         * typemanager.cs (InitCoreTypes): Initialize the various core
20798         types after we have populated the type manager with the user
20799         defined types (this distinction will be important later while
20800         compiling corlib.dll)
20801
20802         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20803         on Expression Classification.  Now all expressions have a method
20804         `Resolve' and a method `Emit'.
20805
20806         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20807         generation from working.     Also add some temporary debugging
20808         code. 
20809
20810 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20811
20812         * codegen.cs: Lots of code generation pieces.  This is only the
20813         beginning, will continue tomorrow with more touches of polish.  We
20814         handle the fundamentals of if, while, do, for, return.  Others are
20815         trickier and I need to start working on invocations soon.
20816
20817         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20818         s.InitStatement. 
20819
20820         * codegen.cs (EmitContext): New struct, used during code
20821         emission to keep a context.   Most of the code generation will be
20822         here. 
20823
20824         * cs-parser.jay: Add embedded blocks to the list of statements of
20825         this block.  So code generation proceeds in a top down fashion.
20826
20827 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20828
20829         * statement.cs: Add support for multiple child blocks.
20830
20831 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20832
20833         * codegen.cs (EmitCode): New function, will emit the code for a
20834         Block of code given a TypeContainer and its ILGenerator. 
20835
20836         * statement.cs (Block): Standard public readonly optimization.
20837         (Block::Block constructors): Link children. 
20838         (Block::Child): Child Linker.
20839         (Block::EmitVariables): Emits IL variable declarations.
20840
20841         * class.cs: Drop support for MethodGroups here, delay until
20842         Semantic Analysis.
20843         (Method::): Applied the same simplification that I did before, and
20844         move from Properties to public readonly fields.
20845         (Method::ParameterTypes): Returns the parameter types for the
20846         function, and implements a cache that will be useful later when I
20847         do error checking and the semantic analysis on the methods is
20848         performed.
20849         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20850         and made a method, optional argument tells whether this is a class
20851         or a structure to apply the `has-this' bit.
20852         (Method::GetCallingConvention): Implement, returns the calling
20853         convention. 
20854         (Method::Define): Defines the type, a second pass is performed
20855         later to populate the methods.
20856
20857         (Constructor::ParameterTypes): implement a cache similar to the
20858         one on Method::ParameterTypes, useful later when we do semantic
20859         analysis. 
20860
20861         (TypeContainer::EmitMethod):  New method.  Emits methods.
20862
20863         * expression.cs: Removed MethodGroup class from here.
20864
20865         * parameter.cs (Parameters::GetCallingConvention): new method.
20866
20867 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20868
20869         * class.cs (TypeContainer::Populate): Drop RootContext from the
20870         argument. 
20871
20872         (Constructor::CallingConvention): Returns the calling convention.
20873         (Constructor::ParameterTypes): Returns the constructor parameter
20874         types. 
20875
20876         (TypeContainer::AddConstructor): Keep track of default constructor
20877         and the default static constructor.
20878
20879         (Constructor::) Another class that starts using `public readonly'
20880         instead of properties. 
20881
20882         (Constructor::IsDefault): Whether this is a default constructor. 
20883
20884         (Field::) use readonly public fields instead of properties also.
20885
20886         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20887         track of static constructors;  If none is used, turn on
20888         BeforeFieldInit in the TypeAttributes. 
20889
20890         * cs-parser.jay (opt_argument_list): now the return can be null
20891         for the cases where there are no arguments. 
20892
20893         (constructor_declarator): If there is no implicit `base' or
20894         `this', then invoke the default parent constructor. 
20895
20896         * modifiers.cs (MethodAttr): New static function maps a set of
20897         modifiers flags into a MethodAttributes enum
20898         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20899         MethodAttr, TypeAttr to represent the various mappings where the
20900         modifiers are used.
20901         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20902
20903 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20904
20905         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20906         method arguments.
20907
20908         * interface.cs (PopulateIndexer): Implemented the code generator
20909         for interface indexers.
20910
20911 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20912
20913         * interface.cs (InterfaceMemberBase): Now we track the new status
20914         here.  
20915
20916         (PopulateProperty): Implement property population.  Woohoo!  Got
20917         Methods and Properties going today. 
20918
20919         Removed all the properties for interfaces, and replaced them with
20920         `public readonly' fields. 
20921
20922 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20923
20924         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20925         initialize their hashtables/arraylists only when they are needed
20926         instead of doing this always.
20927
20928         * parameter.cs: Handle refs and out parameters.
20929
20930         * cs-parser.jay: Use an ArrayList to construct the arguments
20931         instead of the ParameterCollection, and then cast that to a
20932         Parameter[] array.
20933
20934         * parameter.cs: Drop the use of ParameterCollection and use
20935         instead arrays of Parameters.
20936
20937         (GetParameterInfo): Use the Type, not the Name when resolving
20938         types. 
20939
20940 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20941
20942         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20943         and instead use public readonly fields.
20944
20945         * class.cs: Put back walking code for type containers.
20946
20947 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20948
20949         * class.cs (MakeConstant): Code to define constants.
20950
20951         * rootcontext.cs (LookupType): New function.  Used to locate types 
20952
20953
20954 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20955
20956         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20957         this System.Reflection code is.  Kudos to Microsoft
20958
20959         * typemanager.cs: Implement a type cache and avoid loading all
20960         types at boot time.  Wrap in LookupType the internals.  This made
20961         the compiler so much faster.  Wow.  I rule!
20962
20963         * driver.cs: Make sure we always load mscorlib first (for
20964         debugging purposes, nothing really important).
20965
20966         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20967         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20968
20969         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20970         on namespaces that have been imported using the `using' keyword.
20971
20972         * class.cs (TypeContainer::TypeAttr): Virtualize.
20973         (Class::TypeAttr): Return attributes suitable for this bad boy.
20974         (Struct::TypeAttr): ditto.
20975         Handle nested classes.
20976         (TypeContainer::) Remove all the type visiting code, it is now
20977         replaced with the rootcontext.cs code
20978
20979         * rootcontext.cs (GetClassBases): Added support for structs. 
20980
20981 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20982
20983         * interface.cs, statement.cs, class.cs, parameter.cs,
20984         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20985         Drop use of TypeRefs, and use strings instead.
20986
20987 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20988
20989         * rootcontext.cs: 
20990
20991         * class.cs (Struct::Struct): set the SEALED flags after
20992         checking the modifiers.
20993         (TypeContainer::TypeAttr): new property, returns the
20994         TypeAttributes for a class.  
20995
20996         * cs-parser.jay (type_list): Oops, list production was creating a
20997         new list of base types.
20998
20999         * rootcontext.cs (StdLib): New property.
21000         (GetInterfaceTypeByName): returns an interface by type name, and
21001         encapsulates error handling here.
21002         (GetInterfaces): simplified.
21003         (ResolveTree): Encapsulated all the tree resolution here.
21004         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21005         types. 
21006
21007         * driver.cs: Add support for --nostdlib, to avoid loading the
21008         default assemblies.
21009         (Main): Do not put tree resolution here. 
21010
21011         * rootcontext.cs: Beginning of the class resolution.
21012
21013 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21014
21015         * rootcontext.cs: Provide better error reporting. 
21016
21017         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21018
21019         * rootcontext.cs (CreateInterface): Handle the case where there
21020         are no parent interfaces.
21021
21022         (CloseTypes): Routine to flush types at the end.
21023         (CreateInterface): Track types.
21024         (GetInterfaces): Returns an array of Types from the list of
21025         defined interfaces.
21026
21027         * typemanager.c (AddUserType): Mechanism to track user types (puts
21028         the type on the global type hash, and allows us to close it at the
21029         end). 
21030
21031 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21032
21033         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21034         RecordInterface instead.
21035
21036         * cs-parser.jay: Updated to reflect changes above.
21037
21038         * decl.cs (Definition): Keep track of the TypeBuilder type that
21039         represents this type here.  Not sure we will use it in the long
21040         run, but wont hurt for now.
21041
21042         * driver.cs: Smaller changes to accomodate the new code.
21043
21044         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21045         when done. 
21046
21047         * rootcontext.cs (CreateInterface):  New method, used to create
21048         the System.TypeBuilder type for interfaces.
21049         (ResolveInterfaces): new entry point to resolve the interface
21050         hierarchy. 
21051         (CodeGen): Property, used to keep track of the code generator.
21052
21053 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21054
21055         * cs-parser.jay: Add a second production for delegate_declaration
21056         with `VOID'.
21057
21058         (enum_body): Put an opt_comma here instead of putting it on
21059         enum_body or enum_member_declarations so we can handle trailing
21060         commas on enumeration members.  Gets rid of a shift/reduce.
21061
21062         (type_list): Need a COMMA in the middle.
21063
21064         (indexer_declaration): Tell tokenizer to recognize get/set
21065
21066         * Remove old targets.
21067
21068         * Re-add the parser target.
21069
21070 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21071
21072         * cs-parser.jay: Add precendence rules for a number of operators
21073         ot reduce the number of shift/reduce conflicts in the grammar.
21074
21075 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21076
21077         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21078         and put it here.
21079
21080         Get rid of old crufty code.
21081
21082         * rootcontext.cs: Use this to keep track of the parsed
21083         representation and the defined types available to the program. 
21084
21085         * gen-treedump.cs: adjust for new convention.
21086
21087         * type.cs: Split out the type manager, and the assembly builder
21088         from here. 
21089
21090         * typemanager.cs: the type manager will live here now.
21091
21092         * cil-codegen.cs: And the code generator here. 
21093
21094 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21095
21096         * makefile: Fixed up for easy making.
21097
21098 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21099
21100         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21101         the 
21102
21103         (unary_expression): Expand pre_increment_expression and
21104         post_decrement_expression to reduce a shift/reduce.
21105
21106 2001-07-11  Simon Cozens
21107
21108         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21109
21110         Improve allow_keyword_as_indent name.
21111
21112 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21113
21114         * Adjustments for Beta2. 
21115
21116 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21117
21118         * decl.cs: Added `Define' abstract method.
21119         (InTransit): new property, used to catch recursive definitions. 
21120
21121         * interface.cs: Implement `Define'. 
21122
21123         * modifiers.cs: Map Modifiers.constants to
21124         System.Reflection.TypeAttribute flags.
21125
21126         * class.cs: Keep track of types and user-defined types.
21127         (BuilderInit): New method for creating an assembly
21128         (ResolveType): New function to launch the resolution process, only
21129         used by interfaces for now.
21130
21131         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21132         that are inserted into the name space. 
21133
21134 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21135
21136         * ARGH.  I have screwed up my tree so many times due to the use of
21137         rsync rather than using CVS.  Going to fix this at once. 
21138
21139         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21140         load types.
21141
21142 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21143
21144         * Experiment successful: Use System.Type rather that our own
21145         version of Type.  
21146
21147 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21148
21149         * cs-parser.jay: Removed nsAliases from here.
21150
21151         Use new namespaces, handle `using XXX;' 
21152
21153         * namespace.cs: Reimplemented namespace handling, use a recursive
21154         definition of the class.  Now we can keep track of using clauses
21155         and catch invalid using clauses.
21156
21157 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21158
21159         * gen-treedump.cs: Adapted for all the renaming.
21160
21161         * expression.cs (Expression): this class now has a Type property
21162         which returns an expression Type.
21163
21164         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21165         `Type', as this has a different meaning now in the base
21166
21167 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21168
21169         * interface.cs, class.cs: Removed from all the sources the
21170         references to signature computation, as we can not do method
21171         signature computation during the parsing time, as we are not
21172         trying to solve at that point distinguishing:
21173
21174         class X {
21175                 void a (Blah x) {}
21176                 void a (NS.Blah x) {}
21177         }
21178
21179         Which depending on the context might be valid or not, as we do not
21180         know if Blah is the same thing as NS.Blah at that point.
21181
21182         * Redid everything so the code uses TypeRefs now instead of
21183         Types.  TypeRefs are just temporary type placeholders, that need
21184         to be resolved.  They initially have a pointer to a string and the
21185         current scope in which they are used.  This is used later by the
21186         compiler to resolve the reference to an actual Type. 
21187
21188         * DeclSpace is no longer a CIR.Type, and neither are
21189         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21190         are all DeclSpaces, but no Types. 
21191
21192         * type.cs (TypeRefManager): This implements the TypeRef manager,
21193         which keeps track of all the types that need to be resolved after
21194         the parsing has finished. 
21195
21196 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21197
21198         * ARGH.  We are going to have to store `foreach' as a class rather
21199         than resolving it, as we need to verify error 1579 after name
21200         resolution.   *OR* we could keep a flag that says `This request to
21201         IEnumerator comes from a foreach statement' which we can then use
21202         to generate the error.
21203
21204 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21205
21206         * class.cs (TypeContainer.AddMethod): we now add methods to the
21207         MethodGroup instead of the method hashtable.  
21208
21209         * expression.cs: Add MethodGroup abstraction, which gets us one
21210         step closer to the specification in the way we handle method
21211         declarations.  
21212
21213         * cs-parser.jay (primary_expression): qualified_identifier now
21214         tried to match up an identifier to a local variable reference or
21215         to a parameter reference.
21216
21217         current_local_parameters is now a parser global variable that
21218         points to the current parameters for the block, used during name
21219         lookup.
21220
21221         (property_declaration): Now creates an implicit `value' argument to
21222         the set accessor.
21223
21224 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21225
21226         * parameter.cs: Do not use `param' arguments as part of the
21227         signature, per the spec.
21228
21229 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21230
21231         * decl.cs: Base class for classes, structs and interfaces.  This
21232         is the "Declaration Space" 
21233
21234         * cs-parser.jay: Use CheckDef for checking declaration errors
21235         instead of having one on each function.
21236
21237         * class.cs: Factor out some code for handling error handling in
21238         accordance to the "Declarations" section in the "Basic Concepts"
21239         chapter in the ECMA C# spec.
21240
21241         * interface.cs: Make all interface member classes derive from
21242         InterfaceMemberBase.
21243
21244 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21245
21246         * Many things: all interfaces are parsed and generated in
21247         gen-treedump.  Support for member variables, constructors,
21248         destructors, properties, constants is there.
21249
21250         Beginning of the IL backend, but very little done, just there for
21251         testing purposes. 
21252
21253 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21254
21255         * cs-parser.jay: Fix labeled statement.
21256
21257         * cs-tokenizer.cs (escape): Escape " and ' always.
21258         ref_line, ref_name: keep track of the line/filename as instructed
21259         by #line by the compiler.
21260         Parse #line.
21261
21262 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21263
21264         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21265         to match the values in System.CodeDOM.
21266
21267         Divid renamed to Divide.
21268
21269         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21270         statements. 
21271         (Statements.set): remove.
21272
21273         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21274         statements. 
21275
21276         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21277         falseStatements always have valid values. 
21278
21279         * cs-parser.jay: Use System.CodeDOM now.
21280