2005-10-27 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2005-10-27  Marek Safar  <marek.safar@seznam.cz>
2
3         * driver.cs: Implemeted resource visibility.
4         (Resources): New class for code sharing between /res: and
5         /linkres:
6
7 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
8
9         * attribute.cs (GetPropertyValue): Made public.
10
11         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12         Resolve.
13         Add new property WrapNonExceptionThrows to handle 2.0 assembly
14         attribute.
15         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
16         is not defined.
17         
18         * driver.cs: Reflect method name change.
19         
20         * statement.cs (Try.Resolve): Warn when try has both general
21         exception handlers.
22         
23         * typemanager.cs: runtime_compatibility_attr_type new predefined
24         type.
25
26 2005-10-26  Raja R Harinath  <harinath@gmail.com>
27
28         Fix #76419.
29         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
30         treat it as an empty parameter list.
31
32 2005-10-26  Raja R Harinath  <rharinath@novell.com>
33
34         Fix #76271.     
35         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
36         ResolveAsTypeStep silent.
37         * statement.cs (Block.AddConstant): Mark block as used.
38         (Block.ResolveMeta): Avoid piling on error messages
39         if a constant initializer resolution fails.
40
41 2005-10-25  Raja R Harinath  <rharinath@novell.com>
42
43         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
44         Remove.
45         (NamespaceEntry.VerifyAllUsing): New.
46         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
47         behaviour.  Delegates actual resolution of alias to ...
48         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
49         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
50         Update.
51         * driver.cs (Driver.MainDriver): Update.
52         
53         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
54         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
55         property.
56         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
57         Remove.
58         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
59         RootNamespace.DefineNamespacesForAll.
60
61 2005-10-24  Raja R Harinath  <harinath@gmail.com>
62
63         * typemanager.cs (assemblies, external_aliases, modules)
64         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
65         (ComputeNamespaces, GetRootNamespace): Remove extra staging
66         overhead.  Move resposibility ...
67         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
68         * driver.cs, attribute.cs, codegen.cs: Update to changes.
69
70 2005-10-23  Raja R Harinath  <harinath@gmail.com>
71
72         * namespace.cs (RootNamespace.all_namespaces): Renamed from
73         cached_namespaces.  Improve usage.
74         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
75         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
76         Move from GlobalRootNamespace and simplify.
77         (RootNamespace.Global): Make instance variable.
78         (RootNamespace.RootNamespace): Add "alias name" parameter.
79         (GlobalRootNamespace): Simplify drastically.
80         (Namespace.Lookup): Don't use GetNamespace.
81         * typemanager.cs (GetRootNamespace): Rename from
82         ComputeNamespaceForAlias.
83         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
84
85 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
86
87         * anonymous.cs (AnonymousContainer): Don't crash when container
88         doesn't exist.
89
90 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
91
92         * expression.cs (Binary.DoResolve): Warn when comparing same
93         values.
94
95 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
96
97         Fix #76486.
98         * expression.cs (Binary.DoResolve): It looks like there are no
99         convetsion rules in enum context.
100
101 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
102
103         Add support for extern alias qualifiers.
104         * typemanager.cs: Move some LookupTypeReflection code
105         to namespace.cs, to have cleaner code. Added some methods
106         to help us keep track of the extern aliased references.
107         * driver.cs: Add suport for extern alias assemblies on command
108         line and check for their warnings/errors. Also keep track of the
109         extern aliased assemblies.
110         * namespace.cs: Move the global functionality of Namespace
111         to GlobalRootNamespace/RootNamespace. Now the global namespace
112         is GlobalRootNamespace.Globa. Also the code moved from 
113         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
114         Finally added LocalAliasEntry (AliasEntry before) and
115         ExternAliasEntry, to handle alias statements.
116         * cs-parser.jay: Add support in the grammar for extern alias
117         statement.
118         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
119         Update callings to Namespace (now in GlobalRootNamespace).
120
121 2005-10-18  Raja R Harinath  <rharinath@novell.com>
122
123         Fix #76371.
124         * class.cs (TypeContainer.DefineType): Move updating of
125         topological sort earlier in the code.
126         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
127
128 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
129
130         Fix #76273.
131         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
132         
133         * constant.cs (Constant.TryReduce): Moved from Cast class.
134         (Reduce): Made little bit more OO and fixed missing conversions.
135         
136         * ecore.cs (Reduce): Implemented.
137         (Binary.EnumLiftUp): New method to upgrade values to enum values.
138         
139         * literal.cs (Reduce): Implemented.
140         
141         * class.cs: Reverted Miguel's wrong commit.
142
143 2005-10-14  Miguel de Icaza  <miguel@novell.com>
144
145         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
146
147 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
148
149         * cs-parser.jay, expression.cs : CS0214 was missing error location
150           for constants. Fixed bug #76404.
151
152 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
153
154         Fix #76370.
155         * convert.cs (ExplicitConversionCore): Fixed object->enum
156         conversion.
157
158 2005-10-10  Raja R Harinath  <rharinath@novell.com>
159
160         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
161         InstanceExpression.
162         (PropertyExpr.EmitCall): Likewise.
163         * expression.cs (Invocation.EmitArguments): Handle case where
164         arguments == null.
165         (Invocation.EmitCall): Avoid allocating temporary variable if
166         there are no arguments.
167
168 2005-10-07  Raja R Harinath  <rharinath@novell.com>
169
170         Fix #76323.
171         * convert.cs (ImplicitConversionStandard): Move conversion of
172         void* to arbitrary pointer types ...
173         (ExplicitConversionStandard): .. here.
174         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
175         error to always print typenames.
176
177 2005-10-07  Raja R Harinath  <rharinath@novell.com>
178
179         * convert.cs (GetConversionOperator): Rename from
180         GetConversionOperators.  Move operator selection code from ...
181         (UserDefinedConversion): ... here.
182
183 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
184
185         * convert.cs (ExplicitConversionCore): Removed duplicate enum
186         conversion.
187
188 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
189
190         * assign.cs (Assign.DoResolve): Error method changed.
191
192         * cfold.cs (DoConstantNumericPromotions): Error method changed.
193         
194         * const.cs (ResolveValue): Reset in_transit immediately.
195         
196         * constant.cs: Error method changed.
197         
198         * convert.cs: Removed useless location parameter.
199         (ExplicitNumericConversion): Don't do double enum check.
200         (ExplicitConversionCore): Renamed from ExplicitConversion.
201         (ExplicitUnsafe): Extracted from ExplicitConversion.
202         (ExplicitConversion): Uses for error reporting.
203         
204         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
205         error messages.
206         (ResolveBoolean): Uses common error method.
207         (CastToDecimal): Get rid of ec.
208         (CastFromDecimal): Optimized.
209         (ConvCast): Get rid of ec.
210         
211         * enum.cs (ResolveValue): Reset in_transit immediately.
212         (Emit): Return after first error.
213         
214         * expression.cs: Convert changes.
215         
216         * literal.cs: Error method changed.
217         
218         * statement.cs: Error method changed.
219
220 2005-10-03  Raja R Harinath  <rharinath@novell.com>
221
222         * support.cs (SeekableStreamReader.Position): Don't error out when
223         the requested position is just beyond the end of the current
224         buffered data.
225
226 2005-09-28  Raja R Harinath  <rharinath@novell.com>
227
228         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
229         try to keep in sync with the byte count of the underlying Stream.
230         However, this limits us to a window size of 2048 characters: i.e.,
231         the maximum lookahead of our lexer/parser can be 2048 characters.
232
233 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
234
235         Fix #76255.
236         * driver.cs: Fix compilation files with full root path.
237
238 2005-09-25  Miguel de Icaza  <miguel@novell.com>
239
240         * report.cs (SymbolRelatedToPreviousError): Format the output so
241         it does not use an open parenthesis that is never closed. 
242
243         * driver.cs: Follow coding guidelines
244
245 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
246
247         Fix #72930.
248         * const.cs (Const.ResolveValue): Check for assigning non-null
249         value to reference type.
250
251 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
252
253         * anonymous.cs: Implemented ExprClassName.
254         
255         * assign.cs (Assign.DoResolve): Don't chrash when type is not
256         delegate.
257         
258         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
259         check.
260         
261         * class.cs (StaticClass.DefineContainerMembers): Report protected
262         members as error.
263         
264         * codegen.cs: if(ed) PRODUCTION.
265         
266         * convert.cs (Error_CannotImplicitConversion): Better error
267         distinction.
268         
269         * cs-parser.jay: More error checks.
270         
271         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
272         
273         * driver.cs (CSCParseOption): Enabled wrong option check.
274         
275         * ecore.cs (Expression.ExprClassName): Turned to property.
276         (MemberExpr.CheckIntermediateModification): For checking boxed
277         value types     modification.
278         
279         * statement.cs (Fixed.Resolve): Expression type must be
280         convertible to fixed type.
281         (CollectionForeach.GetEnumeratorFilter,TryType):
282         Small refactoring for easier error checking.
283
284 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
285
286         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
287         attributes.
288         
289         * class.cs (GeneratedBaseInitializer): New class for customization
290         compiler generated initializers.
291         (MemberBase.DoDefine): Check Obsolete attribute here.
292         (FieldMember.DoDefine): Ditto.
293         
294         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
295         constants.
296         
297         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
298         (MemberCore.GetObsoleteAttribute): Removed argument.
299         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
300         (MemberCore.CheckObsoleteType): New helper.
301         
302         * delegate.cs,
303         * enum.cs,
304         * statement.cs: Updates after MemberCore changes.
305         
306         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
307         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
308         
309         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
310         obsolete attribute for compiler construct.
311         (As.DoResolve): Cache result.
312         
313         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
314
315 2005-09-26  Raja R Harinath  <rharinath@novell.com>
316
317         Fix #76133.
318         * expression.cs (This.VerifyFixed): In a value type T, the type of
319         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
320         value type R, 'this' is treated as a value parameter.
321
322 2005-09-22  Miguel de Icaza  <miguel@novell.com>
323
324         * statement.cs (Lock): Use the TemporaryVariable class instead of
325         manually using local variables as those do not work when variables
326         are captured.
327
328         * ecore.cs: Moved the TemporaryVariable class from being a nested
329         class inside Foreach to be a public class that can be employed in
330         other places. 
331
332 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
333
334         * cs-parser.jay: interface_accessors replaced by
335         accessor_declarations.
336
337         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
338         location.
339         
340         * statement.cs (GotoCase.Resolve): Convert null constant to
341         null case.
342         (SwitchLabel.ResolveAndReduce): Ditto.
343         (SwitchLabel.NullStringCase): Custom null stamp.
344         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
345         
346         typemanager.cs (CSharpSignature): Don't skip first argument
347         for full names.
348
349 2005-09-18  Miguel de Icaza  <miguel@novell.com>
350
351         * driver.cs: Set InEmacs based on the environment variable EMACS. 
352
353         * location.cs (InEmacs): in this mode, do not report column
354         location as it confuses Emacs.
355
356 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
357
358         * cfold.cs, constant.cs, convert.cs, ecore.cs,
359         expression.cs, iterators.cs, literal.cs: Store constants and
360         literals location.
361         
362         * class.cs (MemberBase.ShortName): Pass location.
363         
364         * cs-parser.jay: Some location fixes.
365         
366         * ecore.cs (Expression.Location): Made virtual.
367
368 2005-09-05  Miguel de Icaza  <miguel@novell.com>
369
370         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
371         if the underlying types are the same, otherwise we need to produce
372         code that will do the proper cast.
373
374         This was exposed by Marek's constant rewrite which produced
375         invalid code for the call site:
376
377         enum X : long { a }
378         void Method (X v) {}
379
380         Method ((X) 5)
381
382         This fixes test-49.cs
383
384 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
385
386         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
387           Type/Object should be allowed as well. Fixed bug #75968.
388
389 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
390
391         * expression.cs : (Binary.DoResolve): when one is enum constant and
392           another is constant 0, then return enum one *as enum type*.
393           Fixed bug 74846.
394
395 2005-09-02  Raja R Harinath  <rharinath@novell.com>
396
397         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
398         internal.
399
400         Fix #75941.
401         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
402         flow-branching for LocalVariableReferences in case we were invoked
403         from a MemberAccess.
404         * expression.cs (LocalVariableReference.VerifyAssigned): New.
405         Carved out of ...
406         (LocalVariableReference.DoResolveBase): ... this.
407         (MemberAccess.Resolve): Do the check that was disabled during
408         SimpleNameResolve.
409
410 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
411
412         * class.cs :
413           (PartialContainer.Create): check abstract/sealed/static strictly
414           but abstract/sealed can exist only at one side. Fixed bug #75883.
415
416 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
417
418         Fix #75945.
419         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
420         specified, don't default to UnmanagedType.I4.
421
422 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
423
424         * expression.cs : conditional operator should check possibly
425           incorrect assign expression. Fixed bug #75946.
426
427 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
428
429         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
430           Reverting the change. gmcs is much complex than mcs on this matter.
431
432 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
433
434         * cs-tokenizer.cs : To read another token ahead of the actual 
435           consumption, use new SavedToken and cache token instead of moving
436           back the stream with SeekableStreamReader (it seemed problematic).
437         * cs-parser.jay,
438           driver.cs : Thus use StreamReader directly.
439         * support.cs : Thus removed SeekableStreamReader.
440
441 2005-08-30  Raja R Harinath  <rharinath@novell.com>
442
443         Fix #75934.
444         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
445         (ScopeInfo.EmitScopeType): Use it to construct field names from
446         names of captured locals.
447
448         Fix #75929.
449         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
450         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
451         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
452         (ExplicitConversion): Remove enum cases already handled by
453         implicit conversion.  Move implicit conversion check to the beginning.
454         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
455         * expression.cs (ArrayCreation.EmitDynamicInitializers):
456         Don't treat System.Enum as a struct.
457
458 2005-08-30  Jb Evain  <jbevain@gmail.com>
459
460         * attribute.cs: handles as expression in parameters.
461
462 2005-08-30  Raja R Harinath  <rharinath@novell.com>
463
464         Fix #75802.
465         * class.cs (TypeContainer.VerifyClsName): Don't use a
466         PartialContainer when verifying CLS compliance.
467         (AbstractPropertyEventMethod): Set Parent here, ...
468         (PropertyMethod): ... not here.
469
470 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
471
472         * attribute.cs : escaped attribute name should not be allowed to be
473           resolved (e.g. @class as classAttribute). Fixed bug #75930.
474
475 2005-08-29  Raja R Harinath  <rharinath@novell.com>
476
477         Fix #75927.
478         * convert.cs (ImplicitStandardConversionExists): Allow zero also
479         when converting a long constant to unsigned long.
480         * expression.cs (Invocation.OverloadResolve): Add sanity check to
481         detect where IsApplicable and VerifyArgumentsCompat disagree.
482
483 2005-08-29  Raja R Harinath  <rharinath@novell.com>
484         and Carlos Alberto Cortez  <carlos@unixmexico.org>
485
486         Fix #75848.
487         * class.cs (TypeContainer.CanElideInitializer): New helper.
488         (TypeContainer.EmitFieldInitializers): Use it to determine if we
489         can safely emitting the initializer of a field.
490
491 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
492
493         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
494           allowed inside a switch (without loop). Fixed bug #75433.
495
496 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
497
498         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
499         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
500
501 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
502
503         * driver.cs : kinda reverting the default encoding changes (not exact 
504           revert since I noticed that "codepage:reset" might not work fine).
505
506 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
507
508         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
509           Location. Now getter and setter store location correctly.
510           (errors/cs0111-12.cs now reports the expected location.)
511
512 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
513
514         * driver.cs : Use default encoding on the environment.
515           Removed (now that) extra parameter for SeekableStreamReader.
516         * support.cs : (SeekableStreamReader) third .ctor() argument for
517           StreamReader is not required (always true). preamble size could
518           be acquired in simpler and safe way.
519
520 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
521
522         * cs-parser.jay: report CS0642 at warning level 3
523           and report CS0642 for an if else statement also
524           fixes bug #74745. Patch by John Luke (and a bit
525           modified by me).
526           Removed extra CS0642 warning check for "while",
527           "for" and "fixed".
528         * statement.cs: In Block.Resolve(), CS0642 check
529           is reimplemented to check a sequence of an empty
530           statement and a block.
531
532           Both fix bug #66777.
533
534 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
535
536         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
537         detection until I fix it.
538         
539         * cs-tokenizer.cs: Changed error message.
540         
541         * cs-parser.jay: Fixed 2 error locations.
542         
543         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
544         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
545         properties.
546         
547         * enum.cs (GetSignatureForError): Fixed.
548         
549         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
550         method detection.
551         
552         * class.cs,
553         * typemanager.cs (RegisterProperty): Removed.
554         
555         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
556
557 2005-08-24  Raja R Harinath  <rharinath@novell.com>
558
559         Fix #75874.
560         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
561         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
562
563 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
564
565         * expression.cs : tiny fix is required for not warning positive ulong.
566           See test-441.cs.
567
568 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
569
570         * expression.cs : add CS0652 check for constant and integral
571           expression. Fixed bug #53974.
572
573 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
574
575         * expression.cs : in DoNumericPromotions(), check if there is implicit
576           conversion overload for string (to check CS0034). Fixed bug #52492.
577
578 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
579
580         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
581
582 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
583
584         * ecore.cs : report location when it is *not* Null.
585
586 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
587
588         * codegen.cs,
589           ecore.cs,
590           flowanalysis.cs,
591           expression.cs:
592           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
593           correctly. Fixed bug #75721.
594
595 2005-08-23  Raja R Harinath  <rharinath@novell.com>
596
597         * support.cs (SeekableStreamReader.Position): Avoid an expensive
598         loop that performs 'min (pos, char_count)'.
599
600         Fix #75862.
601         * expression.cs (Unary.ResolveOperator): Don't discard implicit
602         converted value in Operator.OnesComplement.
603
604 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
605
606         * anonymous.cs: If the anon method is pulled into a helper class,
607         it needs to be `internal' not `private'. Fixes runtime behavior on
608         msft. bug #75704
609
610 2005-08-20  Martin Baulig  <martin@ximian.com>
611
612         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
613         scope if we don't already have it.
614
615         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
616         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
617         fixes #75867.
618
619 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
620
621         Fix #75803
622         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
623         is a partial class.
624
625 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
626
627         The big constants rewrite
628         Fix #75746, #75685 and more
629         As a side effect saved 1MB for MWF ;-)
630         
631         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
632         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
633         enum based for corlib compilation.
634         
635         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
636         subtractions.
637         
638         * class.cs (FixedField.Define): Use ResolveAsConstant.
639         
640         * const.cs (IConstant): Interface constants and enums.
641         (Const.ResolveValue): New method for constant resolvning.
642         (ExternalConstant): Constants from imported assemblies.
643         
644         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
645         conversion; like enums.
646         (Constant.ToType): Converts this constant to different type.
647         (Constant.Increment): Adds 1.
648         
649         * convert.cs (ImplicitConversionRequired): Simplified.
650         
651         * cs-parser.jay: Create EnumMember directly.
652         
653         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
654         
655         * doc.cs (GenerateEnumDocComment): Removed.
656         
657         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
658         (ConvertIntLiteral): Removed.
659         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
660         
661         * enum.cs (EnumMember): Implement IConstant.
662         (Enum.IsValidEnumConstant): Removed.
663         (Enum.GetNextDefaultValue): Removed.
664         (Enum.FindMembers): Updated.
665         (Enum.GenerateDocComment): Iterate enum members.
666         
667         * expression.cs (Cast.TryReduce): Handle enums correctly.
668         (New.Constantify): Made public.
669         (MemberAccess.DoResolve): Removed contant specific if(s).
670         
671         * literal.cs (NullLiteral): Implement new abstract methods.
672         
673         * statement.cs (GotoCase.Resolve): Use new constant methods.
674         (SwitchLabel.ResolveAndReduce): Use new constant methods.
675         
676         * typemanager.cs (LookupEnum): Removed.
677         (IsEnumType): Fixed to work with corlib.
678         (RegisterConstant): Removed.
679         (LookupConstant): Removed.
680         (GetConstant): Changed to work with IConstant.
681
682 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
683
684         * location.cs : Fixed overflown (>255) column number.
685
686 2005-08-03  Raja R Harinath  <rharinath@novell.com>
687
688         First cut of the qualified-alias-member feature.
689         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
690         token.
691         * cs-parser.jay (DOUBLE_COLON): New token.
692         (namespace_or_type_name): Add rule for recognizing
693         qualified-alias-members.
694         (primary_expression): Likewise.
695         (element_access): Allow QualifiedAliasMember as a possible
696         type-bearing expression.
697         (local_variable_type, local_variable_pointer_type): Likewise.
698         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
699         aliases in the current and enclosing namespace declarations.
700         (NamespaceEntry.UsingAlias): Add CS0440 warning.
701         * decl.cs (MemberName.is_double_colon): New.
702         (MemberName.MemberName): Add new constructor for alias-member.
703         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
704         * expression.cs (QualifiedAliasMember): New expression type.
705
706 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
707
708         * location.cs : it borked when no argument was specified.
709
710 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
711
712         * location.cs : tiny ToString() format fix.
713
714 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
715
716         * statement.cs : oops, it was missing.
717
718 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
719
720         A set of fixes for precise line/column location.
721
722         * location.cs :
723           "token" field now holds a file/line "delta", a line number offset 
724           from the segment, and a column number. See also:
725           http://lists.ximian.com/pipermail/mono-devel-list/2004-
726           December/009508.html
727           Removed static IsNull. Use instance IsNull property instead.
728         * cs-tokenizer.cs :
729           For some tokens it stores Location. For Identifier it stores
730           LocatedToken which is a pair of string name and location.
731           Column numbers are adjusted only at getChar().
732         * report.cs :
733           Use Location.ToString() for reporting (it now contains column).
734         * cs-parser.jay :
735           Largely modified to use LocatedToken instead of
736           string (IDENTIFIER), and to acquire Location from some tokens.
737         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
738           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
739           codegen.cs :
740           Now MemberName holds Location. DeclSpace.ctor() receives Location
741           as a parameter. Removed extra parameters to all derived classes.
742           Replaced Location.IsNull() with instance property.
743         * assign.cs, expression.cs :
744           Added .ctor() overload that omits Location.
745         * attribute.cs :
746           Added "nameEscaped" flag that indicates the identifier was escaped
747           in the source file. This fixes bug #57047.
748
749 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
750
751         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
752         New method, looking for lo-case imported cls type.
753
754         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
755         here.
756
757         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
758
759         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
760
761         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
762         all_imported_types.
763         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
764
765         Optimized to save 3.5 MB for SWF compilation.
766
767 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
768
769         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
770         (PartialContainer.Create): Moved logic AddToContainer.
771         (PartialContainer.MarkForDuplicationCheck): Shares name.
772         
773         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
774         place.
775         
776         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
777         initialization.
778         (Namespace.GetSignatureForError): New method.
779         
780         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
781         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
782
783 2005-08-01  Raja R Harinath  <rharinath@novell.com>
784
785         Fix #75669.
786         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
787         member lookup rather than qualifier_type, since qualifier_type can
788         be null.
789
790 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
791
792         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
793         enum member.
794
795 2005-07-31  Miguel de Icaza  <miguel@novell.com>
796
797         * statement.cs: Copy the local exception into the exception
798         captured local.  Fixes 75674
799
800 2005-07-31  Raja R Harinath  <harinath@gmail.com>
801
802         Fix #75658.
803         * expression.cs (Invocation.OverloadResolve): Don't report error
804         CS1501 if error CS1502 has been reported.
805         (New.DoResolve): Delegate CS1501 reporting to
806         Invocation.OverloadResolve.
807
808         Fix #75656.
809         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
810         invariant-meaning-in-block property in an enclosing block if
811         necessary.
812
813 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
814
815         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
816         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
817         (Switch.CheckSwitch): Just save 50kb for SWF.
818
819 2005-07-27  Martin Baulig  <martin@ximian.com>
820
821         * anonymous.cs (CaptureContext.AddField): Added
822         `AnonymousContainer am' argument; compute its toplevel scope if
823         it's not already computed.  Fixes #75649.
824
825 2005-07-26  Raja R Harinath  <rharinath@novell.com>
826
827         Fix #75628.
828         * class.cs (Constructor.Emit): Reset block to null if the block
829         resolve fails.
830
831 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
832
833         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
834
835 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
836
837         * class.cs (MethodData.Define): Check whether accessor implementing
838         interface is public.
839
840         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
841
842 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
843
844         Fix #57245
845         * namespace.cs (LookupType): Moved same type check to...
846         
847         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
848         with the same name.
849
850 2005-07-21  Raja R Harinath  <rharinath@novell.com>
851
852         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
853         already found a typebuilder.
854         * class.cs (MethodCore.IsDuplicateImplementation): Compare
855         MemberNames, not strings.
856
857         * const.cs (Error_ExpressionMustBeConst): 
858         Rename from Error_EpressionMustBeConst.
859         * const.cs, class.cs, statement.cd: Update.
860
861 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
862
863         Fix #65573
864
865         * const.cs (Const.LookupConstantValue): Report missing contant expression
866         everytime.
867         (Error_EpressionMustBeConstant): Only one error method.
868
869         * class.cs, statement.c: Updated.
870
871 2005-07-20  Raja R Harinath  <rharinath@novell.com>
872
873         * statement.cs (Block.Flags): Add back HasVarargs.
874         (Block.flags): Make protected.
875         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
876
877         * typemanager.cs (types, typecontainers, user_types): Remove.
878         (UserTypes, TypeContainers): Likewise.
879         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
880         (CleanUp, Reset): Update.
881         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
882         (GetNestedType): Use Type.GetNestedType.
883         (CoreLookupType): Take two arguments, the namespace and the
884         basename of the type.  Update to use the Namespace.Lookup
885         mechanism.
886         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
887         (RealMemberLookup): Use IsNestedChildOf instead of playing with
888         string concatenation and substring matches.
889         * class.cs, enum.cs, delegate.cs: Update to changes.
890
891 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
892
893         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
894         Expression and made virtual.
895
896         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
897         (ImplicitStandardConversionExists): Fixed `byte' typo ?
898
899         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
900
901         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
902         error message.
903
904         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
905         change.
906
907 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
908
909         Fix #57707
910         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
911         AssemblyCultureAttribute is not used on executable.
912
913         * rootcontext.cs,
914         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
915
916 2005-07-16  Raja R Harinath  <rharinath@novell.com>
917
918         Fix #60638.
919         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
920         New.  Reports CS0252/CS0253.
921         Mostly taken from preliminary patch by Duncak Mak.
922         (Binary.DoResolveOperator): Store results of operator lookup.
923         Use them to detect if we need to warn about unintended reference
924         comparisons.
925
926 2005-07-15  Raja R Harinath  <rharinath@novell.com>
927
928         Fix #72969.
929         * namespace.cs (Namespace.Lookup): Add back location parameter.
930         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
931         * delegate.cs, ecore.cs, expression.cs: Update to changes.
932
933         * codegen.cs (EmitContext.DeclSpace): Make readonly.
934         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
935         (Namespace.LookupType): ... this.
936         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
937         of namespaces.
938         * typemanager.cs (LookupTypeReflection): Remove buggy code that
939         purported to handle pointers.
940         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
941         CoreLookupType.
942
943 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
944
945         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
946         type as namespace.
947
948 2005-07-15  Raja R Harinath  <rharinath@novell.com>
949
950         * namespace.cs (Namespace.Lookup): Drop location parameter.
951         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
952         (NamespaceEntry.Lookup): ... this.
953         (NamespaceEntry.Error_AmbiguousTypeReference):
954         Move here from DeclSpace.
955         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
956         names ...
957         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
958         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
959         Move to NamespaceEntry.
960         * delegate.cs, expression.cs: Update to changes.
961
962 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
963
964         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
965         CheckAttributeType and refactored.
966         (Attribute.ResolvePossibleAttributeType): Changed to reuse
967         ResolveAsTypeTerminal error handling.
968         (ResolveAsTypeTerminal): Introduced because of global attributes extra
969         handling.
970         (GetSignatureForError): Print errors in same way.
971
972         * class.cs,
973         * codegen.cs: Reflect attribute GetSignatureForError change.
974
975         * ecore.cs,
976         * expression.cs: Add silent parameter to ResolveAsTypeStep.
977
978         * namespace.cs (UsingEntry): Refactored to make fields private.
979
980         * assign.cs,
981         statement.cs: Error_UnexpectedKind has extra parameter.
982
983 2005-07-14  Raja R Harinath  <rharinath@novell.com>
984
985         * ecore.cs (IAlias): Remove.
986         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
987         that implement the interface.
988         * namespace.cs (Namespace): Likewise.
989         (Namespace.declspaces): Renamed from 'defined_names'.
990         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
991         DeclSpace instead of an IAlias.
992         * tree.cs (Tree.AddDecl): Update.
993
994 2005-07-12  Raja R Harinath  <rharinath@novell.com>
995
996         * statement.cs (Block.Flags); Remove HasVarargs.
997         (Block.HasVarargs): Move to ToplevelBlock.
998         (Block.ThisVariable, Block.AddThisVariable): Likewise.
999         (Block.Variables): Make protected.  Initialize variable hashtable
1000         if necessary.
1001         (Block.AddVariable): Update.
1002         (Block.Resolve): Update to changes.
1003         (ToplevelBlock.HasVarargs): New boolean.
1004         (ToplevelBlock.ThisVariable): Move here from Block.
1005         (ToplevelBlock.AddThisVariable): Likewise.
1006         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1007         * expression.cs (This.ResolveBase): Update to changes.
1008         (ArglistAccess.DoResolve): Likewise.
1009
1010 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1011
1012         Fix #75321
1013         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1014
1015         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1016         not used and not used & assigned.
1017         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1018
1019 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1020
1021         Fix #75053
1022         * expression.cs (Is.DoResolve): null is never provided type.
1023
1024 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1025
1026         Fix #52496
1027         * cs-parser.jay: Less strict event error rule to catch more errors.
1028
1029 2005-07-08  Martin Baulig  <martin@ximian.com>
1030
1031         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1032         gettter (allowed) or setter (not allowed).
1033
1034         * class.cs (Accessor): Implement IIteratorContainer.
1035         (Accessor.Yields): New public field.
1036         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1037         per-accessor basis.
1038
1039         * cs-parser.jay
1040         (get_accessor_declaration, set_accessor_declaration): Set the
1041         `yields' flag on the accessor, not the property.
1042         (property_declaration): Do the iterators check on a per-accessor
1043         basis and not for the whole property.
1044
1045 2005-07-08  Martin Baulig  <martin@ximian.com>
1046
1047         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1048         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1049
1050 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1051
1052         Fix #74975
1053         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1054         (ExtractSecurityPermissionSet): Cope with self referencing security
1055         attributes properly.
1056
1057         * driver.cs (SetOutputFile): Made public property OutputFile.
1058
1059 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1060
1061         Fix #75486.
1062         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1063         has_nonstatic_fields.  Make into a FieldBase pointer.
1064         (TypeContainer.AddField): Add CS0282 check.
1065         (TypeContainer.EmitType): Update.
1066
1067 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1068
1069         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1070         compare if they start with __.
1071
1072 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1073
1074         * statement.cs (Switch.SwitchGoverningType): Only look at
1075         UserCasts that don't need implicit standard conversions to one of
1076         the allowed switch types (Fixes test-322.cs).
1077         (LocalInfo.Resolve): Re-enable sanity-test.
1078
1079 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1080
1081         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1082         
1083         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1084         
1085         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1086
1087 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1088
1089         Fix #75472.
1090         * ecore.cs (SimpleName.GetSignatureForError): Add.
1091         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1092         (MemberAccess.GetSignatureForError): Add.
1093
1094 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1095  
1096         The big error and warning messages review.
1097         
1098         * anonymous.cs,
1099         * assign.cs,
1100         * attribute.cs,
1101         * class.cs,
1102         * codegen.cs,
1103         * convert.cs,
1104         * cs-parser.jay,
1105         * cs-tokenizer.cs,
1106         * decl.cs,
1107         * delegate.cs,
1108         * doc.cs,
1109         * driver.cs,
1110         * ecore.cs,
1111         * enum.cs,
1112         * expression.cs,
1113         * flowanalysis.cs,
1114         * iterators.cs,
1115         * literal.cs,
1116         * location.cs,
1117         * modifiers.cs,
1118         * namespace.cs,
1119         * parameter.cs,
1120         * pending.cs,
1121         * report.cs,
1122         * rootcontext.cs,
1123         * statement.cs,
1124         * support.cs,
1125         * tree.cs,
1126         * typemanager.cs: Updated.
1127         
1128         * class.cs: (MethodCore.SetYields): Moved here to share.
1129         (PropertyMethod.Define): Moved iterator setup here.
1130         
1131         * iterators.cs: Add orig_method to have full access to parent
1132         container.
1133
1134 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1135
1136         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1137         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1138         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1139         variable of struct type.
1140         * expression.cs (Unary.ResolveOperator): Update to change.
1141         (Indirection.VerifyFixed): Likewise.
1142         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1143         (ParameterReference.VerifyFixed): Value parameters are fixed.
1144         (This.VerifyFixed): Treat 'this' as a value parameter.
1145         * statement.cs (LocalInfo.IsFixed): Remove.
1146
1147 2005-07-01  Martin Baulig  <martin@ximian.com>
1148
1149         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1150         `ec.EmitThis ()' to get the correct scope.
1151
1152 2005-07-01  Martin Baulig  <martin@ximian.com>
1153
1154         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1155         instance is a ParameterReference; fixes #75299.
1156
1157 2005-07-01  Martin Baulig  <martin@ximian.com>
1158
1159         Reverted Marek's latest patch (r46725):
1160         - it contains structural changes which are neither mentioned in
1161           the ChangeLog nor explained anywhere; for example the additional
1162           argument of EmitContext's and Iterator's .ctor's and the
1163           TypeContainer.DefineMembers() change.
1164         - structural changes like this should go in in seperate patches
1165           and not be hidden in a huge patch which just seems to affect
1166           warnings and errors.
1167           a big and hard to understand patch.
1168         - it breaks iterators and causes regressions, for instance in
1169           test-iter-03.cs.      
1170
1171 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1172
1173         Fix #75412.
1174         * expression.cs (Indexers.map): Remove.
1175         (Indexers.Append): Filter out inaccessible setters and getters.
1176         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1177
1178         Fix #75283.
1179         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1180         Refactored from ...
1181         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1182         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1183         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1184         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1185
1186 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1187
1188         Fix #75322
1189         * class.cs (FieldBase.GetInitializerExpression): One more field
1190         for backup.
1191
1192 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1193
1194         * pending.cs: Do not define a proxy if the base method is virtual,
1195         it will be picked up by the runtime (bug 75270).
1196
1197 2005-06-08  Martin Baulig  <martin@ximian.com>
1198
1199         The big Iterators rewrite :-)
1200
1201         * iterators.cs: Rewrite this to use the anonymous methods framework.
1202
1203         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1204         before the TypeContainers; see 2test-21.cs.
1205
1206         * class.cs
1207         (TypeContainer.DefineType): Don't create a new EmitContext if we
1208         already have one (this only happens if we're an Iterator).
1209         (TypeContainer.Define): Also call Define() on all our iterators.
1210         (Method.CreateEmitContext): Added support for iterators.
1211
1212         * anonymous.cs
1213         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1214         (AnonymousContainer.CreateMethodHost): Moved here from
1215         AnonymousMethod and made abstract.
1216         (AnonymousContainer.CreateScopeType): New abstract method.
1217         (AnonymousContainer.IsIterator): New public property.
1218         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1219         get the ScopeTypeBuilder rather than manually defining it here. 
1220         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1221         iterators here.
1222
1223         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1224         before RootContext.DefineTypes().
1225
1226         * codegen.cs (EmitContext.RemapToProxy): Removed.
1227         (EmitContext.CurrentAnonymousMethod): Changed type from
1228         AnonymousMethod -> AnonymousContainer.
1229         (EmitContext.ResolveTopBlock): Protect from being called twice.
1230         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1231         (EmitContext.EmitThis): Removed the iterators hacks; use the
1232         anonymous methods framework for that.
1233
1234         * statement.cs
1235         (ToplevelBlock.Container): Make this a property, not a field.
1236         (ToplevelBlock.ReParent): New public method; move the
1237         ToplevelBlock into a new container.
1238         (Foreach.TemporaryVariable): Simplify.
1239
1240 2005-06-05  Martin Baulig  <martin@ximian.com>
1241
1242         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1243         (Block.AddTemporaryVariable): New public method; creates a new
1244         `LocalInfo' for a temporary variable.
1245         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1246         variables here.
1247         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1248         non-iterator variables.
1249
1250 2005-06-05  Martin Baulig  <martin@ximian.com>
1251
1252         * statement.cs (Foreach.TemporaryVariable): Create the
1253         LocalBuilder in the Emit phase and not in Resolve since in some
1254         situations, we don't have an ILGenerator during Resolve; see
1255         2test-19.cs for an example.
1256
1257 2005-06-04  Martin Baulig  <martin@ximian.com>
1258
1259         **** Merged r45395 from GCS ****
1260
1261         The big Foreach rewrite - Part II.
1262
1263         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1264         with `PropertyInfo ienumerator_getcurrent'.
1265
1266         * codegen.cs (VariableStorage): Removed.
1267
1268         * statement.cs
1269         (Foreach): Derive from Statement, not ExceptionStatement.
1270         (Foreach.CollectionForeach): New nested class.  Moved all the code
1271         dealing with collection foreach here.
1272         (Foreach.ForeachHelperMethods): Removed.
1273         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1274
1275 2005-05-23  Martin Baulig  <martin@ximian.com>
1276
1277         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1278         don't need to.  Fix #75014.
1279
1280 2005-05-20  Martin Baulig  <martin@ximian.com>
1281
1282         Merged r44808 from GMCS.
1283
1284         * class.cs (TypeContainer.CircularDepException): Removed.
1285         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1286         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1287         (CS0146) and interface (CS0529) dependencies here.
1288
1289 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1290
1291         * expression.cs (Invocation.EmitCall): Fix initialization
1292         'this_call' to reflect current behaviour.  Fix indentation.
1293
1294         * convert.cs (FindMostEncompassedType): Add two trivial special
1295         cases (number_of_types == 0 || number_of_types == 1).
1296         (FindMostEncompasingType): Likewise.
1297
1298 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1299
1300         Some cleanups preparing for the fix of #75283.
1301         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1302         error testing.
1303         (EventExpr.InstanceResolve): Likewise.
1304         (EventExpr.DoResolve): Remove redundant checks.
1305
1306 2005-06-10  Duncan Mak  <duncan@novell.com>
1307
1308         * cs-tokenizer.cs (process_directives): New flag for controlling
1309         the processing of preprocessor directives.
1310         (x_token): After seeing a '#', return Token.NONE instead of going
1311         to handle_preprocessing_directive() when not processing
1312         directives. This avoids unnecessary processing during the token peek in
1313         is_punct().
1314
1315         This fixes #74939.
1316
1317         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1318         the existing error reporting methods instead of Report.Error.
1319
1320         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1321         after Raja's rewrite.
1322
1323 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1324
1325         * class.cs: Small fix.
1326
1327 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1328
1329         Fix #75160.
1330         * class.cs (GetPartialBases): Fix return value check of
1331         part.GetClassBases.
1332
1333 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1334
1335         Ensure that partial classes are registered in their enclosing
1336         namespace.  Initial part of fix of #75160.
1337         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1338         Register declspace with namespace here, not in
1339         DeclSpace.RecordDecl.
1340         * cs-parser.jay: Pass namespace to RecordDecl.
1341         * class.cs (PartialContainer.Create): Likewise.
1342         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1343         called.
1344         * decl.cs (Declspace.RecordDecl): Remove.
1345         * namespace.cs (NamespaceEntry.DefineName): Remove.
1346
1347 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1348
1349         * rootcontext.cs: Reset TargetExt as well.
1350
1351 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1352
1353         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1354         -langversion:ISO-1.
1355
1356 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1357
1358         Fix #75080, cs0119.cs.
1359         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1360         of ...
1361         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1362         allowing ExprClass.Type and ExprClass.Namespace for
1363         ResolveFlags.VariableOrValue.
1364         (Expression.Resolve) [1-argument variant]: Change default resolve
1365         flags based on language version.
1366         (Expression.Error_UnexpectedKind): Use a simple string array
1367         rather than an ArrayList.
1368         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1369         not ExprClass.Type.
1370         (TypeOfVoid.DoResolve): Likewise.
1371         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1372         flags argument -- it always has the same value.
1373
1374 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1375
1376         Fix #75081.
1377         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1378         Use it in the error message.
1379         * assign.cs, expression.cs, statement.cs: Update.
1380
1381 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1382
1383         Fix #75088.
1384         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1385         the "almostMatchedMember" case too.
1386         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1387         that failed the accessibility checks to 'almost_match'.
1388
1389 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1390
1391         * attribute.cs: Use internal MethodBuilder methods to set
1392         ExactSpelling and SetLastError on PInvoke methods, instead
1393         of passing them via charset.  Fixes #75060.
1394
1395 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1396
1397         * parameter.cs (Parameter): Remove TODO comment.
1398         (Parameter.DefineParameter): Remove Location parameter.
1399         (Parameters.LabelParameters): Likewise.
1400         * class.cs (Constructor.Emit): Update to change.
1401         (MethodData.Emit): Likewise.
1402         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1403         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1404
1405 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1406
1407         * parameter.cs,
1408           Removed Parameters.Location and added Parameter.Location instead.
1409           Removed Location parameter from Emit() and GetSignature().
1410         * anonymous.cs,
1411           class.cs,
1412           cs-parser.jay,
1413           delegate.cs,
1414           iterators.cs,
1415           statement.cs :
1416           Modified all related calls.
1417
1418 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1419
1420         Improve user-defined conversion handling.
1421         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1422         applicable operators.
1423         (AddConversionOperators): New.  Helper for GetConversionOperators.
1424         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1425         there is only one most encompassed/encompassing type.
1426         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1427         "applicable operator" handling.
1428         (UserConversion): Move cache here from GetConversionOperators.
1429         Directly cache the chosen operator, rather than the whole
1430         MethodGroup.
1431         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1432         case.  Allow conversion of decimal to sbyte and byte too.
1433         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1434         New static methods.  Used to avoid allocating EmptyExpressions in
1435         convert.cs.
1436
1437 2005-05-24  Duncan Mak  <duncan@novell.com>
1438
1439         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1440         another class, used in Convert.ExplicitNumericConversion.
1441         (CastToDecimal): New class, similar to above, but casts to
1442         System.Decimal, used in Convert.ImplicitNumericConversion and also
1443         in explicit convesion from double/float to decimal.
1444
1445         * convert.cs (ImplicitNumericConversion): Handle implicit
1446         conversions to System.Decimal.
1447         (ExplicitNumericConversion): handle explicit conversions to
1448         System.Decimal.
1449
1450         This fixes #68711.
1451         
1452 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1453
1454         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1455         know the type at this stage, just break through.   Fixes #75008 
1456
1457 2005-05-19  Martin Baulig  <martin@ximian.com>
1458
1459         * delegate.cs
1460         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1461         to disable error reporting.
1462
1463         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1464         here since we don't want to report an error; see the new test-336.cs.
1465
1466 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1467
1468         * statement.cs (ToplevelBlock.GetParameterReference)
1469         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1470         Move here from class Block.
1471         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1472         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1473
1474 2005-05-18  Martin Baulig  <martin@ximian.com>
1475
1476         Fix #74978.
1477
1478         * flowanalysis.cs
1479         (FlowBranching.Reachability): Add non-static public And() and Or()
1480         methods.
1481         (FlowBranchingSwitch): New class; do the `break_origins' thing
1482         like in FlowBranchingLoop.
1483         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1484         reachability, not just locals and parameters.
1485         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1486         switch; MergeBreakOrigins() now takes care of that.
1487
1488 2005-05-18  Martin Baulig  <martin@ximian.com>
1489
1490         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1491         a loop and may leave it, reset the barrier; fixes #74974.
1492
1493 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1494         
1495         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1496         is back.
1497         
1498         * cs-parser.jay: Catch more lexical errors.
1499         
1500         * report.cs: Add one more Error method.
1501         
1502         * rootcontext.cs,
1503         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1504
1505 2005-05-17  Martin Baulig  <martin@ximian.com>
1506
1507         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1508         #70970. 
1509
1510 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1511
1512         Fix test-382.cs.  Emit values of decimal constants.
1513         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1514         Carved out of ...
1515         (TypeContainer.AddField): ... this.
1516         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1517         with initializers to include 'Const's.
1518         (ClassPart.RegisterFieldForInitialization): Forward to
1519         PartialContainer.
1520         * const.cs (Const.Const): Pass initializer to base class.
1521         (Const.Define): In case of decimal constants, register them for
1522         initialization in a static constructor.
1523
1524 2005-05-14  Martin Baulig  <martin@ximian.com>
1525
1526         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1527         do not call ResolveUnreachable() on unreachable statements in
1528         here, see the comment in the source code.
1529
1530 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1531
1532         Fix #74934.
1533         * expression.cs (BinaryResolveOperator): If one of the operands of
1534         an equality comparison is 'null' and the other is a pointer type,
1535         convert the null to a NullPointer.
1536         * convert.cs (ImplicitReferenceConversion): If the expression is a
1537         NullLiteral and the target type is a pointer type, return a
1538         NullPointer instead.
1539         (ImplicitConversionStandard): Likewise.
1540
1541 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1542         
1543         * cs-parser.jay: Set readonly context based on special constructs.
1544         
1545         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1546         readonly variable error handling.
1547         
1548         * rootcontext.cs (EmitCode): Don't verify members when error
1549         occurred.
1550         
1551         * statement.cs (LocalInfo): Add reaodnly context information.
1552         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1553
1554 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1555
1556         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1557         for #74041 to initialize 'resolved' to false only for explicit
1558         blocks.  Fixes #74873.
1559
1560 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1561
1562         Fix #74920.
1563         * typemanager.cs (unmanaged_enclosing_types): New.
1564         (IsUnmanagedType): Avoid infloops by using
1565         'unmanaged_enclosing_types' to talk with recursive invocations.
1566
1567 2005-05-13  Martin Baulig  <martin@ximian.com>
1568
1569         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1570         instance variable, not a local.  Fix #74873.
1571         (Block.ResolveUnreachable): Set it to true here.
1572
1573 2005-05-11  Duncan Mak  <duncan@novell.com>
1574
1575         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1576         continuing to process for 'arg'.
1577         (handle_preprocessing_directive): Check the argument of the #endif
1578         directive and report error CS1025 if there are any trailing
1579         characters.
1580
1581         According to the C# spec, having even whitespace after the #endif
1582         directive is illegal; however, because we call arg.TrimEnd ()
1583         beforehand, we have the same behavior as csc, allowing whitespace
1584         after the directive.
1585
1586         Fixes #74892.
1587
1588 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1589
1590         Fix #74863.
1591         
1592         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1593         (Constructor.GetObsoleteAttribute): Implemented correctly.
1594
1595 2005-05-10  Martin Baulig  <martin@ximian.com>
1596
1597         * support.cs (ReflectionParameters.ParameterModifier): Use
1598         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1599         and `ParameterAttributes.In'.  Fixes #74884.
1600
1601 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1602
1603         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1604         
1605         * expression.cs (Argument.GetParameterModifier): Turned to property.
1606         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1607         
1608         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1609         its C# equivalent.
1610         
1611 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1612
1613         Fix #74852.
1614         * decl.cs (MemberCache.AddMethods): Register override methods,
1615         rather than non-override methods.
1616         * typemanager.cs (RegisterOverride): New.
1617         (IsOverride): Update.
1618
1619 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1620
1621         Fix #73105.
1622         
1623         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1624         recursive declaration.
1625         
1626         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1627         
1628 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1629
1630         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1631         
1632         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1633
1634 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1635
1636         Fix #74797.
1637         * decl.cs (DeclSpace.FamilyAccessible): 
1638         Use TypeManager.IsNestedFamilyAccessible.
1639
1640         Fix reopened #64812.
1641         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1642         internal'.
1643
1644 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1645             Abin Thomas  <projectmonokochi@rediffmail.com>
1646             Anoob V E  <projectmonokochi@rediffmail.com>
1647             Harilal P R  <projectmonokochi@rediffmail.com>
1648
1649         Fix #64812.
1650         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1651         allow access to all static members.
1652
1653 2005-05-04  Martin Baulig  <martin@ximian.com>
1654
1655         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1656
1657 2005-05-04  Martin Baulig  <martin@ximian.com>
1658
1659         Fix #74655.
1660
1661         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1662         section at the end; make things work if `default' is not the last
1663         section.        
1664
1665 2005-05-04  Martin Baulig  <martin@ximian.com>
1666
1667         Fix #70400.
1668
1669         * statement.cs (Switch): Replaced the `got_default' field with a
1670         `default_section' one.
1671         (Switch.CheckSwitch): Set `default_section' here.
1672         (Switch.Resolve): If we're a constant switch and the constant is
1673         not found, use the default section.
1674
1675 2005-05-03  Martin Baulig  <martin@ximian.com>
1676
1677         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1678
1679         * statement.cs (Foreach.ArrayForeach): New nested class.
1680         (Foreach.TemporaryVariable): New nested class.
1681         (Foreach.EmitArrayForeach): Removed; this is now in the new
1682         ArrayForeach class.
1683
1684 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1685
1686         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1687         more conservative.
1688         (VerifyPendingMethods): Revert change below.
1689
1690         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1691         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1692         that used to trigger warning -28.  Remove warning -28.
1693         * expression.cs (Invocation.OverloadResolve): Use
1694         TypeManager.IsOverride to distinguish override methods.
1695
1696         Fix #74773.
1697         * pending.cs (VerifyPendingMethods): If a base type implements the
1698         requested interface, don't bother checking individual methods of
1699         the base type.  As a side-effect, this prevents the creation of
1700         unnecessary proxies.
1701
1702 2005-05-02  Martin Baulig  <martin@ximian.com>
1703
1704         Fix #70182.
1705
1706         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1707         Also `And' the locals if the old vector is null.
1708         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1709         null; in this case we basically reset all the variables.        
1710
1711 2005-05-02  Martin Baulig  <martin@ximian.com>
1712
1713         Fix #74529.
1714
1715         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1716         Added `FlowBranching branching' argument; always `and' the
1717         variables instead of `or'ing them unless we're an infinite loop.
1718
1719         * statement.cs (While.Resolve): Create a new sibling unless we're
1720         infinite.       
1721
1722 2005-05-02  Martin Baulig  <martin@ximian.com>
1723
1724         Fix #70140.
1725
1726         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1727         arguments; use it instead of creating a new TopLevelBlock.
1728         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1729         our ConstructorInitializer.
1730
1731         * statement.cs
1732         (TopLevelBlock.TopLevelBranching): New public property.
1733         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1734         and create our `TopLevelBranching'.
1735
1736         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1737         anonymous method host, use `block.TopLevelBranching' rather than
1738         creating a new branching.
1739
1740 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1741
1742         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1743         a ScopeInfo, if any of the current children is a child of the new
1744         entry, move those children there.
1745
1746 2005-04-30  Martin Baulig  <martin@ximian.com>
1747
1748         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1749         at the beginning of a SwitchSection.  Fix #73335.
1750
1751 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1752
1753         Fix #74378
1754         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1755         
1756         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1757         (FieldExpr.DoResolve): Obsolete members are ignored for field
1758         initializers.
1759         
1760 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1761
1762         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1763         of arrays detection.
1764
1765         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1766         verification.
1767         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1768
1769         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1770         arrays report.
1771
1772 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1773
1774         * cs-parser.jay: Use the prefered version of -unsafe in error
1775         message.
1776
1777 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1778
1779         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1780         circumstances.
1781
1782 2005-04-20  John Luke  <john.luke@gmail.com>
1783
1784         * driver.cs: fix typo in error message, --outout to --output
1785
1786 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1787
1788         * codegen.cs (InRefOutArgumentResolving): New field.
1789         
1790         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1791         fields outside contructor.
1792         
1793         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1794         
1795 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1796
1797         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1798         parameter code was not completed ever, so it was not as up-to-date
1799         as local variables.  Must finish it.
1800
1801         The bug fix was to compare the Toplevel of the block, not the
1802         current block.  Thanks for Ben for pointing this out. 
1803
1804 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1805
1806         * decl.cs (AddMethods): Use the declaring type of the problem
1807         method to determine if we want to squash a warning.
1808
1809 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1810
1811         * attribute.cs: Removed debug output.
1812
1813         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1814         
1815         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1816         Report.Stderr.
1817         
1818 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1819
1820         Fix #74481.
1821         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1822         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1823         all null comparisons against reference types.
1824
1825 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1826
1827         Fix# 74565
1828         * class.cs (TypeContainer.CircularDepException) New nested
1829         exception class.
1830         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1831         (TypeContainer.DefineType): Removed error, reset InTransit before
1832         exit.
1833         (Class.DefineType): Throw exception when is in Transit.
1834         Catch exception and report error.
1835         (Struct.DefineType): Throw exception when is in Transit.
1836         Catch exception and report error.
1837         (Interface.DefineType): Throw exception when is in Transit.
1838         Catch exception and report error.
1839
1840         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1841         handle nested exception handlers.
1842
1843         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1844         a catch.
1845
1846         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1847         InFinally and InCatch storage.
1848
1849         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1850         (Catch.Resolve): Set and Restore ec.InCatch.
1851         (Try.Resolve): Set and Restore ec.InFinally.
1852         (Try.HasCatch): True when try has catch.
1853
1854 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1855
1856         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1857           for the same event member, so exclude such cases from warning 419.
1858           Fixed bug #74633.
1859
1860 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1861
1862         * expression.cs (Binary.ResolveOperator): Apply patch from John
1863         Luke to fix bug 59864: operators &, | and ^ on enumerations
1864         require that the same enum type on both sides.
1865
1866         * driver.cs: Add warnings to old flag usage, this is to assist
1867         people who produce Makefiles and hope that the Makefiles will be
1868         used on Windows.
1869
1870         * class.cs (TypeContainer.EmitType): Moved the definition of the
1871         special $PRIVATE$ field from the resolve phase to the Emit phase.
1872         During resolve we do not know if we are a struct with
1873         HasExplicitLayout, we know this only after the attributes for the
1874         type are emitted.
1875
1876         Set the FieldOffset to zero on the dummy field that we create for
1877         the class.   Fixes 74590.
1878
1879 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1880
1881         Fix #73834.
1882         * ecore.cs (PropertyExpr.resolved): New.
1883         (DoResolve): Use it to handle a case of double resolution here.
1884         Handle a case of identical-name-and-type-name.
1885         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1886         resolution by storing the results of expression resolution back
1887         into the "probes" array.
1888
1889 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1890
1891         Fix cs0208-7.cs and cs0208-8.cs.
1892         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1893         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1894         error reporting to point out the reason a struct is not unmanaged.
1895
1896 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1897
1898         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1899           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1900
1901 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1902
1903         Fix #74528.
1904         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1905         IdenticalNameAndTypeName here.
1906         (EventExpr.InstanceResolve): Likewise.
1907
1908 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1909
1910         C# 2.0 DefaultCharSetAttribute implementation
1911         
1912         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1913         which allows us to set GlobalNamespace for every resolve.
1914         (Attribute.ResolveArguments): Cut from Resolve.
1915         (Attribute.GetCharSetValue): Returns CharSet named argument.
1916         (Attribute.DefinePInvokeMethod): Gets default charset from
1917         module settings.
1918         (GlobalAttribute.ResolveAsTypeStep): Override.
1919         (GlobalAttribute.ResolveArguments): Override.
1920         
1921         * class.cs (TypeAttr): Is protected.
1922         
1923         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1924         (ModuleClass.DefaultCharSetType): New memeber.
1925         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1926         
1927         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1928         charset from module.
1929         
1930         * delegate.cs (TypeAttr): Override.
1931         (Delegate.DefineType): Use this TypeAttr.
1932         
1933         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1934         at very early stage (before types are defined) to resolve model
1935         module attributes. It will probably not work with corlib but it
1936         should be ok.
1937         
1938         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1939         charset from module.
1940         
1941         * typemanager.cs (default_charset_type): New type.
1942
1943 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1944
1945         * decl.cs (MemberCache.AddMethods): Don't warn if
1946         System.Object.Finalize has buggy MethodAttributes.
1947
1948         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1949         removed below.
1950
1951 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1952
1953         * doc.cs : detect ambiguous reference to overloaded members.
1954           Fixed bug #71603. MS 1.1 csc does not detect it.
1955
1956 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1957
1958         * doc.cs : delegates must not be referenced with parameters.
1959           Fixed bug #71605.
1960
1961 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1962
1963         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1964
1965 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1966
1967         * driver.cs (MainDriver): Stop processing if the CLS stage found
1968         errors. 
1969
1970         (CompilerCallableEntryPoint.InvokeCompiler): Always
1971         reset after execution;   Take a TextWriter argument for the
1972         output.
1973
1974         * report.cs: Use the error stream instead of hardcoding stderr. 
1975
1976 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1977
1978         * class.cs: Reduce code paths to test, too small of an
1979         optimization to make it worth the extra testing.  Always perform
1980         it. 
1981
1982 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1983
1984         Fix #74510.
1985         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1986         operators that had errors reported on them.
1987
1988 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1989
1990         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1991         argument types.
1992         (Attribute.Resolve): Add named argument type checking.
1993         
1994         * class.cs (FixedField.Define): Use IsPrimitiveType
1995         
1996         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1997         
1998         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1999         unsafe parameter types.
2000         
2001         * statement.cs (Using.ResolveExpression): Add better error description.
2002         
2003         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2004         
2005 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2006
2007         Fix #74484.
2008         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2009         AttributeUsageAttribute in the emitcontext of the attribute class,
2010         not in the emitcontext of the attributable entity it was attached to.
2011         * cs-parser.jay: Use 'current_class', not 'current_container',
2012         when creating a GlobalAttribute.
2013
2014 2005-04-08  Alp Toker  <alp@atoker.com>
2015
2016         * pending.cs: The fix to #58413 failed to compile methods implementing
2017         interfaces with/without params modifiers and vice versa, even though
2018         params modifiers aren't part of the signature. Make the modifier check
2019         less strict as in csc.
2020
2021 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2022             Anoob V E  <projectmonokochi@rediffmail.com>
2023             Harilal P R  <projectmonokochi@rediffmail.com>
2024
2025         Fix #58413.
2026         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2027         modifiers of pending methods.
2028         (PendingImplementation.PendingImplementation): Initialize it.
2029         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2030         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2031         with ParameterData.  Add check for modifiers.
2032         * class.cs (MethodData.Define): Update to changes.
2033
2034 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2035
2036         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2037
2038 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2039
2040         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2041         property.
2042         
2043         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2044         
2045         * rootcontext.cs,
2046         * typemanager.cs: Registered RequiredAttributeAttribute.
2047         
2048 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2049
2050         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2051         Warning CS0169 is back at level 3.
2052         (IMethodData.SetMemberIsUsed): New method.
2053         
2054         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2055         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2056         
2057         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2058
2059         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2060         contants.
2061         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2062         is used.
2063         
2064         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2065         is used.
2066         
2067         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2068         to avoid the problems with nested types.
2069
2070 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2071             Anoob V.E  <projectmonokochi@rediffmail.com>
2072             Harilal P.R  <projectmonokochi@rediffmail.com>
2073             Raja R Harinath  <rharinath@novell.com>
2074
2075         Fix #73820.
2076         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2077         attribute.
2078         * typemanager (GetConstructor): Make public.
2079
2080 2005-04-05  John Luke  <john.luke@gmail.com>
2081             Raja R Harinath  <rharinath@novell.com>
2082
2083         Fix #62232.
2084         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2085         struct too.  Return false quicker in a few cases.
2086         (VerifyUnManaged): Use it.
2087
2088 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2089
2090         Fix #74041.
2091         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2092         not 'unreachable_seen'.
2093
2094 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2095
2096         * attribute.cs (Attribute.GetValue): Removed unused.
2097         
2098         * codegen.cs (CodeGen.TrimExt): Removed unused.
2099         
2100         * cs-parser.jay (output): Removed unused.
2101         
2102         * cs-tokenizer.cs (hex_digits): Removed unused.
2103         
2104         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2105         
2106         * expression.cs (Indirection.LoadExprValue): Removed unused.
2107         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2108         
2109         * iterators.cs (Iterator.param_types): Removed unused.
2110         
2111         * statement.cs (Goto.block): Removed unused.
2112         (ToplevelBlock.did): Removed unused.
2113         (Switch.ResolveConstantSwitch): Removed unused.
2114
2115 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2116
2117         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2118         resetting thingy.
2119
2120 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2121
2122         Fix #74232 and cs0208-3.cs.
2123         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2124         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2125         unmanaged type.  Don't use FieldBuilders when 't' is a
2126         TypeBuilder.  Use ModFlags and MemberType fields.
2127         * class.cs (MemberBase.member_type): Rename from MemberType.
2128         (MemberBase.MemberType): New property.  Determines member_type on
2129         demand.
2130         (MemberBase.DoDefine): Don't initialize MemberType here.
2131         (FieldMember.Define): Likewise.
2132
2133 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2134
2135         Fix #74241
2136         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2137         Attributes are emitted there.
2138         
2139 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2140
2141         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2142         keyword in 'partial enum' too.
2143         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2144         is not allowed).
2145         Report from Kamil Skalski <nazgul@omega.pl>.
2146
2147         Fix #74309.
2148         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2149         have partial containers too.
2150
2151         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2152         in block' checks to Block.CheckInvariantMeaningInBlock.
2153         * statement.cs (Block.GetKnownVariableInfo): Make private.
2154         (Block.IsVariableUsedInChildBlock): Remove.
2155         (Block.IsVariableUsedInBlock): Likewise.
2156         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2157         conflicting declaration.
2158         (Block.AddVariable): Make error messages less long-winded and more
2159         specific.  Show location of conflicting declaration.
2160         * parameter.cs (Parameters.Location): New readonly property.
2161
2162 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2163
2164         Clean up semantics of invoking ResolveMemberAccess.
2165         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2166         can have an instance, ensure that we pass in a non-TypeExpression
2167         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2168         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2169         argument.  Update to changes and simplify.
2170         (FieldExpr.Emitinstance): Remove CS0120 check.
2171         (PropertyExpr.EmitInstance): Likewise.
2172         * expression.cs (Argument.Resolve): Likewise.
2173         (Invocation.DoResolve): Update to changes in semantics of
2174         InstanceExpression.
2175
2176 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2177
2178         Fix #74241
2179         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2180         customization.
2181         
2182         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2183
2184 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2185
2186         Fix difference in behaviour with commandline invocation.
2187         * driver.cs (Driver.Reset): New.
2188         (CompilerCallableEntryPoint): Call it.
2189
2190         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2191         variable" warnings if the boolean expression failed to resolve.
2192
2193 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2194
2195         * attribute.cs: Fix the union of several permissions when some of them
2196         are unrestricted (so the result isn't an unrestricted permission set).
2197         Fix #74036.
2198
2199 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2200
2201         * ecore.cs (MemberExpr): New class.  Convert from interface
2202         IMemberExpr.
2203         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2204         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2205         error checks.
2206         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2207         (MethodGroupExpr.IsExplicitImpl): Remove.
2208         (Expression.GetFieldFromEvent): Remove.
2209         (SimpleName.MemberStaticCheck): Remove.
2210         (SimpleName.DoSimpleNameResolve): Update to changes.
2211         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2212         (MemberAccess.IdenticalNameAndTypeName): Remove.
2213         (MemberAccess.error176): Move to MemberExpr.
2214         (MemberAccess.DoResolve): Update to changes.
2215         (BaseAccess.DoResolve): Likewise.
2216
2217 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2218
2219         C# 2.0 Conditional attribute class implementation
2220         
2221         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2222         Analyzes class whether it has attribute which has ConditionalAttribute
2223         and its condition is not defined.
2224         
2225         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2226         (Class.IsExcluded): New method. Search for at least one defined
2227         condition in ConditionalAttribute of attribute class.
2228
2229 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2230
2231         * ecore.cs (PropertyExpr): Derive from Expression, not
2232         ExpressionStatement.
2233         (PropertyExpr.EmitStatement): Remove.
2234
2235 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2236
2237         Fix #74060.
2238         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2239         internal field "value__" of an enum be private.  The examples for
2240         "value__" that I found on MSDN all used FieldAttributes.Private.
2241
2242         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2243         Don't mention IL method attribute names.
2244
2245         Fix #47991.  Remove a TODO.
2246         * statement.cs (Block.Toplevel): Make into a field.
2247         (Block.Parameters): Move into ToplevelBlock.
2248         (Block.known_variables): Rename from child_variable_names.
2249         (Block.Block): Remove variants that take Parameters.  Initialize
2250         'Toplevel' with the immediately surrounding toplevel block.
2251         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2252         LocalInfo parameter.
2253         (Block.GetKnownVariableInfo): New.
2254         (Block.IsVariableNameUsedInChildBlock): Update.
2255         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2256         the block, even though it may not be in scope.
2257         (Block.AddVariable): Remove Parameters parameter.  Use
2258         Toplevel.Parameters instead.
2259         (Block.AddConstant): Remove Parameters parameter.
2260         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2261         (Block.IsParamaterReference): Likewise.
2262         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2263         (ToplevelBlock.Parameters): New.  Moved from Block.
2264         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2265         initialize Parameters to a non-null value.
2266         * cs-parser.jay: Update to changes.
2267         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2268         simple names that mean different things in the same block.  Use
2269         Block.IsVariableNameUsedInBlock.
2270
2271 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2272
2273         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2274         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2275         GetTypeHandle.  It is possible for a reflected type to derive from
2276         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2277         System.Array during mscorlib compilation).
2278         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2279         contain a method_hash, don't create one either.  Don't create a
2280         deep copy of the base cache's method_hash.
2281         (MemberCache.SetupCache): Rename back from DeepCopy.
2282         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2283         already initialized.  If we see an override function, add its
2284         underlying base virtual function to the member_hash too.
2285
2286         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2287
2288 2005-03-26  Raja R Harinath  <harinath@acm.org>
2289
2290         Fix #73038.
2291         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2292         fails to resolve, ensure that the LHS is still resolved as an
2293         lvalue.
2294
2295 2005-03-25  Raja R Harinath  <harinath@acm.org>
2296
2297         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2298         ec.ContainerType.
2299         (Enum.current_ec): Remove.
2300         (Enum.LookupEnumValue): Remove EmitContext argument.
2301         Just uses the one created during DefineType.
2302         (Enum.FindMembers): Update.
2303         * expression.cs (MemberAccess.DoResolve): Update.
2304
2305 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2306
2307         * assign.cs (Assign.DoResolve): Check for CS1717 when
2308         source and target are same (uses Equals).
2309
2310         * expression.cs (LocalVariableReference, ParameterReference,
2311         This): Implemented Equals, GetHashCode.
2312
2313         * statement.cs (Block.GetParameterReference): Removed useless
2314         local variable.
2315
2316 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2317
2318         Fix cs0128.cs
2319         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2320         blocks before deciding whether the error is cs0136 or cs0128.
2321
2322         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2323         (using_alias_directive, using_namespace_directive): Pass
2324         MemberName, not an expression to Namespace.UsingAlias and
2325         Namespace.Using.
2326         (MakeName): Use the MemberName of the namespace.
2327         * namespace.cs (Namespace.MemberName): New.
2328         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2329         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2330         Likewise.
2331         * decl.cs (MemberName.Name): Make readonly.
2332         (MemberName.FromDotted): New "constructor".
2333         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2334         (MemberCore.Name): Compute from MemberName on demand.
2335         (MemberCore.SetMemberName): Provide a way to change the
2336         MemberName.
2337         (MemberCore.AddToContainer): Don't take a fullname parameter.
2338         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2339         fully qualified name of the container to the member name.
2340         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2341         only if the type is a member of the root container.
2342         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2343         MemberName.Left rather than searching for an embedded ".".
2344         (PartialContainer.CreatePart): Update to changes in RootContext.
2345         (MemberBase.ShortName): Turn into a property.  Use
2346         MemberCore.SetMemberName.
2347         (MemberBase.ExplicitInterfaceName): Remove.
2348         (MemberBase.UpdateMemberName): Remove.
2349         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2350         (PropertyBase.SetMemberName): New override.
2351         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2352         (Tree.GetDecl): New.
2353         (Tree.AllDecls): Rename from Decls.
2354         * attribute.cs, enum.cs, report.cs: Update to changes.
2355         * driver.cs (MainDriver): Use MemberName.FromDotted on
2356         RootContext.MainClass.
2357
2358 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2359
2360         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2361         checks.
2362
2363         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2364
2365 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2366
2367         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2368         property accessor modifiers.
2369
2370         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2371         fixed buffer attribute (CS1716).
2372         (PropertyMethod.HasCustomAccessModifier): When property accessor
2373         has custom modifier.
2374
2375         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2376         modifiers.
2377         (PropertyExpr.DoResolveLValue): Add CS0272.
2378
2379 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2380
2381         * convert.cs: When converting to a pointer, use the proper Conv.U
2382         or Conv.I depending on the source data type.
2383
2384         * cs-tokenizer.cs: Make the size for large decimal constants,
2385         fixes #72957.
2386
2387 2005-03-17  Martin Baulig  <martin@ximian.com>
2388
2389         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2390         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2391
2392 2005-03-17  Martin Baulig  <martin@ximian.com>
2393
2394         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2395         to bool so we can return an error condition.
2396         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2397         returned an error.
2398
2399 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2400
2401         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2402         attributes.
2403
2404 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2405
2406         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2407         Refactor to avoid traversing the list of assemblies, and to avoid
2408         string concatenation.
2409         * typemanager.cs (guid_attr_type): Remove.
2410         (negative_hits, pointers, references): Remove hashes.
2411         (type_hash): New.
2412         (GetConstructedType): New.  Uses type_hash to handle constructed
2413         types (arrays, references, pointers).
2414         (GetReferenceType, GetPointerType): Use it.
2415         (GetNestedType): New.  Uses type_hash to handle nested types of
2416         reflected types.
2417         (LookupType, LookupTypeDirect): Remove.
2418         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2419         'types' hash and LookupTypeReflection directly.
2420         (params_string, params_object): Use GetConstructedType.
2421         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2422         top-level types.
2423         (Namespace.Lookup): Use cached_types.
2424         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2425         provided by old TypeManager.LookupType.
2426         * rootcontext.cs (MakeFQN): Remove.
2427         * decl.cs (DeclSpace.MakeFQN): Likewise.
2428         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2429         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2430         TypeManager.GetConstructedType.
2431         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2432
2433 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2434
2435         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2436         indexers.
2437
2438         * cs-parser.jay: Reports CS1527 for any namespace element.
2439
2440         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2441         Added CS0407.
2442
2443         * expression.cs (ParameterReference.IsAssigned): Changed error to
2444         CS0269.
2445         (Error_WrongNumArguments): Moved CS0245 detection here.
2446
2447         * statement.cs (Return.Resolve): Add CS1622 report.
2448
2449 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2450
2451         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2452
2453 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2454
2455         * attribute.cs expression.cs: Get rid of some allocations.
2456
2457 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2458
2459         * doc.cs : just eliminate the latest change.
2460
2461 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2462
2463         * doc.cs : commented out the latest change. It breaks xml-030.cs
2464
2465 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2466
2467         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2468           fail. So invoke CreateType() in FindDocumentedType().
2469
2470 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2471
2472         * cs-tokenizer.cs : added IsKeyword().
2473         * doc.cs : Detect keyword incorrectly used as identifier.
2474           Allow identifiers prefixed by @.
2475
2476 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2477
2478         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2479         It caused exception in namespace resolving (again!).
2480         
2481         * class.cs (Class.ctor): Removed exit.
2482         (PropertyMethod.ctor): ditto.
2483         
2484         * codegen.cs (Codegen.Reset): Reset static data.
2485         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2486         
2487         * cs-tokenizer.cs (Cleanup): Removed.
2488         
2489         * driver.cs (GetSystemDir): Rewrote to one line command.
2490         It caused problem with unloaded dynamic modules.
2491         (UnixParseOption): Removed Exit.
2492         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2493         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2494         Now can be mcs used as library.
2495         
2496         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2497         empty location.
2498         
2499         * location.cs (Reset): Reset static data.
2500         
2501         * namespace.cs (Reset): Reset static data.
2502         
2503         * report.cs (Report.Reset): Reset static data.
2504         
2505         * rootcontext.cs (RootContext.Reset): Reset static data.
2506         
2507         * tree.cs (RootTypes.ctor): Use Location.Null
2508         
2509         * typemanager.cs (TypeManager.Reset): Reset static data.
2510         (CoreLookupType): Removed Exit.
2511         (TypeHandle.Reset): Reset static data.
2512         
2513 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2514
2515         Fix #73516.
2516         * typemanager.cs (ComputeNamespaces): Import namespaces from
2517         referenced modules too.
2518
2519 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2520
2521         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2522         than '.'.
2523
2524 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2525
2526         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2527         enclosing DeclSpace.  This ensures that a name-lookup populates
2528         more caches and there are fewer 'TypeExpression's.  Carve out
2529         nested type lookup into ...
2530         (LookupNestedTypeInHierarchy): ... this.
2531
2532 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2533
2534         Clean up a few partial-class semantics.  
2535         Fixes test-357.cs and cs1618-2.cs.
2536         * cs-parser.jay (struct_declaration): Use 'current_class' as
2537         parent of newly-created struct.  Remove call to Register ().
2538         Use 'pop_current_class' to complete handing the current struct.
2539         (interface_declaration): Likewise.
2540         (class_declaration): Likewise.
2541         (enum_declaration): Use 'current_class' as parent of newly created
2542         enum.
2543         (delegate_declaration): Likewise.
2544         (pop_current_class): New function.  This is used to handle closing
2545         up the 'current_class' and 'current_container', and pointing them
2546         to the enclosing class/container.
2547         (CSharpParser): Initialize 'current_class' too.
2548         * decl.cs (MemberCore): Add check for invariant: a partial
2549         container is not a parsed entity, and thus does not enclose any
2550         parsed members.
2551         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2552         (DeclSpace.BaseTypeExpr): Use it.
2553         (DeclSpace.LookupType): Add check for invariant.
2554         * class.cs (TypeContainer): Add check for invariant: a nested
2555         class should have the same NamespaceEntry as its enclosing class.
2556         (TypeContainer.EmitFieldInitializers): Make virtual.
2557         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2558         MemberCore.
2559         (TypeContainer.Register): Remove.
2560         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2561         null.  Use TypeResolveEmitContext for resolving base types and
2562         interfaces.  Move initialization of Parts.TypeBuilder here from
2563         ...
2564         (TypeContainer.DefineNestedTypes): ... here.
2565         (PartialContainer): Take a Namespace not a NamespaceEntry.
2566         (PartialContainer.Create): Don't use Register.  Call the
2567         appropriate Add... function directly.
2568         (ClassPart): Take both the PartialContainer and the enclosing
2569         class as constructor arguments.
2570         (ClassPart.EmitFieldInitializers): Override.
2571         (ClassPart.PartFindNestedTypes): Remove.
2572         (FieldBase.GetInitializerExpression): Resolve the initializer
2573         expression in the emit context of the enclosing class.
2574         * tree.cs (RootTypes): Remove Register ().
2575         
2576 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2577
2578         * cs-parser.jay: Removed CS0134.
2579         
2580         * driver.cs: Removed CS1901.
2581         
2582         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2583         for predefined types.
2584
2585 2005-03-07  Duncan Mak  <duncan@novell.com>
2586
2587         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2588         well. Fixes bug #73454.
2589
2590 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2591
2592         * cs-tokenizer.cs (xtoken): Add CS1035.
2593         
2594         * class.cs (MethodData.Define): Add CS0683.
2595         (FieldMember.ctor): Add CS0681.
2596
2597 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2598
2599         * ecore.cs (SimpleName.DoResolve): Rename from
2600         SimpleName.DoResolveAllowStatic.
2601         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2602         Pass 'intermediate' flag to MemberStaticCheck.
2603         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2604         of "intermediate" lookups via MemberAccess.
2605         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2606         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2607
2608 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2609
2610         Fix #73394.
2611         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2612         slipped in because of variable names that are identical to a
2613         builtin type's BCL equivalent ('string String;', 'int Int32;').
2614         (PropertyExpr.EmitInstance): Likewise.
2615
2616 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2617
2618         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2619         
2620         * report.cs (warning_ignore_table): Made public.
2621
2622 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2623
2624         Fix #73282.
2625         * class.cs (MethodData.Emit): Pass 'container' to
2626         container.GetObsoleteAttribute instead of 'container.Parent'.
2627
2628 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2629
2630         * cs-parser.jay: Add 1534 error test.
2631
2632         * iterators.cs (Yield.CheckContext): Add error 1629.
2633         (Iterator.ctor): Save unsafe modifier.
2634         (MoveNextMethod.DoEmit): Restore unsafe context.
2635
2636         * namespace.cs (UsingAlias): Better error message.
2637
2638 2005-03-03  Dan Winship  <danw@novell.com>
2639
2640         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2641         the warning message [#73219]
2642
2643 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2644
2645         Fix compile with MCS 1.0.0.0.
2646         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2647         w_restore to not depend on string constant folding.
2648
2649 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2650
2651         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2652         CS0246 check to users who passed 'silent = false'.
2653         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2654         check.
2655         (SimpleName.SimpleNameResolve): Update.
2656         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2657         (MemberAccess.IdenticalNameAndTypeName): Update.
2658         * doc.cs (FindDocumentedTypeNonArray): Update.
2659
2660 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2661
2662         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2663         * parameters.cs (ComputeAndDefineParameters): Remove.
2664         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2665         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2666         Use GetParameterInfo.
2667
2668 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2669
2670         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2671
2672 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2673
2674         Unify DeclSpace.LookupType and DeclSpace.FindType.
2675         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2676         is in charge of defining nested types on demand.
2677         (DeclSpace.LookupType): Use it when the current_type is a
2678         TypeBuilder.  Use LookupTypeDirect for reflected types.
2679         (DeclSpace.FindType): Remove.
2680         (DeclSpace.LookupInterfaceOrClass): Likewise.
2681         (DeclSpace.DefineTypeAndParents): Likewise.
2682         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2683         DeclSpace.LookupType.
2684         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2685         * typemanager.cs (LookupType): Simplify.
2686         (AddUserType): Remove type from negative_hits.
2687         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2688         * class.cs (TypeContainer.FindMembers): Move handling of nested
2689         types ...
2690         (TypeContainer.FindMembers_NestedTypes): ... here.
2691         (TypeContainer.FindNestedType): Implement override.
2692         (ClassPart.FindNestedType): Delegate to PartialContainer.
2693         (ClassPart.PartFindNestedType): Looks up the nested types of the
2694         part alone.
2695
2696 2005-03-02  Martin Baulig  <martin@ximian.com>
2697
2698         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2699         static constructor in static classes.
2700
2701 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2702
2703         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2704         sizeParamIndex is not specified.
2705
2706 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2707
2708         Fix #73117
2709         * report.cs (WarningMessage.IsEnabled): Missing null check.
2710
2711 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2712
2713         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2714         in the fields and not in the properties.
2715
2716 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2717
2718         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2719         fields as well.
2720
2721 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2722
2723         * attribute.cs: Small refactoring (improved robustness).
2724         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2725         (ValidateGuid): Removed.
2726         (Resolve): Removed referenced to above mentioned.
2727         (GetAttributeUsage): Made private and changed to work without
2728         class assistance.
2729         (GetIndexerAttributeValue): Don't crash.
2730         (GetConditionalAttributeValue): Ditto.
2731         (GetClsCompliantAttributeValue): Ditto.
2732         (ExtractSecurityPermissionSet): All attributes exceptions are
2733         error 648.
2734         (GetPropertyValue): New helper.
2735         (GetMethodImplOptions): New method.
2736         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2737         some missing properties.
2738         
2739         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2740         (Method.ApplyAttributeBuilder): Updated.
2741         
2742         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2743         exception.
2744
2745 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2746
2747         Fix #73052.
2748         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2749         non-simple types (array, pointer, reference).
2750
2751 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2752
2753         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2754
2755         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2756         for operators.
2757         (Method.CheckBase): Catch wrong destructor here.
2758         (MethodData.Define): Add errors 550, 668.
2759
2760         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2761
2762         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2763
2764         * pending.cs (VerifyPendingMethods): Add error 551.
2765
2766         * typemanager.cs (CSharpName): Next error report helper.
2767
2768 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2769
2770         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2771         attributes. Removed useless attribute double check.
2772         It saves almost 2MBs for corlib.
2773
2774 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2775
2776         Fix #72924.
2777         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2778         called twice in case of error.
2779
2780 2005-02-23  Chris Toshok  <toshok@ximian.com>
2781
2782         Fix compiler portions of #72827.
2783         * statement.cs (Block.Emit): call Begin/EndScope on the
2784         EmitContext instead of the ILGenerator.
2785
2786         * codegen.cs (EmitContext.BeginScope): new method, call
2787         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2788         we have one.)
2789         (EmitContext.BeginScope): same, but EndScope and CloseScope
2790
2791         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2792         offset and call the superclass's OpenScope(int) with it.
2793         (SymbolWriter.CloseScope): get the current il
2794         offset and call superclass's CloseScope(int) with it.
2795
2796 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2797
2798         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2799         CS1677 for out and ref as well.
2800
2801         * class.cs (Method.Define): Add error CS1599 detection.
2802         
2803         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2804         
2805         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2806         
2807         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2808         
2809         * support.cs.cs (ModifierDesc): New helper method.
2810
2811 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2812             Abin Thomas  <projectmonokochi@rediffmail.com>
2813             Anoob V E  <projectmonokochi@rediffmail.com>
2814             Harilal P R  <projectmonokochi@rediffmail.com>
2815
2816         Fix #57851, #72718.
2817         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2818         MemberLookup (used for error reporting) actually returns a result.
2819         Fix error report number (122, not 112).
2820
2821 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2822             Anoob V E  <projectmonokochi@rediffmail.com>
2823             Harilal P R  <projectmonokochi@rediffmail.com>
2824
2825         Fix #71134.
2826         * pending.cs (PendingImplementation.GetAbstractMethods):
2827         Find NonPublic members too.
2828
2829 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2830
2831         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2832         Fixed error 217.
2833         
2834         * class.cs (MethodCore.CheckMethodAgainstBase):
2835         Add error 239 report.
2836
2837 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2838
2839         Fix #68955.
2840         * expression.cs (Invocation.IsApplicable): Make public.
2841         (Invocation.IsParamsMethodApplicable): Likewise.
2842         * delegate.cs (Delegate.VerifyApplicability): Don't use
2843         Invocation.VerifyArgumentCompat for parameter applicability
2844         testing.  Use Invocation.IsApplicable and
2845         Invocation.IsParamsMethodApplicable.
2846
2847 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2848
2849         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2850         
2851         * class.cs (Operator.Define): Add error 217 report.
2852         
2853 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2854
2855         * namespace.cs (UsingEntry.Resolve): Undo change below.
2856
2857 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2858
2859         Fix #72756.
2860         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2861         disable the error message when the extended MemberLookup also
2862         fails.
2863         (Expression.MemberLookupFinal): Update.
2864         (SimpleName.DoSimpleNameResolve): Update.
2865         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2866         Don't use MemberLookupFinal.
2867         (New.DoResolve): Update.
2868         (BaseAccess.CommonResolve): Update.
2869
2870 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2871
2872         Fix #72732.
2873         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2874         occured previously, don't resolve again.
2875
2876 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2877
2878         Fix #69949
2879         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2880         argument. Call ResolveAttributeUsage for unresolved.
2881         when types doesn't match ctor arguments.
2882         
2883         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2884         for nested attribute classes.
2885         (Class.attribute_usage): Removed.
2886         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2887         for attribute class.
2888         
2889         * ecore.cs (IsAttribute): Removed.
2890         
2891         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2892         
2893         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2894         now normal types.
2895         (attribute_types): Removed.
2896         (EmitCode): Global attributes are emited as the latest.
2897
2898 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2899
2900         * class.cs (EmitFieldInitializers): Don't emit field initializer
2901         for default values when optimilization is on.
2902         
2903         * constant.cs (Constant.IsDefaultValue): New property.
2904         
2905         * driver.cs: Add /optimize handling.
2906         
2907         * constant.cs,
2908         * ecore.cs,
2909         * literal.cs: Implement new IsDefaultValue property.
2910         
2911         * rootcontext.cs (Optimize): New field, holds /optimize option.
2912
2913 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2914
2915         Fix crasher in re-opened #72347.
2916         * namespace.cs (Namespace.Lookup): Return null if
2917         DeclSpace.DefineType returns null.
2918
2919         Fix #72678.
2920         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2921
2922 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2923
2924         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2925         now returns null if it cannot resolve to an lvalue.
2926         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2927         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2928         returned null.  Remove check for SimpleName.
2929         (EventExpr.DoResolveLValue): New.
2930         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2931         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2932         error from ...
2933         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2934         avoid CS0131 error.
2935         (Unary.ResolveOperator): Move CS0211 check ...
2936         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2937         CS0131 error.
2938         (Unary.DoResolveLValue): Simplify.
2939         (AddressOf.DoResolveLValue): New.
2940         (ArrayAccess.DoResolveLValue): New.
2941
2942 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2943
2944         * attribute.cs (Attribute.Resolve): Add arguments casting for
2945         when types doesn't match ctor arguments.
2946
2947 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2948
2949         Fix parts of #63202.
2950         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2951         lookup of operator in base type.  Ensure that all checks happen
2952         when the operator resolves to an "op_..." method.
2953
2954 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2955
2956         Fix #71992.
2957         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2958         'ignore_cs0104' parameter.  Pass it to ...
2959         (NamespaceEntry.Lookup): ... this.
2960         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2961         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2962         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2963         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2964         Update.  Request that cs0104 errors be ignored.
2965         (ComposedCast.ResolveAsTypeStep): Update.
2966
2967 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2968
2969         Fix #59209.
2970         * expression.cs (Invocation.BetterFunction): Remove support for
2971         comparing virtual functions and their overrides.
2972         (Invocation.IsOverride): New.
2973         (Invocation.OverloadResolve): Don't consider 'override' functions
2974         during candidate selection.  Store them in a lookaside list.
2975         If the selected method is a 'virtual' function, use the list to
2976         find any overrides that are closer to the LHS type.
2977
2978 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2979
2980         * expression.cs (New.DoResolve): Add complex core type reduction.
2981         (New.Constantify): Converts complex core type syntax like 'new int ()'
2982         to simple constant.
2983         
2984 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2985
2986         * decl.cs (EntryType.EntryType): New constructor to create an
2987         updated copy of a cache entry.
2988         (MemberCache.AddMethods): Use it.
2989         (MemberCache.ClearDeclaredOnly): Remove.
2990         (MemberCache.MemberCache): Update.
2991
2992 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2993
2994         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2995         variable.  This one is represents the actual low-level declaration
2996         of the method, as opposed to the semantic level `IsStatic'.   
2997
2998         An anonymous method which is hosted into a static method might be
2999         actually an instance method.  IsStatic would reflect the
3000         container, while MethodIsStatic represents the actual code
3001         generated.
3002
3003         * expression.cs (ParameterReference): Use the new MethodIsStatic
3004         instead of IsStatic.
3005
3006         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3007         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3008         set on the current EmitContext. 
3009
3010         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3011         resolve our casted expression as an LValue.  This triggers the
3012         proper LValue processing that is later required by Assign.
3013
3014         This fixes 72347.
3015
3016         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3017
3018 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3019
3020         C# 2.0 Fixed buffer implementation
3021
3022         * anonymous.cs: Update after RegisterHelperClass renaming.
3023
3024         * attribute.cs (AttributeTester.fixed_buffer_cache):
3025         Cache of external fixed buffers.
3026         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3027         implementation if field is fixed buffer else null.
3028
3029         * class.cs
3030         (TypeContainer.AddField): Accept FieldMember instead of Field.
3031         (FieldBase.IsFieldClsCompliant): Extracted code from
3032         VerifyClsCompliance descendant customization.
3033         (FixedField): New class handles fixed buffer fields.
3034         (FixedFieldExternal): Keeps information about imported fixed
3035         buffer.
3036         (IFixedField): Make access to internal or external fixed buffer
3037         same.
3038
3039         * cs-parser.jay: Add fixed buffer parsing.
3040
3041         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3042         buffer.
3043
3044         * expression.cs (Indirection): Extended implementation to accept
3045         fixed buffer field.
3046         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3047         (ElementAccess.MakePointerAccess): Get type as parameter.
3048         (DoResolve): Add fixed buffer field expression conversion.
3049         (DoResolveLValue): Ditto.
3050         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3051         (ArrayPtr): Derives from FixedBufferPtr.
3052         (ArrayPtr.Emit): Add extra emit for array elements.
3053
3054         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3055
3056         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3057         for compiler generated types.
3058         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3059
3060         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3061         and consume less memory.
3062         (Fixed.Resolve): Add fixed buffer case.
3063
3064         * typemanager.cs (compiler_generated_attr_ctor,
3065         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3066         (HasElementType): Add our own implementation to work on every
3067         runtime.
3068
3069 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3070
3071         * anonymous.cs (CaptureContext): Track whether `this' has been
3072         referenced.   
3073
3074         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3075         only captured `this' if it was implicitly done (instance
3076         methods/variables were used). 
3077
3078         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3079         `this' must be captured.
3080
3081 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3082  
3083         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3084         is null it means that there has been no need to capture anything,
3085         so we just create a sibling.
3086
3087         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3088
3089         Just a partial fix.  The other half is fairly elusive.
3090         
3091 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3092
3093         Fix #52586, cs0121-4.cs.
3094         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3095         and return a hashtable.
3096         (MemberCache.ClearDeclaredOnly): New.
3097         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3098         the method_hash of a base type too.
3099         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3100         type methods.  Overwrite entries with the same MethodHandle so
3101         that the ReflectedType is correct.  The process leaves in base
3102         virtual functions and their overrides as distinct entries.
3103         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3104         matters since it was boxed in a ArrayList before.
3105         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3106         modifier.
3107         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3108         case of a virtual function and its override (choose the overload
3109         as better).
3110         (Invocation.OverloadResolve): Avoid 'override' members during
3111         'applicable_type' calculation.
3112
3113 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3114
3115         Combine two near-redundant caches.
3116         * typemanager.cs (method_params): Rename from method_internal_params.
3117         (TypeManager.GetParameterData): New.  Replace
3118         Invocation.GetParameterData.
3119         (TypeManager.LookupParametersByBuilder): Remove.
3120         * expression.cs (Invocation.method_parameter_cache): Remove.
3121         (Invocation.GetParameterData): Remove.
3122         Update to changes.
3123         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3124         Update to changes.
3125
3126 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3127
3128         Fix #72015.
3129         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3130         TypeManager.multicast_delegate_type is null, resolve it by looking
3131         up "System.MulticastDelegate".
3132         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3133
3134 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3135             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3136             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3137
3138         Fix cs0164.cs.
3139         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3140         (LabeledStatement.AddReference): New.  Set 'referenced'.
3141         (Goto.Resolve): Use it.
3142
3143 2005-02-05  John Luke  <john.luke@gmail.com>
3144
3145         * driver.cs: remove duplicate -doc line in Usage ()
3146
3147 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3148
3149         * location.cs (Location.AddFile): Fix CS2002 error report.
3150
3151 2005-02-02  Martin Baulig  <martin@ximian.com>
3152
3153         * delegate.cs (Delegate.DefineType): Report an internal error if
3154         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3155         details.        
3156
3157 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3158
3159         Fix a crasher in a variant of #31984.
3160         * const.cs (Constant.CheckBase): New override that defers the
3161         new-or-override check in case the base type hasn't been populated
3162         yet.
3163         (Constant.Define): Ensure the new-or-override check is performed.
3164
3165 2005-02-01  Duncan Mak  <duncan@ximian.com>
3166
3167         * const.cs (LookupConstantValue): Check that `ce' is not null
3168         before calling GetValue ().
3169
3170 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3171
3172         Fix test-334.cs (#69519).
3173         * cs-parser.jay (using_alias_directive): Pass in an expression to
3174         NamespaceEntry.UsingAlias.
3175         (using_namespace_directive): Pass in an expression to
3176         NamespaceEntry.Using.
3177         (namespace_name): Don't flatten to a string.
3178         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3179         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3180         ResolveAsTypeStep.
3181         (NamespaceEntry.UsingEntry): Likewise.
3182         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3183         changes.
3184         (NamespaceEntry.LookupForUsing): Remove.
3185         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3186         names.
3187         (NamespaceEntry.Lookup): Remove support for dotted names.
3188
3189 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3190
3191         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3192         split into two.
3193         (NamespaceEntry.ImplicitParent): Compute on demand.
3194         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3195         parallels the current.
3196         (NamespaceEntry.LookupForUsing): Use it.
3197         (NamespaceEntry.Lookup): If the current namespace-entry is
3198         implicit, don't search aliases and using tables.
3199
3200 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3201
3202         Fix #31984.
3203         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3204         BaseCache here.
3205         (TypeContainer.BaseCache): Compute on demand.
3206         (TypeContainer.FindMembers): Define constants and types if they're
3207         not already created.
3208         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3209         check.
3210         * const.cs (Constant.Define): Make idempotent.
3211
3212 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3213
3214         * pending.cs: Produce better code (no nops produced by using Ldarg
3215         + value).
3216         
3217         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3218         i - 1' it should be arg + 1.
3219
3220         Fixes bug #71819.
3221
3222 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3223
3224         * attribute.cs (Attribute.CheckAttributeType): Make private
3225         non-virtual.
3226         (Attribute.ResolveType): Make virtual.
3227         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3228         handling of RootContext.Tree.Types.
3229
3230 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3231
3232         Update attribute-handling to use the SimpleName/MemberAccess
3233         mechanisms.
3234         * cs-parser.jay (attribute): Pass in an expression to the
3235         constructors of Attribute and GlobalAttribute.
3236         * attribute.cs (Attribute): Take an expression for the name.
3237         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3238         passed in attribute name expression.
3239         (Attribute.CheckAttributeType): Use it.
3240         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3241         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3242         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3243         argument to prevent error messages if the lookup fails.
3244
3245 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3246
3247         * expression.cs (Indirection): Implemented IVariable interface
3248         to support indirection in AddressOf operator.
3249         (PointerArithmetic.Emit): Add optimalization for case where
3250         result can be precomputed.
3251
3252 2005-01-26  Martin Baulig  <martin@ximian.com>
3253
3254         * class.cs (TypeContainer.AttributeTargets): Return the correct
3255         AttributeTargets depending on our `Kind' instead of throwing an
3256         exception; fixes #71632.
3257
3258 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3259
3260         Fix #71257
3261         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3262         constant members.
3263
3264 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3265
3266         Fix #71602.
3267         * expression.cs (MemberAccess.DoResolve): Don't complain with
3268         cs0572 when the LHS of a member access has identical name and type
3269         name.
3270
3271 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3272
3273         Fix #71651, #71675
3274         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3275         CreatePermission.
3276         Create custom PermissionSet only for PermissionSetAttribute.
3277
3278 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3279
3280         Fix #71649
3281         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3282         delegates in static class.
3283
3284 2005-01-24  Martin Baulig  <martin@ximian.com>
3285
3286         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3287         merging an implicit block, just use its reachability.
3288
3289         * statement.cs (Block.Resolve): Make the unreachable code check
3290         work wrt. implicit blocks; see test-337 from #63842.
3291
3292 2005-01-21  Alp Toker  <alp@atoker.com>
3293  
3294         * cs-parser.jay: destructor_declaration's container is PartialContainer
3295         not Class when partial types are used, so use Kind prop instead of
3296         'is'.
3297         
3298 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3299
3300         * cs-parser.jay: Improve error reporting when an interface
3301         declares new types.
3302
3303 2005-01-20  Dick Porter  <dick@ximian.com>
3304
3305         * support.cs: SeekableStreamReader fix from Sandor Dobos
3306         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3307         chars are read.  Fixes bug 70369.
3308
3309 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3310
3311         * cs-parser.jay (catch_clause): Simplify current_block handling
3312         somewhat.
3313
3314 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3315
3316         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3317         code with ImplicitStandardConversion to handle the implicit
3318         conversion of method groups into valid delegate invocations. 
3319
3320         The problem is that in parameter handling we were using this code
3321         path.  Fixes bug #64698
3322
3323 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3324
3325         * cs-parser.jay: Fix several infelicities.
3326         - Avoid assigning to the parser value stack.  Code like 
3327           '$3 = null' is unclean.  Synthesize a value for the code block
3328           instead. 
3329         - Avoid using oob_stack for storing location information.  Use ...
3330         (_mark_): ... this.  New (empty) rule.  Saves the current location
3331         in $$.
3332         (foreach_statement): Avoid using oob_stack for current_block
3333         handling.  Use technique used in for_statement and
3334         using_statement.  Synthesize a value for the code block to store
3335         additional intermediate information.
3336
3337 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3338
3339         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3340         of a different type is only allowed to private fields of a
3341         containing type, not on fields of a base class.
3342
3343         See test-174.cs and error cs0122-9.cs
3344
3345 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3346
3347         Fix test-335.cs (bug #58126).
3348         * cs-parser.jay (argument): Split out non-expression parts of the
3349         rule into 'non_simple_argument'.
3350         (invocation_expression): Support parenthesized invocations with
3351         multiple arguments, and with single non-simple arguments.
3352
3353 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3354
3355         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3356         places.
3357
3358 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3359
3360         Fix cs0038-1.cs, cs1640-6.cs.
3361         * ecore.cs (Expression.Resolve): Remove special-case for
3362         SimpleName in error-handling.
3363         (Expression.almostMatchedMembers): Relax access permission to
3364         protected.
3365         (Expression.MemberLookupFailed): Handle duplicates in
3366         almostMatchedMembers list.
3367         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3368         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3369         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3370         overload if the passed in MemberInfo is a MethodBase.
3371
3372 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3373
3374         Fix #70749
3375         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3376         for non-CAS & merge permission sets properly.
3377
3378 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3379
3380         Improve standard-compliance of simple name and member access 
3381         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3382         * ecore.cs (FullNamedExpression): New abstract base class 
3383         for Namespaces and TypeExpressions.
3384         (ResolveFlags.SimpleName): Remove.
3385         (SimpleName): Remove support for dotted names.
3386         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3387         DeclSpace.FindType and DeclSpace.LookupType.
3388         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3389         (Expression.ExprClassName): Make member function.
3390         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3391         a namespace.  Remove creation of dotted "SimpleName"s.
3392         (MemberAccess.DoResolve): Likewise.
3393         * decl.cs (DeclSpace.Cache): Make private.
3394         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3395         (DeclSpace.FindType): Update.
3396         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3397         FullNamedExpression.
3398         * namespace.cs (Namespace): Derive from FullNamedExpression
3399         so that it can be part of expression resolution.
3400         (Namespace.Lookup): Return an FullNamedExpression.
3401         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3402         namespace.
3403         * rootcontext.cs (NamespaceLookup): Remove.
3404         (LookupType): Move to DeclSpace.
3405         * attribute.cs (CheckAttributeType): Update.
3406         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3407         (FindDocumentedTypeNonArray): Likewise.
3408
3409 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3410
3411         Fix cs0509.cs, cs1632.cs.
3412         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3413         is the same as IsInterface.
3414         (TypeContainer.GetClassBases): Likewise.
3415         * statement.cs (LabeledStatement.ig): New field.
3416         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3417         label.
3418         (LabeledStatement.DoEmit): Check that the label was created with
3419         the same ILGenerator.
3420
3421 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3422
3423         Fix #71058
3424         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3425         accessors to its properties.
3426
3427         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3428         from accessors to property.
3429         
3430 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3431
3432         Fix #70722
3433         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3434         only for overrides.
3435         
3436 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3437
3438         * attribute.cs: Check for null and empty strings.  
3439
3440         I have lost another battle to Paolo.
3441
3442 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3443
3444         Fix #70942
3445         * class.cs (PropertyMethod): Set Parent field in ctors.
3446         (SetMethod.InternalParameters): Add unsafe switch hack.
3447         Override MarkForDuplicationCheck where it is appropriate.
3448
3449         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3450         It says whether container allows members with the same name.
3451         Base default is no.
3452         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3453         Removed is_method parameter.
3454
3455 2005-01-06  Duncan Mak  <duncan@ximian.com>
3456
3457         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3458         because the previous change led to incorrect reporting of CS1032
3459         ("Cannot define/undefine preprocessor symbols after first token in
3460         file"). Instead of using `tokens_seen' as the only flag that
3461         triggers CS1040, introduce `comments_seen'. This new flag is used
3462         to signify having seen comments on the current line, so it is
3463         unset after a newline.
3464
3465 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3466
3467         * doc.cs : When searching for a type, find nested type too.
3468           This fixes bug #71040.
3469
3470 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3471
3472         * doc.cs :
3473           - Warn missing member comment on those classes which also does not
3474             have doc comments. Fixed bug #71041.
3475           - Don't warn missing doc comment on default constructor.
3476             Fixed bug #71042.
3477
3478 2005-01-06  Duncan Mak  <duncan@ximian.com>
3479
3480         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3481         comments, set `tokens_seen' to true. This allows us to detect
3482         misplaced preprocessor directives (i.e. not at the beginning of
3483         the a line, nor after whitespaces). In that case, report error
3484         CS1040. This fixes bug #56460.
3485
3486         * cs-parser.jay (interface_member_declaration): Add checks for
3487         IsExplicitImpl, and report CS0541 error if an interface member is
3488         defined as an explicit interface declaration.
3489
3490 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3491
3492         Fix #70817
3493         * class.cs (PropertyMethod): Set Parent field in ctors.
3494         (SetMethod.InternalParameters): Add unsafe switch hack.
3495         
3496         * decl.cs (MemberCore.Parent): Cannot be readonly.
3497
3498 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3499
3500         * decl.cs (DeclSpace.ResolveType): Remove.
3501         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3502         Merge in code from ...
3503         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3504         * class.cs, enum.cs: Update to changes.
3505
3506 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3507
3508         * anonymous.cs: Ensure that we init the scope of our parent if it
3509         has not been initialized yet.
3510
3511 2004-12-30  Duncan Mak  <duncan@ximian.com>
3512
3513         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3514         if field.FieldBuilder is null. Fixes #70758.
3515
3516         * convert.cs: Fixed some typos and updated some of the comments.
3517         (ImplicitStandardConversionExists):
3518         (TryImplicitIntConversion): If `target_type' is an interface and
3519         the type of `ic' implements this interface, return true or a new
3520         BoxedCast instead of null. This fixes #70468.
3521
3522 2004-12-29  Duncan Mak  <duncan@ximian.com>
3523
3524         * expression.cs (Argument.Emit): Check that Expr is
3525         IMemoryLocation before casting to it, and report CS1510 otherwise.
3526
3527         This fixes #70402.
3528
3529 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3530
3531         * statement.cs (Block.ThisVariable): remove the recursion here, to
3532         make the --profile more sane.
3533
3534 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3535
3536         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3537         assembly, by JB Evain.
3538
3539 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3540
3541         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3542           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3543         "parent" refers to enclosing type/class.  "base" refers to superclass.
3544
3545 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3546
3547         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3548         Ensure that we only have GlobalAttributes.
3549         * attribute.cs (Attribute.Emit): Make non-virtual.
3550         (GlobalAttribute.Emit): Remove.
3551         (Attribute.Resolve): Make virtual.
3552         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3553         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3554         the argument. Don't create one.
3555         (Attribute.GetObsoleteAttribute): Likewise.
3556         (Attribute.GetClsCompliantAttributeValue): Likewise.
3557         * class.cs, decl.cs: Update to changes.
3558
3559 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3560
3561         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3562         
3563         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3564         
3565         * statement.cs (Foreach.Resolve): Add error 186 report.
3566
3567 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3568
3569         * expression.cs (Conditional.DoResolve): Add warning 429.
3570         
3571         * statement.cs (If.Resolve): Add warning 665.
3572
3573 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3574
3575         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3576         except when in the parser, and in GlobalAttribute.
3577         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3578         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3579         RootContext.Tree.Types.NamespaceEntry once work is done.
3580         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3581         and resets RootContext.Tree.Types.NamespaceEntry.
3582
3583 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3584
3585         * cs-parser.jay: Don't create a block for every variable.
3586
3587 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3588
3589         * location.cs: Provide extra information.
3590
3591         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3592         variables from the captured environment, it is the ldarg_0.
3593
3594 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3595
3596         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3597         find a conclusion.
3598         
3599         * class.cs: Changed warning level for 169 to avoid developer
3600         displeasure from warning flooding. It will be changed back when they
3601         fix most of current BCL warnings.
3602         
3603         * RootContext.cs: Pushed default WarningLevel to 3.
3604         
3605         * statement.cs: Removed unused variable.
3606
3607 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3608
3609         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3610         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3611         Add error 502 report.
3612         (StaticClass.DefineType): Add error 441 report.
3613         (Class.AllowedModifiersProp): New virtual property as temporary
3614         extension to AllowedModifiers.
3615         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3616         to share implementation with StaticClass and don't call virtual
3617         methods from ctor.
3618         
3619         * driver.cs (MainDriver): Add error 1558 test.
3620
3621         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3622         report. Moved error 36 test here.
3623
3624         * statement.cs (Throw.Resolve): Add error 724 report.
3625
3626         * typemanager.cs: Add out_attribute_type core type.
3627         
3628 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3629
3630         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3631         3018 report.
3632         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3633
3634         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3635         3017 report.
3636         
3637         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3638
3639         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3640         Add error 3023 report.
3641         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3642
3643         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3644         implementation.
3645
3646 2004-12-12  John Luke  <john.luke@gmail.com>
3647
3648         * driver.cs (AddArgs): take -- into account when
3649         adding arguments, fixes bug 65710 
3650
3651 2004-12-12  Martin Baulig  <martin@ximian.com>
3652
3653         * expression.cs (Unary.TryReduceNegative): Added support for
3654         SByteConstant and ByteConstant.
3655         (Unary.Reduce): Check error values from TryReduceNegative().
3656
3657 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3658
3659         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3660         and report exception as error 182.
3661
3662 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3663
3664         * driver.cs (Main): Fix message when there are warnings.
3665
3666 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3667
3668         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3669
3670 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3671
3672         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3673         Reduced number of warnings.
3674         
3675         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3676
3677 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3678
3679         * driver.cs: Removed message.
3680
3681         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3682
3683 2004-12-08    <vargaz@freemail.hu>
3684
3685         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3686
3687 2004-12-08  Martin Baulig  <martin@ximian.com>
3688
3689         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3690         instead of a CS3002 for properties and indexer.
3691
3692 2004-12-08  Martin Baulig  <martin@ximian.com>
3693
3694         * decl.cs (MemberName.ToString): Make this work again.
3695
3696 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3697
3698         * attribute.cs (Resolve): Add error 591 detection.
3699
3700         * class.cs (FieldMember.Define): Add error 1547 detection.
3701         (Indexer.Define): Add error 620 detection.
3702         (Operator.Define): Add error 590 detection.
3703
3704         * ecore.cs: Missing argument for error 79.
3705
3706         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3707         detection.
3708
3709 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3710
3711         Fix #70106
3712         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3713         only.
3714
3715 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3716
3717         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3718           Some operator comments were suppressed.
3719         * doc.cs : Implicit/explicit operator name in doc comments are like
3720           "op_Explicit(type)~returnType", so added suffix handling.
3721
3722 2004-12-07  Martin Baulig  <martin@ximian.com>
3723
3724         * decl.cs
3725         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3726         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3727         (DeclSpace.ec): New protected field; store the EmitContext here.
3728         (DeclSpace.EmitContext): New public property; moved here from
3729         `TypeContainer'.
3730         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3731         EmitContext.
3732
3733         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3734         (Enum.Emit): Don't create a new EmitContext.
3735
3736         * delegate.cs (Delegate.DefineType): Always create the
3737         EmitContext.
3738
3739         * iterators.cs (Iterators.DefineIterator): Create a new
3740         EmitContext and store it in `ec'.
3741
3742 2004-08-24  Martin Baulig  <martin@ximian.com>
3743
3744         * typemanager.cs
3745         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3746         this for accessibility checks.
3747         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3748         IsNestedFamilyAccessible.
3749         (TypeManager.IsSubclassOf): New method, do what the name actually
3750         says.   
3751
3752 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3753
3754         Fix crash on cs0657-17.cs.
3755         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3756         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3757         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3758         the case where the NamespaceEntry gets overwritten.
3759
3760 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3761
3762         Fixed #69195, #56821
3763         * ecore.cs (ResolveBoolean): Tiny refactoring.
3764
3765         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3766         of right expression resolving when left is false constant and
3767         operator is LogicalAnd OR true constant and operator is LogicalOr.
3768
3769         * statement.cs (ResolveUnreachable): Always reports warning.
3770
3771 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3772
3773         * class.cs: Distinguish between 1721 and 1722 (just a little help
3774         for the programmer).
3775
3776 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3777
3778         * delegate.cs: Only allow this on new versions of the language. 
3779
3780 2004-12-02  Duncan Mak  <duncan@ximian.com>
3781
3782         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3783         Expression class.
3784         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3785         here as a static method. Take an additional bool out parameter
3786         `must_do_cs1540_check' for signaling to InstanceResolve.
3787         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3788         member field from PropertyExpr class and made it an argument of
3789         the method instead.
3790         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3791         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3792         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3793         and `remove_accessor' as well as InstanceResolve: report CS0122
3794         where applicable.
3795
3796         Fixes #70129.
3797
3798 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3799
3800         Fix test-327.cs, test-328.cs, and put in early infrastructure
3801         for eventually fixing #52697.
3802         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3803         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3804         from other methods.
3805         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3806         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3807         (VerifyUsing, error246): Update.
3808         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3809         'NamespaceEntry.LookupNamespaceOrType'.
3810
3811 2004-12-03  Martin Baulig  <martin@ximian.com>
3812
3813         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3814         method as our child, call AnonymousMethod.Compatible() on it.
3815
3816 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3817
3818         Disable XML documentation support in 'basic' profile.
3819         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3820         Redirect XmlElement to System.Object.
3821         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3822         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3823         * mcs.exe.sources: Add doc-bootstrap.cs.
3824         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3825         of doc.cs.
3826
3827 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3828
3829         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3830           comments are allowed.
3831
3832 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3833
3834         * delegate.cs: Add checks for subtypes in paramaters and return values
3835         in VerifyMethod () to add support for Covariance/Contravariance
3836         in delegates.
3837         
3838 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3839
3840         * report.cs: Remove extra closing parenthesis.
3841
3842         * convert.cs (Error_CannotImplicitConversion): If the name of the
3843         types are the same, provide some extra information.
3844
3845         * class.cs (FieldBase): Use an unused bit field from the field to
3846         encode the `has_offset' property from the FieldMember.  This saves
3847         a couple of Ks on bootstrap compilation.
3848
3849         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3850         method as our child, return the AnonymousMethod resolved
3851         expression.
3852
3853         * expression.cs (New.DoResolve): Allow return values from
3854         NewDelegate to also include AnonymousMethods.
3855
3856         Fixes #70150.
3857
3858 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3859
3860         Fix bug #70102
3861         * attribute.cs (Resolve): Improved implementation of params
3862         attribute arguments.
3863
3864         * support.cs (ParameterData): Add HasParams to be faster.
3865
3866 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3867
3868         all things are for /doc support:
3869
3870         * doc.cs: new file that supports XML documentation generation.
3871         * mcs.exe.sources: added doc.cs.
3872         * driver.cs:
3873           Handle /doc command line option.
3874           Report error 2006 instead of 5 for missing file name for /doc.
3875           Generate XML documentation when required, after type resolution.
3876         * cs-tokenizer.cs:
3877           Added support for picking up documentation (/// and /** ... */),
3878           including a new XmlCommentState enumeration.
3879         * cs-parser.jay:
3880           Added lines to fill Documentation element for field, constant,
3881           property, indexer, method, constructor, destructor, operator, event
3882           and class, struct, interface, delegate, enum.
3883           Added lines to warn incorrect comment.
3884         * rootcontext.cs :
3885           Added Documentation field (passed only when /doc was specified).
3886         * decl.cs:
3887           Added DocComment, DocCommentHeader, GenerateDocComment() and
3888           OnGenerateDocComment() and some supporting private members for
3889           /doc feature to MemberCore.
3890         * class.cs:
3891           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3892         * delegate.cs:
3893           Added overriden DocCommentHeader.
3894         * enum.cs:
3895           Added overriden DocCommentHeader and GenerateDocComment().
3896
3897 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3898
3899         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3900         unwrapping the enumeration values, chain to
3901         DoConstantNumericPromotions again, so we can promote things to the
3902         fundamental types (takes care of enums that are bytes, sbytes).
3903
3904         Fixes bug #62054.
3905
3906 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3907
3908         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3909         Fix long-standing bug in type-lookup.  Use FindType instead of
3910         LookupType when ec.ResolvingTypeTree.
3911         (Attribute.ResolveType, Attribute.Resolve)
3912         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3913         Update to changes.
3914         (Attributes.Search): Remove internal version.  Update.
3915         (Attributes.SearchMulti): Update.
3916         (Attributes.GetClsCompliantAttribute): Remove.
3917         (Attributes.GetIndexerNameAttribute): Remove.
3918         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3919         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3920         * class.cs (Indexer.Define): Likewise.
3921
3922 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3923
3924         Fix bug #68790
3925         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3926         MarshallByReference members access.
3927
3928         * expression.cs: Use CheckMarshallByRefAccess;
3929         Better error CS0197 message.
3930
3931         * report.cs: Print whole related error message.
3932
3933 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3934
3935         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3936         the current directory to help debugging.
3937
3938 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3939
3940         * class (GetClassBases): Better error 60 report.
3941         (EventProperty): Disabled warning 67 detection.
3942
3943 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3944
3945         Fix bug #60324
3946         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3947
3948         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3949         precise values.
3950
3951 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3952
3953         Fix bug #49488
3954         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3955
3956         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3957
3958 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3959
3960         * attribute.cs (Attribute.Resolve): Refine error reporting and
3961         report a cs0117 if the identifier does not exist, to distinguish
3962         from 0617 which is a miss-use of the actual identifier.
3963
3964         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3965         between cs0070 and cs0079.
3966
3967         * class.cs (MemberBase.DoDefine): When reporting a wrong
3968         accessibility level, we use MethodCore to compare instead of
3969         Method (this was a regression in some refactoring effort).
3970
3971         So now we correctly report cs0056 again.
3972
3973         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3974         testing the target_type (which was known to be object_type) and
3975         not the source type (which is anonymous_method).
3976
3977         Fixed reporting of error cs1660.
3978
3979         * expression.cs (UserCast.Source): Expose the underlying cast.
3980
3981         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3982         allowed types to find a match to int32 first (most common).
3983
3984         In addition, it ignores any ImplicitUserConversions that did an
3985         internal implicit conversion (as the switch statement allows only
3986         one integral conversion to exist).
3987
3988         * class.cs (PartialContainer.Create): rename `name' to
3989         `member_name' for clarity.  Then replace the string calls with a
3990         call to MemberName.GetPartialName, as now using
3991         MemberName.ToString is an error (this is due to the side effects
3992         it had, that were fixed in the past).
3993
3994         This will restore the error reporting on a number of partial class
3995         errors that were missusing this (and getting an exception as a
3996         results, which is now just a plain textual warning, because
3997         yyparse debug output would crash otherwise).
3998
3999 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4000
4001         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4002
4003 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4004
4005         * rootcontext.cs (LookupType): Make sure to cache lookups that
4006         don't give us a negative result. This saves about 5% of corlib
4007         compilation time.
4008
4009 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4010
4011         * report.cs (AbstractMessage.Print): messages are sent to stderr
4012
4013         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4014         non-interface in the list of interfaces (at this point, either
4015         parent was properly set, or a base class is being listed in the
4016         interfaces section).
4017
4018         This flags error 1722, and resolves the crash from bug 69259.
4019
4020 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4021
4022         * statement.cs (Using.EmitExpressionFinally): make this work right
4023         for valuetypes. Fixes 69926.
4024
4025 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4026
4027         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4028         converted to an enum" here, before we try to change the underlying
4029         type.  This code exists, but it is a different code path than the
4030         one used while encoding constants.
4031
4032         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4033         old bug: when converting from the null literal to a pointer,
4034         return an EmptyCast, not the NullLiteral.
4035
4036         This fixes #69921, the recent null_type changes probably made this
4037         bug more prominent.
4038
4039         (ImplicitReferenceConversionExists): In addition, resynchronized
4040         the code here, so it matches the same code in
4041         ImplicitReferenceConversionExists for the `from any class-type S
4042         to any interface-type T'.
4043         
4044
4045 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4046
4047         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4048
4049 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4050
4051         * cs-parser.jay: Use verbosity accordingly. 
4052
4053 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4054
4055         * expression.cs (Unary.ResolveOperator): Do not report warning;
4056         AddressOf reads from variable.
4057         
4058         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4059
4060 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4061
4062         Fix bug #69462
4063
4064         * attribute.cs (Attributable): Removed CheckTargets.
4065         (Attributes.Emit): Explicit attribute targets are tested here.
4066
4067         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4068         not enabled for interfaces.
4069
4070         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4071         (GetAssemblyName): Ouch next bug there.
4072
4073 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4074
4075         * expression.cs: Error 275 added.
4076         
4077 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4078
4079         Fix bug #69177 (Implemented decimal constant support)
4080
4081         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4082         (BinaryFold): Add DecimalConstant.
4083
4084         * const.cs (Define): Decimal constant 
4085         (is not constant.
4086         (ChangeType): Add decimal type handling.
4087         (LookupConstantValue): Don't set value for decimal type but
4088         emit DecimalConstantAttribute. Needed for constant optimization.
4089
4090         * constant.cs (ToDecimal): New method.
4091         (ConvertToDecimal): New method.
4092         (IntConstant): Implemented ConvertToDecimal.
4093         (DecimalConstant.Emit): Emit optimized version for decimals in
4094         int range.
4095
4096         * expression.cs (ResolveOperator): Changed order of constant
4097         reduction to work correctly with native types which have
4098         overloaded operators.
4099         (ResolveMemberAccess): Extract constant value from attribute
4100         for decimal type.
4101
4102         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4103
4104         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4105         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4106         (ChangeType): Decimal is special.
4107         (TypeToCoreType): Add decimal type.
4108
4109 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4110
4111         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4112         decimal types.
4113
4114 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4115
4116         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4117         test cs1667-5.cs.
4118
4119 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4120
4121         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4122
4123         * pending.cs (PendingImplementation): Grab only interfaces.
4124
4125 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4126
4127         * statement.cs (ForeachHelperMethods): Add location member and
4128         error 202 detection.
4129
4130 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4131
4132         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4133         automatically handled by executable.make.
4134         (PROGRAM): Make profile-specific.
4135
4136 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4137
4138         * expression.cs (DoResolveBase): Fixed wrong warning for out
4139         variables.
4140
4141 2004-11-18  Martin Baulig  <martin@ximian.com>
4142
4143         Merged latest changes into gmcs.  Please keep this comment in
4144         here, it makes it easier for me to see what changed in MCS since
4145         the last time I merged.
4146
4147 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4148
4149         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4150         (TypeHandle.GetMemberCache): New.
4151         (TypeHandle.TypeHandle): Update.
4152         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4153         (TypeManager.LookupParentInterfacesCache):
4154         Rename from LookupInterfaceCache.  Optimize slightly.
4155         (TypeManager.MemberLookup_FindMembers): Update.
4156         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4157         multi-type variant.
4158         (AddCacheContents): Rename from AddHashtable.
4159         * class.cs (TypeContainer.parent_container): Remove.
4160         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4161         (TypeContainer.DoDefineMembers): Don't initialize it.
4162         Update to name changes.
4163         
4164 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4165
4166         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4167         that factors the code to check access modifiers on override.  
4168
4169         (PropertyBase): Use the code here.
4170
4171         Patch from Lluis S'anchez, fixes bug #69361.
4172
4173 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4174
4175         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4176         routine that is used to report the use of a captured variable
4177         whose address has been taken.
4178
4179         There are two checks: one when variables are being captured and
4180         the other check is when the address of a variable is taken. 
4181         
4182         (because an anonymous methods might be resolved before *or* after
4183         the address has been taken) and 
4184
4185         * expression.cs (Conditional.DoResolve): Remove the special
4186         casing that Martin added to trueExpr and falseExpr being both
4187         NullLiteral.  We get the right behavior now just by introducing
4188         the null_type into the compiler. 
4189
4190         * convert.cs (ExplicitConversion): Change the code to use
4191         null_type instead of testing `expr is NullLiteral'.
4192         (ImplicitConversionStandard): use null_type too.
4193         (ImplicitReferenceConversionExists): use null_type too.
4194         (ImplicitReferenceConversion): use null_type too.
4195
4196         * literal.cs: The type of `NullLiteral' is now null_type instead
4197         of object_type. 
4198         (Resolve): Set the type here.
4199
4200         * typemanager.cs: Introduce null_type.
4201
4202 2004-11-17  Martin Baulig  <martin@ximian.com>
4203
4204         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4205         direction, like FindMembers() does.  Fixes #69546, testcase is in
4206         test-315.cs.    
4207
4208 2004-11-16  Martin Baulig  <martin@ximian.com>
4209
4210         This is based on a patch from Marek Safar, see bug #69082.
4211         Fixes bugs #63705 and #67130.
4212
4213         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4214         method; create a MemberCache for an interface type and cache the
4215         result.
4216
4217         * decl.cs (IMemberContainer.ParentContainer): Removed.
4218         (IMemberContainer.ParentCache): New property.
4219         (MemberCache.SetupCacheForInterface): Removed.
4220         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4221         to create a cache for an interface's "parent".
4222
4223         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4224         interfaces too.
4225
4226 2004-11-16  Martin Baulig  <martin@ximian.com>
4227
4228         Merged back from gmcs; these changes already went into gmcs a
4229         couple of weeks ago.
4230
4231         * typemanager.cs
4232         (TypeManager.AddUserType): Removed the `ifaces' argument.
4233         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4234         `TypeExpr []'.
4235         (TypeManager.AddUserInterface): Removed.
4236         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4237         `TypeExpr []'.
4238         (TypeManager.GetInterfaces): Likewise.
4239         (TypeManager.GetExplicitInterfaces): Likewise.
4240
4241         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4242
4243         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4244         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4245
4246 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4247
4248         * statement.cs: Avoid adding bools to a hashtable.
4249
4250 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4251
4252         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4253         calling an unsafe method from a safe location.
4254
4255 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4256
4257         Fix #69167
4258         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4259
4260 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4261
4262         * namespace.cs (VerifyUsing): use GetPartialName instead of
4263         ToString. 
4264
4265 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4266
4267         * statement.cs (Return.Resolve): Fix regression in typo: if
4268         `in_exc', we have to request a NeedReturnLabel, this was a typo
4269         introduced in the anonymous method check-in.  Fixes #69131.
4270
4271         * Indexers were using the ShortName when defining themselves,
4272         causing a regression in the compiler bootstrap when applying the
4273         patch from 2004-11-02 (first part), now they use their full name
4274         and the bug is gone.
4275
4276 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4277
4278         * driver.cs: Strip the path from the names of embedded resources. Fixes
4279         #68519.
4280
4281 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4282
4283         Fix error message regression: cs0104-2.cs.
4284         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4285         (AliasEntry.Resolve): Update.
4286         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4287         'silent' flag.
4288         (RootContext.LookupType): Update.
4289
4290 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4291
4292         * cs-parser.jay: Add support for handling accessor modifiers
4293         * class: Add support port accessor modifiers and error checking,
4294         define PropertyMethod.Define as virtual (not abstract anymore)
4295         * ecore.cs: Add checking for proeprties access with access modifiers
4296         * iterators.cs: Modify Accessor constructor call based in the modified
4297         constructor
4298 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4299
4300         * expression.cs (StringConcat): Handle being called twice,
4301         as when we have a concat in a field init with more than two
4302         ctors in the class
4303
4304 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4305
4306         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4307         special case explicit implementations, we should always produce
4308         the .property or .event declaration.
4309         
4310         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4311         since it will not return correct data if people use this
4312         unresolved in the presence of using statements (see test-313).
4313
4314         * class.cs (MethodData.Define): If we are an explicit interface
4315         implementation, set the method name to the full name of the
4316         interface plus the name of the method.  
4317
4318         Notice that using the method.MethodName.GetFullName() does not
4319         work, as it will only contain the name as declared on the source
4320         file (it can be a shorthand in the presence of using statements)
4321         and not the fully qualifed type name, for example:
4322
4323         using System;
4324
4325         class D : ICloneable {
4326                 object ICloneable.Clone ()  {
4327                 }
4328         }
4329
4330         Would produce a method called `ICloneable.Clone' instead of
4331         `System.ICloneable.Clone'.
4332
4333         * namespace.cs (Alias.Resolve): Use GetPartialName.
4334         
4335 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4336
4337         * cs-parser.jay: Add error 1055 report.
4338
4339 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4340
4341         * assign.cs (Assign.DoResolve): Only do the transform of
4342         assignment into a New if the types are compatible, if not, fall
4343         through and let the implicit code deal with the errors and with
4344         the necessary conversions. 
4345
4346 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4347
4348         * cs-parser.jay: Add error 1031 report.
4349
4350         * cs-tokenizer.cs: Add location for error 1038.
4351
4352 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4353
4354         * cs-parser.jay: Add error 1016 report.
4355
4356 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4357
4358         * cs-parser.jay: Add errors 1575,1611 report.
4359
4360 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4361
4362         * cs-parser.jay: Add error 1001 report.
4363
4364 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4365
4366         Fix #68850
4367         * attribute.cs (GetMarshal): Add method argument for
4368         caller identification.
4369
4370         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4371         agument for GetMarshal and RuntimeMissingSupport.
4372
4373 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4374
4375         * attribute.cs (ExtractSecurityPermissionSet): Removed
4376         TypeManager.code_access_permission_type.
4377
4378         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4379
4380 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4381
4382         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4383         for obsolete use of a variable here.   Fixes regression on errors
4384         cs0619-25 and cs0619-26.
4385
4386 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4387
4388         Fix #62358, implemented security attribute encoding.
4389
4390         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4391         Tests permitted SecurityAction for assembly or other types.
4392         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4393         data from SecurityPermissionAttribute to PermisionSet class.
4394
4395         * class.cs (ApplyAttributeBuilder): Added special handling
4396         for System.Security.Permissions.SecurityAttribute based types.
4397
4398         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4399         special handling for System.Security.Permissions.SecurityAttribute
4400         based types.
4401
4402         * enum.cs (ApplyAttributeBuilder): Added special handling
4403         for System.Security.Permissions.SecurityAttribute based types.
4404
4405         * parameter.cs (ApplyAttributeBuilder): Added special handling
4406         for System.Security.Permissions.SecurityAttribute based types.
4407
4408         * rootcontext.cs: Next 2 core types.
4409
4410         * typemanager.cs (TypeManager.security_permission_attr_type):
4411         Built in type for the SecurityPermission Attribute.
4412         (code_access_permission_type): Build in type.
4413
4414 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4415
4416         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4417         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4418         all of this information into
4419         EmitContext.EmitCapturedVariableInstance.
4420         
4421         * codegen.cs (EmitCapturedVariableInstance): move here the
4422         funcionality of emitting an ldarg.0 in the presence of a
4423         remapping.   This centralizes the instance emit code.
4424
4425         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4426         then emit a load of this: it means that we have reached the
4427         topmost ScopeInfo: the one that contains the pointer to the
4428         instance of the class hosting the anonymous method.
4429
4430         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4431         captures to the topmost CaptureContext.
4432
4433 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4434
4435         * expression.cs (LocalVariableReference): Move the knowledge about
4436         the iterators into codegen's EmitCapturedVariableInstance.
4437
4438 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4439
4440         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4441         all code paths return a value from an anonymous method (it is the
4442         same as the 161 error, but for anonymous methods).
4443
4444 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4445
4446         The introduction of anonymous methods in the compiler changed
4447         various ways of doing things in the compiler.  The most
4448         significant one is the hard split between the resolution phase
4449         and the emission phases of the compiler.
4450
4451         For instance, routines that referenced local variables no
4452         longer can safely create temporary variables during the
4453         resolution phase: they must do so from the emission phase,
4454         since the variable might have been "captured", hence access to
4455         it can not be done with the local-variable operations from the runtime.
4456         
4457         * statement.cs 
4458
4459         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4460         is a toplevel block.
4461
4462         (ToplevelBlock): A new kind of Block, these are the blocks that
4463         are created by the parser for all toplevel method bodies.  These
4464         include methods, accessors and anonymous methods.
4465
4466         These contain some extra information not found in regular blocks:
4467         A pointer to an optional CaptureContext (for tracking captured
4468         local variables and parameters).  A pointer to the parent
4469         ToplevelBlock.
4470         
4471         (Return.Resolve): Catch missmatches when returning a value from an
4472         anonymous method (error 1662).
4473         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4474         phase.
4475
4476         (Break.Resolve): ditto.
4477
4478         (SwitchLabel): instead of defining the labels during the
4479         resolution phase, we now turned the public ILLabel and ILLabelCode
4480         labels into methods called GetILLabelCode() and GetILLabel() that
4481         only define the label during the Emit phase.
4482
4483         (GotoCase): Track the SwitchLabel instead of the computed label
4484         (its contained therein).  Emit the code by using
4485         SwitchLabel.GetILLabelCode ().
4486
4487         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4488         whether the Local has been captured or not.
4489
4490         (LocalInfo.IsCaptured): New property, used to tell whether the
4491         local has been captured.
4492         
4493         * anonymous.cs: Vastly updated to contain the anonymous method
4494         support.
4495
4496         The main classes here are: CaptureContext which tracks any
4497         captured information for a toplevel block and ScopeInfo used to
4498         track the activation frames for various local variables.   
4499
4500         Each toplevel block has an optional capture context associated
4501         with it.  When a method contains an anonymous method both the
4502         toplevel method and the anonymous method will create a capture
4503         context.   When variables or parameters are captured, they are
4504         recorded on the CaptureContext that owns them, for example:
4505
4506         void Demo () {
4507              int a;
4508              MyDelegate d = delegate {
4509                  a = 1;
4510              }
4511         }
4512
4513         Here `a' will be recorded as captured on the toplevel
4514         CapturedContext, the inner captured context will not have anything
4515         (it will only have data if local variables or parameters from it
4516         are captured in a nested anonymous method.
4517
4518         The ScopeInfo is used to track the activation frames for local
4519         variables, for example:
4520
4521         for (int i = 0; i < 10; i++)
4522                 for (int j = 0; j < 10; j++){
4523                    MyDelegate d = delegate {
4524                         call (i, j);
4525                    }
4526                 }
4527
4528         At runtime this captures a single captured variable `i', but it
4529         captures 10 different versions of the variable `j'.  The variable
4530         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4531         recorded on a child.  
4532
4533         The toplevel ScopeInfo will also track information like the `this'
4534         pointer if instance variables were referenced (this is necessary
4535         as the anonymous method lives inside a nested class in the host
4536         type of the method). 
4537
4538         (AnonymousMethod): Expanded to track the Toplevel, implement
4539         `AnonymousMethod.Compatible' to tell whether an anonymous method
4540         can be converted to a target delegate type. 
4541
4542         The routine now also produces the anonymous method content
4543
4544         (AnonymousDelegate): A helper class that derives from
4545         DelegateCreation, this is used to generate the code necessary to
4546         produce the delegate for the anonymous method that was created. 
4547
4548         * assign.cs: API adjustments for new changes in
4549         Convert.ImplicitStandardConversionExists.
4550
4551         * class.cs: Adjustments to cope with the fact that now toplevel
4552         blocks are of type `ToplevelBlock'. 
4553
4554         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4555         insteda of standard blocks.
4556
4557         Flag errors if params arguments are passed to anonymous methods.
4558
4559         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4560         `CurrentAnonymousMethod' which points to the current Anonymous
4561         Method.  The variable points to the AnonymousMethod class that
4562         holds the code being compiled.  It is set in the new EmitContext
4563         created for the anonymous method.
4564
4565         (EmitContext.Phase): Introduce a variable and an enumeration to
4566         assist in enforcing some rules about when and where we are allowed
4567         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4568         only one that enfonces this right now).
4569
4570         (EmitContext.HaveCaptureInfo): new helper method that returns
4571         whether we have a CapturedContext initialized.
4572
4573         (EmitContext.CaptureVariable): New method used to register that a
4574         LocalInfo must be flagged for capturing. 
4575
4576         (EmitContext.CapturedParameter): New method used to register that a
4577         parameters must be flagged for capturing. 
4578         
4579         (EmitContext.CapturedField): New method used to register that a
4580         field must be flagged for capturing. 
4581
4582         (EmitContext.HaveCapturedVariables,
4583         EmitContext.HaveCapturedFields): Return whether there are captured
4584         variables or fields. 
4585
4586         (EmitContext.EmitMethodHostInstance): This is used to emit the
4587         instance for the anonymous method.  The instance might be null
4588         (static methods), this (for anonymous methods that capture nothing
4589         and happen to live side-by-side with the current method body) or a
4590         more complicated expression if the method has a CaptureContext.
4591
4592         (EmitContext.EmitTopBlock): Routine that drives the emission of
4593         code: it will first resolve the top block, then emit any metadata
4594         and then emit the code.  The split is done so that we can extract
4595         any anonymous methods and flag any captured variables/parameters.
4596         
4597         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4598         during this phase, the ILGenerator should not be used as labels
4599         and local variables declared here might not be accessible to any
4600         code that is part of an anonymous method.  
4601
4602         Exceptions to this include the temporary variables that are
4603         created by some statements internally for holding temporary
4604         variables. 
4605         
4606         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4607         metadata for a cb
4608
4609         (EmitContext.TemporaryReturn): This method is typically called
4610         from the Emit phase, and its the only place where we allow the
4611         ReturnLabel to be defined other than the EmitMeta.  The reason is
4612         that otherwise we would have to duplicate a lot of logic in the
4613         Resolve phases of various methods that today is on the Emit
4614         phase. 
4615
4616         (EmitContext.NeedReturnLabel): This no longer creates the label,
4617         as the ILGenerator is not valid during the resolve phase.
4618
4619         (EmitContext.EmitThis): Extended the knowledge in this class to
4620         work in anonymous methods in addition to iterators. 
4621
4622         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4623         code is necessary on the stack to access the instance to a local
4624         variable (the variable will be accessed as a field).
4625
4626         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4627         EmitContext.EmitAddressOfParameter): Routines to support
4628         parameters (not completed at this point). 
4629         
4630         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4631         will also remove the parameters.
4632
4633         * convert.cs (Convert): Define a `ConstantEC' which points to a
4634         null.  This is just to prefity some code that uses
4635         ImplicitStandardConversion code and do not have an EmitContext
4636         handy.
4637
4638         The idea is to flag explicitly that at that point in time, it is
4639         known that the conversion will not trigger the delegate checking
4640         code in implicit conversions (which requires a valid
4641         EmitContext). 
4642
4643         Everywhere: pass new EmitContext parameter since
4644         ImplicitStandardConversionExists now requires it to check for
4645         anonymous method conversions. 
4646
4647         (Convert.ImplicitStandardConversionExists): If the type of an
4648         expression is the anonymous_method_type, and the type is a
4649         delegate, we invoke the AnonymousMethod.Compatible method to check
4650         whether an implicit conversion is possible. 
4651
4652         (Convert.ImplicitConversionStandard): Only do implicit method
4653         group conversions if the language level is not ISO_1.
4654
4655         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4656         MethodInfo for the Invoke method.  used by Delegate and
4657         AnonymousDelegate.
4658
4659         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4660         method conversions if the target type is a delegate.
4661
4662         Removed extra debugging nops.
4663
4664         (LocalVariableReference): Turn the `local_info' into a public
4665         field. 
4666
4667         Add `prepared' field, the same hack used for FieldExprs to cope
4668         with composed assignments, as Local variables do not necessarily
4669         operate purely on the stack as they used to: they can be captured
4670         fields. 
4671
4672         Add `temp' for a temporary result, like fields.
4673
4674         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4675
4676         It now copes with Local variables that are captured and emits the
4677         proper instance variable to load it from a field in the captured
4678         case. 
4679
4680         (ParameterReference.DoResolveBase): During the resolve phase,
4681         capture parameters if we are in an anonymous method.
4682
4683         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4684         anonymous method, use the EmitContext helper routines to emit the
4685         parameter reference.
4686
4687         * iterators.cs: Set RemapToProxy to true/false during the
4688         EmitDispose class.
4689
4690         * parameters.cs (GetParameterByName): New helper method. 
4691
4692         * typemanager.cs (anonymous_method_type) a new type that
4693         represents an anonyous method.  This is always an internal type,
4694         used as a fencepost to test against the anonymous-methodness of an
4695         expression. 
4696         
4697 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4698
4699         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4700         561 report.
4701         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4702
4703 2004-10-18  Martin Baulig  <martin@ximian.com>
4704
4705         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4706         `Type' directly, but call ResolveType() on it.
4707         (Catch.Resolve): Likewise.
4708         (Foreach.Resolve): Likewise.
4709
4710 2004-10-18  Martin Baulig  <martin@ximian.com>
4711
4712         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4713         `Type' directly, but call ResolveType() on it.
4714         (Probe.DoResolve): Likewise.
4715         (ArrayCreation.LookupType): Likewise.
4716         (TypeOf.DoResolve): Likewise.
4717         (SizeOf.DoResolve): Likewise.
4718
4719 2004-10-18  Martin Baulig  <martin@ximian.com>
4720
4721         * expression.cs (Invocation.BetterFunction): Put back
4722         TypeManager.TypeToCoreType().
4723
4724 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4725
4726         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4727         the ResolveType.
4728
4729 2004-10-18  Martin Baulig  <martin@ximian.com>
4730
4731         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4732         `Type' directly, but call ResolveType() on it.
4733
4734 2004-10-18  Martin Baulig  <martin@ximian.com>
4735
4736         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4737         `Type' directly, but call ResolveType() on it.
4738         (MemberBase.DoDefine): Likewise.
4739
4740         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4741         `Type' directly, but call ResolveType() on it.
4742         (ComposedCast.DoResolveAsTypeStep): Likewise.
4743
4744         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4745         `Type' directly, but call ResolveType() on it.
4746
4747 2004-10-17  John Luke  <john.luke@gmail.com>
4748
4749         * class.cs (Operator.GetSignatureForError): use CSharpName
4750
4751         * parameter.cs (Parameter.GetSignatureForError): Returns
4752         correct name even if was not defined.
4753
4754 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4755
4756         Fix #65816.
4757         * class.cs (TypeContainer.EmitContext): New property.
4758         (DefineNestedTypes): Create an emitcontext for each part.
4759         (MethodCore.DoDefineParameters): Use container's emitcontext.
4760         Pass type array to InternalParameters.
4761         (MemberBase.DoDefine): Use container's emitcontext.
4762         (FieldMember.Define): Likewise.
4763         (Event.Define): Likewise.
4764         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4765         Pass type array to InternalParameters.
4766         (SetIndexerMethod.GetParameterInfo): Likewise.
4767         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4768         * delegate.cs (Define): Pass emitcontext to
4769         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4770         array to InternalParameters.
4771         * expression.cs (ParameterReference.DoResolveBase): Pass
4772         emitcontext to GetParameterInfo.
4773         (ComposedCast.DoResolveAsTypeStep): Remove check on
4774         ec.ResolvingTypeTree.
4775         * parameter.cs (Parameter.Resolve): Change argument to
4776         EmitContext.  Use ResolveAsTypeTerminal.
4777         (Parameter.GetSignature): Change argument to EmitContext.
4778         (Parameters.ComputeSignature): Likewise.
4779         (Parameters.ComputeParameterTypes): Likewise.
4780         (Parameters.GetParameterInfo): Likewise.
4781         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4782         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4783         * support.cs (InternalParameters..ctor): Remove variant that takes
4784         a DeclSpace.
4785         * typemanager.cs (system_intptr_expr): New.
4786         (InitExpressionTypes): Initialize it.
4787
4788 2004-10-12  Chris Toshok  <toshok@ximian.com>
4789
4790         * cs-parser.jay: fix location for try_statement and catch_clause.
4791
4792 2004-10-11  Martin Baulig  <martin@ximian.com>
4793
4794         * report.cs: Don't make --fatal abort on warnings, we have
4795         -warnaserror for that.
4796
4797 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4798
4799         More DeclSpace.ResolveType avoidance.
4800         * decl.cs (MemberCore.InUnsafe): New property.
4801         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4802         with newly created EmitContext.
4803         (FieldMember.Define): Likewise.
4804         * delegate.cs (Delegate.Define): Likewise.
4805         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4806         only if normal name-lookup fails.
4807         (TypeExpr.DoResolve): Enable error-checking.
4808         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4809         (SizeOf.DoResolve): Likewise.
4810         (ComposedCast.DoResolveAsTypeStep): Likewise.
4811         (StackAlloc.DoResolve): Likewise.
4812         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4813         (Block.Unsafe): New property.
4814         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4815         (Unsafe): Set 'unsafe' flag of contained block.
4816         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4817         (Fixed.Resolve): Likewise.
4818         (Catch.Resolve): Likewise.
4819         (Using.ResolveLocalVariableDecls): Likewise.
4820         (Foreach.Resolve): Likewise.
4821
4822 2004-10-05  John Luke <john.luke@gmail.com>
4823
4824         * cs-parser.jay: add location to error CS0175
4825
4826 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4827
4828         * ecore.cs (Expression.Constantity): Add support for turning null
4829         into a constant.
4830
4831         * const.cs (Const.Define): Allow constants to be reference types
4832         as long as the value is Null.
4833
4834 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4835
4836         * namespace.cs (NamespaceEntry.Using): No matter which warning
4837         level is set, check if this namespace name has already been added.
4838
4839 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4840
4841         * expression.cs: reftype [!=]= null should always use br[true,false].
4842         # 67410
4843
4844 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4845
4846         Fix #67108
4847         * attribute.cs: Enum conversion moved to 
4848         GetAttributeArgumentExpression to be applied to the all
4849         expressions.
4850
4851 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4852
4853         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4854         * class.c (TypeContainer.DefineType): Flag error if
4855         base types aren't accessible due to access permissions.
4856         * decl.cs (DeclSpace.ResolveType): Move logic to
4857         Expression.ResolveAsTypeTerminal.
4858         (DeclSpace.ResolveTypeExpr): Thin layer over
4859         Expression.ResolveAsTypeTerminal.
4860         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4861         Refactor code into NestedAccess.  Use it.
4862         (DeclSpace.NestedAccess): New.
4863         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4864         argument to silence errors.  Check access permissions.
4865         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4866         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4867         (Cast.DoResolve): Likewise.
4868         (New.DoResolve): Likewise.
4869         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4870         (TypeOf.DoResolve): Likewise.
4871
4872         * expression.cs (Invocation.BetterConversion): Return the Type of
4873         the better conversion.  Implement section 14.4.2.3 more faithfully.
4874         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4875         section 14.4.2.2 explicit.
4876         (Invocation.OverloadResolve): Update.
4877         (Invocation): Remove is_base field.
4878         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4879         (Invocation.Emit): Likewise.
4880
4881 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4882
4883         * README: Update to changes.
4884
4885 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4886
4887         * cs-parser.jay: Reverted 642 warning fix.
4888
4889 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4890
4891         Fix bug #66615
4892         * decl.cs (FindMemberWithSameName): Indexer can have more than
4893         1 argument.
4894
4895 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4896
4897         * expression.cs (LocalVariableReference.DoResolveLValue):
4898         Do not report warning 219 for out values.
4899         (EmptyExpression.Null): New member to avoid extra allocations.
4900
4901 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4902
4903         * cs-parser.jay: Fix wrong warning 642 report.
4904
4905         * cs-tokenizer.cs (CheckNextToken): New helper;
4906         Inspect next character if is same as expected.
4907
4908 2004-09-23  Martin Baulig  <martin@ximian.com>
4909
4910         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4911         (Convert.ImplicitReferenceConversionExists): Likewise.
4912
4913 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4914
4915         * class.cs (Operator.Define): Add error 448 and 559 report.
4916
4917 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4918
4919         * class.cs (MemberBase.IsTypePermitted): New protected
4920         method for checking error CS0610.
4921
4922 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4923
4924         * class.cs (TypeContainer.HasExplicitLayout): New property
4925         Returns whether container has StructLayout attribute set Explicit.
4926         (FieldMember): New abstract class for consts and fields.
4927         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4928         (Field): Reuse FieldMember.
4929
4930         * const.cs (Const): Reuse FieldMember.
4931
4932         * rootcontext.cs: EmitConstants call moved to class.
4933
4934 2004-09-22  Martin Baulig  <martin@ximian.com>
4935
4936         Thanks to Peter Sestoft for this bug report.
4937
4938         * expression.cs (Conditional): If both the `trueExpr' and the
4939         `falseExpr' is a NullLiteral, return a NullLiteral.
4940
4941 2004-09-22  Martin Baulig  <martin@ximian.com>
4942
4943         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4944         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4945         for the "get_Current" call.
4946
4947 2004-09-22  Martin Baulig  <martin@ximian.com>
4948
4949         Marek and me just fixed one of our oldest bugs: #28562 :-)
4950
4951         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4952
4953         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4954         we're an EnumConstant, just return that.
4955         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4956         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4957         to get the value which'll actually be written into the attribute.
4958         However, we have to use GetValue() to access the attribute's value
4959         in the compiler.        
4960
4961 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4962
4963         * constant.cs (Constant.IsNegative): New abstract property
4964         IsNegative.
4965
4966         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4967         (StackAlloc.DoResolve): Reused IsNegative.
4968
4969 2004-09-21  Martin Baulig  <martin@ximian.com>
4970
4971         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4972         if we're used in an iterator, we may be called from different
4973         methods.
4974
4975         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4976         we actually have an exception block.
4977
4978 2004-09-20  John Luke <jluke@cfl.rr.com>
4979
4980         * class.cs, cs-parser.jay: Improve the error report for 1520:
4981         report the actual line where the error happens, not where the
4982         class was declared.
4983
4984         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4985         Pass location information that was available elsewhere.
4986
4987 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4988
4989         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4990         runtime to delay sign assemblies.
4991
4992 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4993
4994         * cs-parser.jay: Do not report the stack trace, this is barely
4995         used nowadays.
4996
4997 2004-08-22  John Luke  <john.luke@gmail.com>
4998  
4999         * driver.cs : check that a resource id is not already used
5000         before adding it, report CS1508 if it is, bug #63637
5001
5002 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5003
5004         * ecore.cs: Removed dead code.
5005
5006 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5007
5008         * class.cs: Do not report warning CS0067 on the interfaces.
5009
5010 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5011
5012         * cs-parser.jay: Add error 504 report.
5013
5014 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5015
5016         * rootcontext.cs: WarningLevel is 4 by default now.
5017
5018         * statement.cs (Fixed.Resolve): Do not null
5019         VariableInfo.
5020
5021 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5022
5023         Fixed bug #55780
5024         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5025         deep search when property is not virtual.
5026         (PropertyExpr.ResolveAccessors): Make one call for both
5027         accessors.
5028
5029 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5030
5031         Fixed bug #65766
5032         * statement.cs: Error 152 report constains also location.
5033
5034 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5035
5036         Fixed bug #65766
5037         * const.cs: Explicitly set constant as static.
5038
5039 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5040
5041         Fixed bug #64226
5042         * cs-parser.jay: Add error 1017 report.
5043
5044 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5045
5046         Fixed bug #59980, #64224
5047         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5048
5049         * typemanager.cs (IsSpecialMethod): Simplified
5050
5051 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5052
5053         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5054         condition with better params.
5055
5056 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5057
5058         Fixed bug #65238
5059         * attribute.cs (Resolve): Property has to have both
5060         accessors.
5061
5062 2004-09-14  Martin Baulig  <martin@ximian.com>
5063
5064         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5065
5066 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5067
5068         Fixed bug #61902
5069         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5070         called and is obsolete then this member suppress message
5071         when call is inside next [Obsolete] method or type.
5072
5073         * expression.cs: Use TestObsoleteMethodUsage member.
5074
5075 2004-09-14  Martin Baulig  <martin@ximian.com>
5076
5077         * cs-parser.jay: Sync a bit with the GMCS version.
5078
5079 2004-09-14  Martin Baulig  <martin@ximian.com>
5080
5081         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5082         (CSharpParser.yacc_verbose_flag): New public field.
5083
5084         * genericparser.cs: Removed.
5085
5086 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5087
5088         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5089
5090 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5091
5092         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5093
5094 2004-09-10  Martin Baulig  <martin@ximian.com>
5095
5096         Backported my MemberName changes from GMCS into MCS.
5097
5098         - we are now using a special `MemberName' class instead of using
5099         strings; in GMCS, the `MemberName' also contains the type
5100         arguments.
5101
5102         - changed the grammar rules a bit:
5103           * the old `member_name' is now a `namespace_or_type_name':
5104             The rule is that we use `namespace_or_type_name' everywhere
5105             where we expect either a "member name" (GetEnumerator) or a
5106             "member name" with an explicit interface name
5107             (IEnumerable.GetEnumerator).
5108             In GMCS, the explicit interface name may include type arguments
5109             (IEnumerable<T>.GetEnumerator).
5110           * we use `member_name' instead of just `IDENTIFIER' for
5111             "member names":
5112             The rule is that we use `member_name' wherever a member may
5113             have type parameters in GMCS.       
5114
5115         * decl.cs (MemberName): New public class.
5116         (MemberCore.MemberName): New public readonly field.
5117         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5118         (DeclSpace): Likewise.
5119
5120         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5121         * enum.cs (Enum.ctor): Likewise.
5122
5123         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5124         MemberName.     
5125         (AliasEntry.ctor): Take a MemberName, not an Expression.
5126         (AliasEntry.UsingAlias): Likewise.
5127
5128         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5129         (IMethodData.MemberName): Changed type from string to MemberName.
5130         (MemberBase.ExplicitInterfaceName): Likewise.
5131         (AbstractPropertyEventMethod.SetupName): Make this private.
5132         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5133         argument; compute the member name here.
5134         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5135         on the `member.MemberName' and the `prefix'.
5136
5137         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5138         not `type_name'.
5139         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5140         thus, we get a `MemberName' instead of a `string'.  These
5141         declarations may have type parameters in GMCS.
5142         (interface_method_declaration, delegate_declaration): Likewise.
5143         (class_declaration, interface_declaration): Likewise.
5144         (method_header): Use `namespace_or_type_name' instead of
5145         `member_name'.  We may be an explicit interface implementation.
5146         (property_declaration, event_declaration): Likewise.
5147         (member_name): This is now just an `IDENTIFIER', not a
5148         `namespace_or_type_name'.
5149         (type_name, interface_type): Removed.
5150         (namespace_or_type_name): Return a MemberName, not an Expression.
5151         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5152         call GetTypeExpression() on the MemberName to get an expression.
5153         (IndexerDeclaration.interface_type): Changed type from string to
5154         MemberName.
5155         (MakeName): Operate on MemberName's instead of string's.
5156
5157 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5158
5159         Fix bug #55770.
5160         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5161         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5162         lookup to avoid symbols introduced by 'using'.
5163         * rootcontext.cs (NamespaceLookup): Update.
5164
5165 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5166
5167         * class.cs (TypeContainer.DoDefineMembers): Do not call
5168         DefineDefaultConstructor for static classes.
5169
5170 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5171
5172         * attribute.cs (Attribute.Resolve): Add error 653 report.
5173
5174         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5175         report.
5176         (Method.ApplyAttributeBuilder): Add error 685 report.
5177         (Operator.Define): Add error 564 report.
5178
5179         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5180
5181         * expression.cs (Invocation.DoResolve): Add error
5182         245 and 250 report.
5183
5184         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5185         error 674 report.
5186
5187 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5188
5189         * class.cs (ConstructorInitializer.Resolve):
5190         Wrong error number (515->516).
5191
5192 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5193
5194         * class.cs (Indexer.Define): Add error 631 report.
5195
5196 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5197
5198         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5199
5200 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5201
5202         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5203
5204 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5205
5206         * cs-parser.jay: Added error CS0241 report.
5207
5208 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5209
5210         * cs-parser.jay (fixed_statement): Introduce a scope for the
5211         declaration in the 'fixed' statement.
5212
5213 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5214
5215         * cs-parser.jay: Added CS0230 error report.
5216
5217 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5218
5219         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5220
5221 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5222
5223         * expression.cs (Argument.Resolve): Added error CS0192 and
5224         CS0199 report.
5225
5226 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5227
5228         C# 2.0 #pragma warning feature
5229
5230         * cs-tokenizer.cs (PreProcessPragma): New method; 
5231         Handles #pragma directive.
5232
5233         * report.cs (WarningRegions): New class; Support
5234         class for #pragma warning directive. It tests whether
5235         warning is enabled for a given line.
5236
5237 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5238
5239         * const.cs: Add more descriptive error report, tahnks to
5240         Sebastien. 
5241
5242 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5243
5244         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5245
5246 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5247
5248         * expression.cs: Apply patch from Ben: Remove dead code from
5249         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5250         as that code just threw an exception anwyays.
5251
5252         * const.cs: Remove the call to the turnintoconstant, for details
5253         see bug: #63144
5254         
5255         * literal.cs: The type of the null-literal is the null type;  So
5256         we use a placeholder type (literal.cs:System.Null, defined here)
5257         for it.
5258
5259         * expression.cs (Conditional.DoResolve): Remove some old code that
5260         is no longer needed, conversions have been fixed.
5261
5262         (ArrayCreationExpression.DoResolve): Return false if we fail to
5263         resolve the inner expression.
5264
5265 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5266
5267         Fix test-290.cs.
5268         * cs-parser.jay (delegate_declaration): Record a delegate
5269         declaration as a type declaration.
5270         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5271
5272 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5273
5274         * parameter.cs: Do not crash if the type can not be resolved. 
5275
5276         * expression.cs: Report errors with unsafe pointers, fixes #64896
5277
5278 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5279
5280         * expression.cs: Pointer arith always needs to do a conv.i
5281         if the operand is a long. fix 65320
5282
5283 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5284
5285         Fixed cs0619-37.cs, cs0619-38.cs
5286
5287         * enum.cs (GetObsoleteAttribute): Removed.
5288
5289         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5290         on Enum member is double staged. The first is tested member
5291         and then enum.
5292
5293 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5294
5295         Fixed #56986, #63631, #65231
5296
5297         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5298         adds member to name container.
5299         (TypeContainer.AddToTypeContainer): New method, adds type to
5300         name container.
5301         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5302         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5303         AddOperator): Simplified by reusing AddToMemberContainer.
5304         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5305         instead of field.
5306         (Method.CheckForDuplications): Fixed implementation to test all
5307         possibilities.
5308         (MemberBase): Detection whether member is explicit interface
5309         implementation is now in constructor.
5310         (MemberBase.UpdateMemberName): Handles IndexerName.
5311         (Accessor): Changed to keep also location information.
5312         (AbstractPropertyEventMethod): Is derived from MemberCore.
5313         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5314         will be emited or not.
5315         (PropertyBase.AreAccessorsDuplicateImplementation):
5316         Tests whether accessors are not in collision with some method.
5317         (Operator): Is derived from MethodCore to simplify common
5318         operations.
5319
5320         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5321         must be performed.
5322         (DeclSpace.AddToContainer): Adds the member to defined_names
5323         table. It tests for duplications and enclosing name conflicts.
5324
5325         * enum.cs (EnumMember): Clean up to reuse the base structures
5326
5327 2004-09-03  Martin Baulig  <martin@ximian.com>
5328
5329         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5330         into TypeContainer, to make partial classes work again.
5331
5332 2004-09-03  Martin Baulig  <martin@ximian.com>
5333
5334         * rootcontext.cs (RootContext.V2): Removed.
5335
5336 2004-03-23  Martin Baulig  <martin@ximian.com>
5337
5338         * expression.cs (Invocation.OverloadResolve): Added `bool
5339         may_fail' argument and use it instead of the Location.IsNull() hack.
5340
5341 2004-09-03  Martin Baulig  <martin@ximian.com>
5342
5343         Merged latest changes into gmcs.  Please keep this comment in
5344         here, it makes it easier for me to see what changed in MCS since
5345         the last time I merged.
5346
5347 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5348
5349         Fix #61128.
5350         * expression.cs (BetterConversion): Don't allow either conversion 
5351         to be null.  Remove redundant implicit conversion test when 'q ==
5352         null' -- when this function is invoked, we already know that the
5353         implicit conversion exists.
5354         (BetterFunction): Assume that 'best' is non-null.  Remove
5355         redundant reimplementation of IsApplicable when 'best' is null.
5356         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5357         number of arguments.
5358         (IsAncestralType): Extract from OverloadResolve.
5359         (OverloadResolve): Make robust to the MethodGroupExpr being
5360         unsorted.  Implement all the logic of Section 14.5.5.1, and
5361         support overloading of methods from multiple applicable types.
5362         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5363
5364         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5365         (RealError, Warning): Append type of report to related symbol.
5366
5367 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5368
5369         * enum.cs: Fixed CLS-Compliance checks for enum members.
5370         Error tests cs3008-8.cs, cs3014-8.cs
5371
5372 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5373
5374         Fixed bug #62342, #63102
5375         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5376         like ImplementMethod.
5377
5378 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5379
5380         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5381         Fixed bug #65170.
5382
5383 2004-09-02  Martin Baulig  <martin@ximian.com>
5384
5385         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5386         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5387         on the MethodBase.
5388
5389 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5390
5391         C# 2.0 Static classes implemented
5392
5393         * class.cs (TypeContainer): instance_constructors,
5394         initialized_fields, initialized_static_fields,
5395         default_constructor, base_inteface_types are protected to be
5396         accessible from StaticClass.
5397         (TypeContainer.DefineDefaultConstructor): New virtual method
5398         for custom default constructor generating
5399         (StaticClass): New class to handle "Static classes" feature.
5400
5401         * cs-parser.jay: Handle static keyword on class like instance
5402         of StaticClass.
5403
5404         * driver.cs: Added "/langversion" command line switch with two
5405         options (iso-1, default).
5406
5407 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5408
5409         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5410
5411 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5412
5413         * delegate.cs: Style.
5414
5415 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5416
5417         * delegate.cs: Add seperate instance expr field for miguel.
5418
5419 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5420
5421         * PointerArithmetic (Resolve): make sure we are not doing
5422         pointer arith on void*. Also, make sure we are resolved
5423         by not setting eclass until resolve.
5424
5425         All callers: Make sure that PointerArithmetic gets resolved.
5426
5427 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5428
5429         * ArrayCreation (LookupType): If the type does not resolve 
5430         to an array, give an error.
5431
5432 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5433
5434         * statement.cs (Try.Resolve): Fixed bug #64222
5435
5436 2004-08-27  Martin Baulig  <martin@ximian.com>
5437
5438         * class.cs
5439         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5440         crash here.     
5441
5442 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5443
5444         * ecore.cs (Constantify): Get underlying type via
5445         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5446         Windows in special cases.
5447
5448 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5449
5450         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5451         for obtaining also private methods.
5452         (GetRemoveMethod): Used GetRemoveMethod (true)
5453         for obtaining also private methods.
5454
5455 2004-08-24  Martin Baulig  <martin@ximian.com>
5456
5457         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5458         MethodAttributes.HideBySig for operators.
5459
5460 2004-08-23  Martin Baulig  <martin@ximian.com>
5461
5462         Back to the old error reporting system :-)
5463
5464         * report.cs (Message): Removed.
5465         (Report.MessageData, ErrorData, WarningData): Removed.
5466         (Report.Error, Warning): Back to the old system.
5467
5468 2004-08-23  Martin Baulig  <martin@ximian.com>
5469
5470         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5471
5472         * class.cs (TypeContainer.ParentContainer): New public virtual
5473         method; replaces the explicit interface implementation.
5474         (ClassPart.ParentContainer): Override.
5475
5476 2004-08-23  Martin Baulig  <martin@ximian.com>
5477
5478         * statement.cs (Switch): Added support for constant switches; see
5479         #59428 or test-285.cs.
5480
5481 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5482
5483         Fixed bug #62740.
5484         * statement.cs (GetEnumeratorFilter): Removed useless
5485         logic because C# specs is strict. GetEnumerator must be
5486         public.
5487
5488 2004-08-22  Martin Baulig  <martin@ximian.com>
5489
5490         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5491         a switch and may break, reset the barrier.  Fixes #59867.
5492
5493 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5494
5495         CLS-Compliance speed up (~5% for corlib)
5496
5497         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5498         New method. Tests container for CLS-Compliant names
5499
5500         * class.cs (TypeContainer.VerifyClsName): New method.
5501         Checks whether container name is CLS Compliant.
5502         (Constructor): Implements IMethodData.
5503
5504         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5505         low-case table for CLS Compliance test.
5506         (MemberCache.VerifyClsParameterConflict): New method.
5507         Checks method parameters for CS3006 error.
5508
5509         * enum.cs (EnumMember): Is derived from MemberCore.
5510         (Enum.VerifyClsName): Optimized for better performance.
5511
5512 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5513
5514         * report.cs: Renamed Error_T to Error and changed all
5515         references.
5516
5517 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5518
5519         * class.cs (TypeContainer.IndexerArrayList): New inner class
5520         container for indexers.
5521         (TypeContainer.DefaultIndexerName): New constant for default
5522         indexer name. Replaced all "Item" with this constant.
5523         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5524
5525         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5526         DefaultMemberAttribute constructor.
5527
5528 2004-08-05  Martin Baulig  <martin@ximian.com>
5529
5530         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5531         Fix bug #59429.
5532
5533 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5534
5535         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5536         multi platforms problem.
5537
5538         * compiler.csproj: Included shared files.
5539
5540 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5541
5542         Fix bug 60333, 55971 in the more general way
5543         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5544         Added arg_type argument for constant conversion.
5545         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5546
5547 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5548
5549         Fix bug #59760
5550         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5551         OperatorArrayList, MethodCoreArrayList for typecontainer
5552         containers. Changed class member types to these new types.
5553         (MethodArrayList.DefineMembers): Added test for CS0659.
5554
5555 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5556
5557         * cfold.cs: Synchronize the folding with the code in expression.cs
5558         Binary.DoNumericPromotions for uint operands.
5559
5560         * attribute.cs: Revert patch from Raja, it introduced a regression
5561         while building Blam-1.2.1 (hard to isolate a test case).
5562
5563 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5564
5565         Fix for #55382
5566         * class.cs:
5567         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5568         name collision.
5569         (MethodCore.parent_method): New member. The method we're overriding
5570         if this is an override method.
5571         (MethodCore.CheckBase): Moved from Method class and made common.
5572         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5573         private.
5574         (MethodCore.CheckForDuplications): New abstract method. For custom
5575         member duplication search in a container
5576         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5577         method and its return type.
5578         (Event.conflict_symbol): New member. Symbol with same name in the
5579         parent class.
5580
5581         * decl.cs:
5582         (MemberCache.FindMemberWithSameName): New method. The method
5583         is looking for conflict with inherited symbols.
5584
5585 2004-08-04  Martin Baulig  <martin@ximian.com>
5586
5587         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5588
5589         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5590
5591 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5592
5593         * report.cs (Message): New enum for better error, warning reference in
5594         the code.
5595         (MessageData): New inner abstract class. It generally handles printing of
5596         error and warning messages.
5597         Removed unused Error, Warning, Message methods.
5598
5599 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5600
5601         Fix for cs0592-8.cs test
5602         * attribute.cs
5603         (Attributable.ValidAttributeTargets): Made public.
5604         (Attribute.ExplicitTarget): New member for explicit target value.
5605         (Attribute.CheckTargets): Now we translate explicit attribute
5606         target to Target here.
5607
5608 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5609
5610         * ecore.cs (MethodGroupExpr): new IsBase property.
5611
5612         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5613
5614         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5615         rather than an instance expr.
5616
5617         (DelegateCreation.Emit): Use the method group rather than
5618         the instance expression. Also, if you have base.Foo as the
5619         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5620
5621         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5622
5623         (NewDelegate.DoResolve): Only check for the existance of Invoke
5624         if the method is going to be needed. Use MethodGroupExpr.
5625
5626         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5627
5628         * expression.cs: For pointer arith., make sure to use
5629         the size of the type, not the size of the pointer to
5630         the type.
5631
5632 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5633
5634         Fix for #60722
5635         * class.cs (Class): Added error CS0502 test.
5636
5637 2004-08-03  John Luke  <jluke@cfl.rr.com>
5638             Raja R Harinath  <rharinath@novell.com>
5639
5640         Fix for #60997.
5641         * attribute.cs (Attribute.complained_before): New flag.
5642         (Attribute.ResolveType, Attribute.Resolve),
5643         (Attribute.DefinePInvokeMethod): Set it.
5644         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5645         
5646 2004-08-03  Martin Baulig  <martin@ximian.com>
5647
5648         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5649         use a user-defined operator; we still need to do numeric
5650         promotions in case one argument is a builtin type and the other
5651         one has an implicit conversion to that type.  Fixes #62322.
5652
5653 2004-08-02  Martin Baulig  <martin@ximian.com>
5654
5655         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5656         (LocalInfo.IsThis): New public property.
5657         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5658
5659 2004-08-01  Martin Baulig  <martin@ximian.com>
5660
5661         * class.cs (TypeContainer.GetClassBases): Don't set the default
5662         here since we may get called from GetPartialBases().
5663         (TypeContainer.DefineType): If GetClassBases() didn't return a
5664         parent, use the default one.
5665
5666 2004-07-30  Duncan Mak  <duncan@ximian.com>
5667
5668         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5669
5670 2004-07-30  Martin Baulig  <martin@ximian.com>
5671
5672         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5673
5674         * class.cs (SourceMethod): New public class, derive from the
5675         symbol writer's ISourceMethod.
5676         (Method): Use the new symbol writer API.
5677
5678         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5679         as argument and use the new symbol writer.
5680
5681         * location.cs
5682         (SourceFile): Implement the symbol writer's ISourceFile.
5683         (Location.SymbolDocument): Removed.
5684         (Location.SourceFile): New public property.
5685
5686         * symbolwriter.cs: Use the new symbol writer API.
5687
5688 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5689
5690         * Makefile (install-local): Remove.  Functionality moved to
5691         executable.make.
5692
5693 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5694
5695         * Makefile: Install mcs.exe.config file together with mcs.exe.
5696         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5697         correct runtime version.
5698         
5699 2004-07-25  Martin Baulig  <martin@ximian.com>
5700
5701         * class.cs
5702         (TypeContainer.RegisterOrder): Removed, this was unused.
5703         (TypeContainer, interface_order): Removed.
5704         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5705         TypeContainer as argument since we can also be called with a
5706         `PartialContainer' for a partial class/struct/interface.
5707         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5708         of checking whether we're an `Interface' - we could be a
5709         `PartialContainer'.
5710         (PartialContainer.Register): Override; call
5711         AddClass()/AddStruct()/AddInterface() on our parent.
5712
5713         * cs-parser.jay (interface_member_declaration): Add things to the
5714         `current_container', not the `current_class'.
5715
5716         * rootcontext.cs (RegisterOrder): The overloaded version which
5717         takes an `Interface' was unused, removed.
5718
5719         * typemanager.cs (TypeManager.LookupInterface): Return a
5720         `TypeContainer', not an `Interface'.
5721         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5722         contain a `PartialContainer' for an interface, so check it's
5723         `Kind' to figure out what it is.
5724
5725 2004-07-25  Martin Baulig  <martin@ximian.com>
5726
5727         * class.cs (Class.DefaultTypeAttributes): New public constant.
5728         (Struct.DefaultTypeAttributes): Likewise.
5729         (Interface.DefaultTypeAttributes): Likewise.
5730         (PartialContainer.TypeAttr): Override this and add the
5731         DefaultTypeAttributes.
5732
5733 2004-07-25  Martin Baulig  <martin@ximian.com>
5734
5735         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5736         we can just use the `Parent' field instead.
5737
5738 2004-07-25  Martin Baulig  <martin@ximian.com>
5739
5740         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5741
5742 2004-07-25  Martin Baulig  <martin@ximian.com>
5743
5744         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5745         our parts before defining any methods.
5746         (TypeContainer.VerifyImplements): Make this virtual.
5747         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5748         on our PartialContainer.
5749
5750 2004-07-25  Martin Baulig  <martin@ximian.com>
5751
5752         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5753
5754         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5755         argument, we can just use the `Parent' field instead.
5756
5757         * class.cs
5758         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5759         (MemberBase.DoDefine): Likewise.
5760
5761 2004-07-24  Martin Baulig  <martin@ximian.com>
5762
5763         * decl.cs (MemberCore.Parent): New public field.
5764         (DeclSpace.Parent): Moved to MemberCore.
5765
5766         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5767         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5768         parent's .ctor.
5769         (FieldBase, Field, Operator): Likewise.
5770         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5771         (EventField, Event): Likewise.
5772
5773 2004-07-23  Martin Baulig  <martin@ximian.com>
5774
5775         * class.cs (PartialContainer): New public class.
5776         (ClassPart): New public class.
5777         (TypeContainer): Added support for partial classes.
5778         (TypeContainer.GetClassBases): Splitted some of the functionality
5779         out into GetNormalBases() and GetPartialBases().
5780
5781         * cs-tokenizer.cs (Token.PARTIAL): New token.
5782         (Tokenizer.consume_identifier): Added some hacks to recognize
5783         `partial', but only if it's immediately followed by `class',
5784         `struct' or `interface'.
5785
5786         * cs-parser.jay: Added support for partial clases.
5787
5788 2004-07-23  Martin Baulig  <martin@ximian.com>
5789
5790         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5791         a `DeclSpace' and also made it readonly.
5792         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5793         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5794         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5795
5796         * cs-parser.jay: Pass the `current_class', not the
5797         `current_container' (at the moment, this is still the same thing)
5798         to a new Method, Property, Event, Indexer or Constructor.
5799
5800 2004-07-23  Martin Baulig  <martin@ximian.com>
5801
5802         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5803         and removed the `current_interface' one.
5804         (struct_declaration, class_declaration, interface_declaration):
5805         Set `current_class' to the newly created class/struct/interface;
5806         set their `Bases' and call Register() before parsing their body.
5807
5808 2004-07-23  Martin Baulig  <martin@ximian.com>
5809
5810         * class.cs (Kind): New public enum.
5811         (TypeContainer): Made this class abstract.
5812         (TypeContainer.Kind): New public readonly field.
5813         (TypeContainer.CheckDef): New public method; moved here from
5814         cs-parser.jay.
5815         (TypeContainer.Register): New public abstract method.
5816         (TypeContainer.GetPendingImplementations): New public abstract
5817         method.
5818         (TypeContainer.GetClassBases): Removed the `is_class' and
5819         `is_iface' parameters.
5820         (TypeContainer.DefineNestedTypes): Formerly known as
5821         DoDefineType().
5822         (ClassOrStruct): Made this class abstract.
5823
5824         * tree.cs (RootTypes): New public type. 
5825
5826 2004-07-20  Martin Baulig  <martin@ximian.com>
5827
5828         * tree.cs (Tree.RecordNamespace): Removed.
5829         (Tree.Namespaces): Removed.
5830
5831         * rootcontext.cs (RootContext.IsNamespace): Removed.
5832
5833         * cs-parser.jay (namespace_declaration): Just create a new
5834         NamespaceEntry here.
5835
5836 2004-07-20  Martin Baulig  <martin@ximian.com>
5837
5838         * statement.cs (ExceptionStatement): New abstract class.  This is
5839         now used as a base class for everyone who's using `finally'.
5840         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5841         our local variables before using them.
5842
5843         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5844         virtual method.  This is used by Yield.Resolve() to "steal" an
5845         outer block's `finally' clauses.
5846         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5847         argument.
5848
5849         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5850         version which takes an ExceptionStatement.  This version must be
5851         used to create exception branchings.
5852
5853         * iterator.cs
5854         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5855         (Iterator.EmitMoveNext): Added exception support; protect the
5856         block with a `fault' clause, properly handle 'finally' clauses.
5857         (Iterator.EmitDispose): Run all the `finally' clauses here.
5858
5859 2004-07-20  Martin Baulig  <martin@ximian.com>
5860
5861         * iterator.cs: This is the first of a set of changes in the
5862         iterator code.  Match the spec more closely: if we're an
5863         IEnumerable, then GetEnumerator() must be called.  The first time
5864         GetEnumerator() is called, it returns the current instance; all
5865         subsequent invocations (if any) must create a copy.
5866
5867 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5868
5869         * expression.cs: Resolve the constant expression before returning
5870         it. 
5871
5872 2004-07-19  Martin Baulig  <martin@ximian.com>
5873
5874         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5875         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5876         the return type of the new EmitContext.
5877
5878 2004-07-18  Martin Baulig  <martin@ximian.com>
5879
5880         * class.cs (Property.Define): Fix iterators.
5881
5882         * iterators.cs (Iterator.Define): Moved the
5883         `container.AddInterator (this)' call here from the .ctor; only do
5884         it if we resolved successfully.
5885
5886 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5887
5888         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5889         `true' for preprocessing directives that we parse.  The return
5890         value indicates whether we should return to regular tokenizing or
5891         not, not whether it was parsed successfully.
5892
5893         In the past if we were in: #if false ... #line #endif, we would
5894         resume parsing after `#line'.  See bug 61604.
5895
5896         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5897         building: IsEnumType should return true only for enums, not for
5898         enums or System.Enum itself.  This fixes #61593.
5899
5900         Likely what happened is that corlib was wrong: mcs depended on
5901         this bug in some places.  The bug got fixed, we had to add the
5902         hack, which caused bug 61593.
5903
5904         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5905         that was a workaround for the older conditions.
5906
5907 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5908
5909         * assign.cs: IAssignMethod has a new interface, as documented
5910         inline. All assignment code now uses this new api.
5911
5912         * ecore.cs, expression.cs: All classes which implement
5913         IAssignMethod now use the new interface.
5914
5915         * expression.cs (Invocation): add a hack to EmitCall so that
5916         IndexerAccess can be the target of a compound assignment without
5917         evaluating its arguments twice.
5918
5919         * statement.cs: Handle changes in Invocation api.
5920
5921 2004-07-16  Martin Baulig  <martin@ximian.com>
5922
5923         * iterators.cs: Rewrote this.  We're now using one single Proxy
5924         class for both the IEnumerable and the IEnumerator interface and
5925         `Iterator' derives from Class so we can use the high-level API.
5926
5927         * class.cs (TypeContainer.AddIterator): New method.
5928         (TypeContainer.DoDefineType): New protected virtual method, which
5929         is called from DefineType().
5930         (TypeContainer.DoDefineMembers): Call DefineType() and
5931         DefineMembers() on all our iterators.
5932         (TypeContainer.Emit): Call Emit() on all our iterators.
5933         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5934
5935         * codegen.cs (EmitContext.CurrentIterator): New public field.
5936
5937 2004-07-15  Martin Baulig  <martin@ximian.com>
5938
5939         * typemanager.cs
5940         (TypeManager.not_supported_exception_type): New type.   
5941
5942 2004-07-14  Martin Baulig  <martin@ximian.com>
5943
5944         * iterators.cs: Use real error numbers.
5945
5946 2004-07-14  Martin Baulig  <martin@ximian.com>
5947
5948         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5949         requires this to be a System.Collection.IEnumerable and not a
5950         class implementing that interface.
5951         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5952
5953 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5954
5955         * class.cs: Fixed previous fix, it broke some error tests.
5956
5957 2004-07-12  Martin Baulig  <martin@ximian.com>
5958
5959         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5960         Fixes #61293.
5961
5962 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5963
5964         * assign.cs (LocalTemporary): Add new argument: is_address,If
5965         `is_address' is true, then the value that we store is the address
5966         to the real value, and not the value itself.
5967         
5968         * ecore.cs (PropertyExpr): use the new local temporary
5969         stuff to allow us to handle X.Y += z (where X is a struct)
5970
5971 2004-07-08  Martin Baulig  <martin@ximian.com>
5972
5973         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5974         not always return, just like we're doing in Using.Resolve().
5975
5976 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5977
5978         * cs-parser.jay (fixed_statement): flag this as Pinned.
5979
5980 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5981
5982         * typemanager.cs (TypeManager): Removed MakePinned method, this
5983         mechanism is replaced with the .NET 2.x compatible mechanism of
5984         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5985
5986         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5987         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5988         `IsFixed' property which has a different meaning.
5989
5990 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5991
5992         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5993         visible from inside a nested class, not just the names of the
5994         immediately enclosing class.
5995         Fix for bug #60730.
5996
5997 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5998
5999         * expression.cs (BetterConversion): Remove buggy special-case
6000         handling of "implicit constant expression conversions".  At this
6001         point, we already know that the conversion is possible -- we're
6002         only checking to see which is better.
6003
6004 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6005
6006         * cs-parser.jay: Added error CS0210 test.
6007
6008 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6009
6010         * cs-parser.jay: Added error CS0134 test.
6011
6012 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6013
6014         Fix bug #52507
6015         * cs-parser.jay: Added error CS0145 test.
6016
6017 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6018
6019         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6020
6021 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6022         
6023         * expression.cs (StackAlloc.Resolve): The argument may not
6024         be a constant; deal with this case.
6025         
6026 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6027
6028         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6029         GetIndexerAttributeValue.
6030         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6031
6032         * class.cs (Indexer.Define): Added error tests for CS0415,
6033         CS0609.
6034
6035 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6036
6037         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6038         property code.
6039
6040 2004-06-23  Martin Baulig  <martin@ximian.com>
6041
6042         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6043         neither return nor throw, reset the barrier as well.  Fixes #60457.
6044
6045 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6046
6047         * class.cs : EventAttributes is now set to None by default.
6048           This fixes bug #60459.
6049
6050 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6051
6052         Fix bug #60219
6053         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6054         Don't throw exception but return null (it's sufficient now).
6055
6056 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6057
6058         * typemanager.cs (GetArgumentTypes): Faster implementation.
6059
6060 2004-06-18  Martin Baulig  <martin@ximian.com>
6061
6062         * attribute.cs (Attribute.Resolve): Check whether we're an
6063         EmptyCast which a Constant child.  Fixes #60333.
6064
6065 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6066
6067         * statement.cs (EmitCollectionForeach): Account for the fact that
6068         not all valuetypes are in areas which we can take the address of.
6069         For these variables, we store to a temporary variable. Also, make
6070         sure that we dont emit a `callvirt' on a valuetype method.
6071
6072 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6073
6074         * expression.cs (StackAlloc.DoReSolve): Added test for
6075         negative parameter (CS0247).
6076
6077 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6078
6079         Fix bug #59792
6080         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6081
6082 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6083
6084         Fix bug #59781
6085         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6086         ulong.
6087
6088 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6089
6090         Fix bug #58254 & cs1555.cs, cs1556.cs
6091         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6092
6093 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6094
6095         * cs-parser.jay: Added error CS1669 test for indexers.
6096
6097 2004-06-11  Martin Baulig  <martin@ximian.com>
6098
6099         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6100         call this twice: for params and varargs methods.
6101
6102 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6103
6104         * class.cs:
6105         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6106
6107 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6108
6109         * attribute.cs (Attribute.GetValidTargets): Made public.
6110
6111         * class.cs: 
6112         (AbstractPropertyEventMethod): New class for better code sharing.
6113         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6114         CS1667 report.
6115         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6116
6117 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6118
6119         Fix bug #59477.
6120         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6121         that the call to Resolve is part of a MemberAccess.
6122         (Expression.Resolve): Use it for SimpleName resolution.
6123         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6124         Add 'intermediate' boolean argument.
6125         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6126         error message when the SimpleName can be resolved ambiguously
6127         between an expression and a type.
6128         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6129         public.
6130         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6131         call on the left-side.
6132
6133 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6134
6135         * class.cs:
6136         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6137
6138 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6139
6140         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6141
6142 2004-06-11  Martin Baulig  <martin@ximian.com>
6143
6144         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6145         varargs methods if applicable.
6146
6147 2004-06-11  Martin Baulig  <martin@ximian.com>
6148
6149         * expression.cs (Invocation.EmitCall): Don't use
6150         `method.CallingConvention == CallingConventions.VarArgs' since the
6151         method could also have `CallingConventions.HasThis'.
6152
6153 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6154
6155         * class.cs (Event.GetSignatureForError): Implemented.
6156         Fixed crash in error test cs3010.cs
6157
6158 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6159
6160         * cs-tokenizer.cs: Change the way we track __arglist to be
6161         consistent with the other keywords.
6162
6163 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6164
6165         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6166         tomorrow.
6167
6168 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6169
6170         * codegen.cs: Check that all referenced assemblies have a strongname
6171         before strongnaming the compiled assembly. If not report error CS1577.
6172         Fix bug #56563. Patch by Jackson Harper.
6173         * typemanager.cs: Added a method to return all referenced assemblies.
6174         Fix bug #56563. Patch by Jackson Harper.
6175
6176 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6177
6178         * class.cs:
6179         (Method.ApplyAttributeBuilder): Moved and added conditional
6180         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6181
6182         * delegate.cs:
6183         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6184
6185 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6186
6187         Fixed #59640
6188         * class.cs: (EventField.attribute_targets): Changed default target.
6189
6190 2004-06-08  Martin Baulig  <martin@ximian.com>
6191
6192         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6193
6194 2004-06-08  Martin Baulig  <martin@ximian.com>
6195
6196         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6197
6198 2004-06-07  Martin Baulig  <martin@ximian.com>
6199
6200         Added support for varargs methods.
6201
6202         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6203         keyword.
6204
6205         * cs-parser.jay: Added support for `__arglist'.
6206
6207         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6208
6209         * expression.cs (Argument.AType): Added `ArgList'.
6210         (Invocation): Added support for varargs methods.
6211         (ArglistAccess): New public class.
6212         (Arglist): New public class.
6213
6214         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6215
6216         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6217         a method's top-level block if the method has varargs.
6218
6219         * support.cs (ReflectionParameters, InternalParameters): Added
6220         support for varargs methods.    
6221
6222 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6223
6224         * class.cs: Provide location in indexer error report.
6225
6226         * driver.cs: Use standard names.
6227
6228         * namespace.cs: Catch the use of using after a namespace has been
6229         declared also on using aliases.
6230
6231 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6232
6233         Bug #50820.
6234         * typemanager.cs (closure_private_ok, closure_invocation_type)
6235         (closure_qualifier_type, closure_invocation_assembly)
6236         (FilterWithClosure): Move to ...
6237         (Closure): New internal nested class.
6238         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6239         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6240         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6241         (MemberLookup, MemberLookupFailed): Use it.
6242         * expression.cs (New.DoResolve): Treat the lookup for the
6243         constructor as being qualified by the 'new'ed type.
6244         (Indexers.GetIndexersForTypeOrInterface): Update.
6245
6246 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6247
6248         * attribute.cs
6249         (GetConditionalAttributeValue): New method. Returns
6250         condition of ConditionalAttribute.
6251         (SearchMulti): New method.  Returns all attributes of type 't'.
6252         Use it when attribute is AllowMultiple = true.
6253         (IsConditionalMethodExcluded): New method.
6254
6255         * class.cs
6256         (Method.IsExcluded): Implemented. Returns true if method has conditional
6257         attribute and the conditions is not defined (method is excluded).
6258         (IMethodData): Extended interface for ConditionalAttribute support.
6259         (PropertyMethod.IsExcluded): Implemented.
6260
6261         * decl.cs
6262         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6263
6264         * expression.cs
6265         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6266         on the method.
6267
6268 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6269
6270         * expression.cs (ArrayCreationExpression): Make this just an
6271         `expression'. It can't be a statement, so the code here was
6272         dead.
6273
6274 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6275
6276         Fixed #59072
6277         * typemanager.cs (GetFullNameSignature): New method for
6278         MethodBase types.
6279
6280 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6281
6282         Fixed #56452
6283         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6284         Use this method when MethodBuilder is null.
6285         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6286         Added test for error CS0626 (MONO reports error for this situation).
6287         (IMethodData.GetSignatureForError): Extended interface.
6288
6289 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6290
6291         * attribute.cs
6292         (AttributeTester.GetObsoleteAttribute): Returns instance of
6293         ObsoleteAttribute when type is obsolete.
6294
6295         * class.cs
6296         (TypeContainer.VerifyObsoleteAttribute): Override.
6297         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6298         (MethodCode.VerifyObsoleteAttribute): Override.
6299         (MemberBase.VerifyObsoleteAttribute): Override.
6300
6301         * decl.cs
6302         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6303         and report proper error.
6304
6305         *delegate.cs
6306         Delegate.VerifyObsoleteAttribute): Override.
6307
6308         * ecore.cs
6309         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6310         and report proper error.
6311         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6312
6313         * enum.cs
6314         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6315         and enum member.
6316
6317         * expression.cs
6318         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6319         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6320         Added test for ObsoleteAttribute.
6321
6322         * statement.cs
6323         (Catch): Derived from Statement.
6324
6325 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6326  
6327         Fixed bug #59071 & cs0160.cs
6328  
6329         * statement.cs (Try.Resolve): Check here whether order of catch
6330         clauses matches their dependencies.
6331
6332 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6333
6334         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6335         caused a regression: #59343.  Referencing nested classes from an
6336         assembly stopped working.
6337
6338 2004-05-31  Martin Baulig  <martin@ximian.com>
6339
6340         MCS is now frozen for beta 2.
6341
6342 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6343
6344         * convert.cs: add a trivial cache for overload operator resolution.
6345
6346 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6347
6348         * decl.cs: If possible, use lookuptypedirect here. We can only do
6349         this if there is no `.' after the namespace. Avoids using
6350         LookupType, which does lots of slow processing.
6351         (FindNestedType) New method, does what it says :-).
6352         * namespace.cs: use LookupTypeDirect.
6353         * rootcontext.cs: use membercache, if possible.
6354         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6355
6356 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6357
6358         * expression.cs:
6359         According to the spec, 
6360
6361         In a member access of the form E.I, if E is a single identifier,
6362         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6363         field, property, localvariable, or parameter with the same type as
6364         the meaning of E as a type-name (§3.8), then both possible
6365         meanings of E are permitted.
6366
6367         We did not check that E as a simple-name had the same type as E as
6368         a type name.
6369
6370         This trivial check gives us 5-7% on bootstrap time.
6371
6372 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6373
6374         * expression.cs (Invocation.OverloadResolve): Avoid the
6375         use of hashtables and boxing here by allocating on demand.
6376
6377 2004-05-30  Martin Baulig  <martin@ximian.com>
6378
6379         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6380         we're doing a silent lookup.  Don't try to lookup nested types in
6381         TypeManager.object_type (thanks to Ben Maurer).
6382
6383 2004-05-30  Martin Baulig  <martin@ximian.com>
6384
6385         Committing a patch from Ben Maurer.
6386
6387         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6388
6389 2004-05-29  Martin Baulig  <martin@ximian.com>
6390
6391         * class.cs (IMethodData.ShouldIgnore): New method.
6392
6393         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6394         `Location' argument, we don't need it anywhere.  Use
6395         `IMethodData.ShouldIgnore ()' instead of
6396         `MethodData.GetMethodFlags ()'.
6397         (TypeManager.AddMethod): Removed.
6398         (TypeManager.AddMethod2): Renamed to AddMethod.
6399
6400 2004-05-29  Martin Baulig  <martin@ximian.com>
6401
6402         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6403
6404         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6405         converting from a class type S to an interface type and we already
6406         have an object on the stack, don't box it again.  Fixes #52578.
6407
6408 2004-05-29  Martin Baulig  <martin@ximian.com>
6409
6410         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6411         Added support for `params' parameters.  Fixes #59267.
6412
6413 2004-05-29  Martin Baulig  <martin@ximian.com>
6414
6415         * literal.cs (NullPointer): Provide a private .ctor which sets
6416         `type' to TypeManager.object_type.  Fixes #59048.
6417
6418 2004-05-29  Martin Baulig  <martin@ximian.com>
6419
6420         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6421         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6422
6423         * ecore.cs (EventExpr.instance_expr): Make the field private.
6424
6425 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6426
6427         Fixed bug #50080 & cs0214-2.cs
6428         * expression.cs (Cast.DoResolve): Check unsafe context here.
6429         
6430         * statement.cs (Resolve.DoResolve): Likewise.
6431
6432 2004-05-26  Martin Baulig  <martin@ximian.com>
6433
6434         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6435
6436         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6437         (RootContext.LookupType): Pass down the `silent' flag.
6438
6439 2004-05-25  Martin Baulig  <martin@ximian.com>
6440
6441         * expression.cs
6442         (MethodGroupExpr.IdenticalTypeName): New public property.
6443         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6444         expression actually refers to a type.
6445
6446 2004-05-25  Martin Baulig  <martin@ximian.com>
6447
6448         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6449         for #56176 and made it actually work.
6450
6451 2004-05-25  Martin Baulig  <martin@ximian.com>
6452
6453         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6454         (FieldExpr, PropertyExpr): Override and implement
6455         CacheTemporaries.  Fixes #52279.
6456
6457 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6458
6459         * location.cs: In the new compiler listing a file twice is a
6460         warning, not an error.
6461
6462 2004-05-24  Martin Baulig  <martin@ximian.com>
6463
6464         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6465         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6466
6467 2004-05-24  Martin Baulig  <martin@ximian.com>
6468
6469         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6470         walking the `using' list.  Fixes #53921.
6471
6472 2004-05-24  Martin Baulig  <martin@ximian.com>
6473
6474         * const.cs (Const.LookupConstantValue): Added support for
6475         EmptyCast's; fixes #55251.
6476
6477 2004-05-24  Martin Baulig  <martin@ximian.com>
6478
6479         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6480         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6481         which does the CS0135 check.  The reason is that we first need to
6482         check whether the variable actually exists.
6483
6484 2004-05-24  Martin Baulig  <martin@ximian.com>
6485
6486         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6487         than RootContext.LookupType() to find the explicit interface
6488         type.  Fixes #58584.
6489
6490 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6491
6492         * Makefile: Simplify.  Use executable.make.
6493         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6494
6495 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6496
6497         * decl.cs:
6498         * enum.cs:
6499         Use the invariant culture when doing String.Compare for CLS case
6500         sensitivity.
6501         
6502 2004-05-23  Martin Baulig  <martin@ximian.com>
6503
6504         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6505         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6506
6507         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6508         
6509 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6510
6511         * class.cs (MemberBase.Define): Reuse MemberType member for 
6512         resolved type. Other methods can use it too.
6513
6514 2004-05-23  Martin Baulig  <martin@ximian.com>
6515
6516         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6517         the variable also exists in the current block (otherwise, we need
6518         to report a CS0103).  Fixes #58670.
6519
6520 2004-05-23  Martin Baulig  <martin@ximian.com>
6521
6522         * flowanalysis.cs (Reachability.Reachable): Compute this
6523         on-the-fly rather than storing it as a field.
6524
6525 2004-05-23  Martin Baulig  <martin@ximian.com>
6526
6527         * flowanalysis.cs (Reachability.And): Manually compute the
6528         resulting `barrier' from the reachability.      
6529        
6530 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6531
6532         Fix bug #57835
6533         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6534         instance of ObsoleteAttribute when symbol is obsolete.
6535
6536         * class.cs
6537         (IMethodData): Extended interface for ObsoleteAttribute support.
6538
6539 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6540
6541         * attribute.cs: Fix bug #55970
6542
6543 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6544
6545         Fix bug #52705
6546         * attribute.cs
6547         (GetObsoleteAttribute): New method. Creates the instance of
6548         ObsoleteAttribute.
6549         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6550         ObsoleteAttribute when member is obsolete.
6551         (AttributeTester.Report_ObsoleteMessage): Common method for
6552         Obsolete error/warning reporting.
6553
6554         * class.cs
6555         (TypeContainer.base_classs_type): New member for storing parent type.
6556
6557         * decl.cs
6558         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6559         for this MemberCore.
6560
6561 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6562
6563         * attribute.cs, const.cs: Fix bug #58590
6564
6565 2004-05-21  Martin Baulig  <martin@ximian.com>
6566
6567         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6568         out parameters if the end of the method is unreachable.  Fixes
6569         #58098. 
6570
6571 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6572
6573         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6574         Hari was right, why extra method.
6575
6576 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6577
6578         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6579
6580 2004-05-20  Martin Baulig  <martin@ximian.com>
6581
6582         Merged this back from gmcs to keep the differences to a minumum.
6583
6584         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6585         instead of a Declspace.
6586         (Attribute.ResolveType): Likewise.
6587         (Attributes.Search): Likewise.
6588         (Attributes.Contains): Likewise.
6589         (Attributes.GetClsCompliantAttribute): Likewise.
6590
6591         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6592         argument.
6593         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6594         DeclSpace.
6595
6596 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6597
6598         Fix bug #58688 (MCS does not report error when the same attribute
6599         is assigned twice)
6600
6601         * attribute.cs (Attribute.Emit): Distinction between null and default.
6602
6603 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6604
6605         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6606         of a top-level attribute without an attribute target.
6607         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6608         Make non-static.
6609         (Attribute.Conditional_GetConditionName), 
6610         (Attribute.Obsolete_GetObsoleteMessage): Update.
6611         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6612         part of ScanForIndexerName.
6613         (Attribute.CanIgnoreInvalidAttribute): New function.
6614         (Attribute.ScanForIndexerName): Move to ...
6615         (Attributes.ScanForIndexerName): ... here.
6616         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6617         (Attributes.Search): New internal variant that can choose not to
6618         complain if types aren't resolved.  The original signature now
6619         complains.
6620         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6621         complaints suppressed.
6622         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6623         only if it not useful.
6624         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6625         top-level for attributes that are shared between the assembly
6626         and a top-level class.
6627         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6628         * class.cs: Update to reflect changes.
6629         (DefineIndexers): Fuse loops.
6630         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6631         a couple more variants of attribute names.
6632
6633 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6634
6635         Fix bug #52585 (Implemented explicit attribute declaration)
6636
6637         * attribute.cs:
6638         (Attributable.ValidAttributeTargets): New abstract method. It gets
6639         list of valid attribute targets for explicit target declaration.
6640         (Attribute.Target): It holds target itself.
6641         (AttributeSection): Removed.
6642         (Attribute.CheckTargets): New method. It checks whether attribute
6643         target is valid for the current element.
6644
6645         * class.cs:
6646         (EventProperty): New class. For events that are declared like
6647         property (with add and remove accessors).
6648         (EventField): New class. For events that are declared like field.
6649         class.cs
6650
6651         * cs-parser.jay: Implemented explicit attribute target declaration.
6652
6653         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6654         Override ValidAttributeTargets.
6655
6656         * parameter.cs:
6657         (ReturnParameter): Class for applying custom attributes on 
6658         the return type.
6659         (ParameterAtribute): New class. Class for applying custom
6660         attributes on the parameter type.
6661
6662 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6663
6664         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6665         definitions. 
6666
6667         (Method): Allow UNSAFE here.
6668
6669         * modifiers.cs: Support unsafe reporting.
6670
6671 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6672
6673         * decl.cs: Fix bug #58478.
6674
6675 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6676
6677         * statement.cs: When checking for unreachable code on an EmptyStatement,
6678         set the location. Fixes bug #58488.
6679
6680 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6681
6682         * driver.cs: Add -pkg handling.
6683
6684         From Gonzalo: UseShelLExecute=false
6685
6686 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6687
6688         * attribute.cs:
6689         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6690         for attribute.
6691         (Attribute.IsClsCompliaceRequired): Moved to base for better
6692         accesibility.
6693         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6694         when attribute is AttributeUsageAttribute.
6695         (Attribute.GetValidTargets): Simplified.
6696         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6697         attribute for this type.
6698         (Attribute.ApplyAttributes): Method renamed to Emit and make
6699         non-static.
6700         (GlobalAttributeSection): New class for special handling of global
6701         attributes (assembly, module).
6702         (AttributeSection.Emit): New method.
6703
6704         * class.cs: Implemented Attributable abstract methods.
6705         (MethodCore.LabelParameters): Moved to Parameter class.
6706         (Accessor): Is back simple class.
6707         (PropertyMethod): Implemented Attributable abstract class.
6708         (DelegateMethod): Implemented Attributable abstract class.
6709         (Event): New constructor for disctintion between normal Event
6710         and Event with accessors.
6711
6712         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6713
6714         * codegen.cs, const.cs, decl.cs, delegate.cs:
6715         (CommonAssemblyModulClass): Implemented Attributable abstract class
6716         and simplified.
6717
6718         * enum.cs: Implement IAttributeSupport interface.
6719         (EnumMember): New class for emum members. Implemented Attributable
6720         abstract class
6721
6722         * parameter.cs:
6723         (ParameterBase): Is abstract.
6724         (ReturnParameter): New class for easier [return:] attribute handling.
6725
6726         * typemanager.cs: Removed builder_to_attr.
6727
6728 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6729
6730         Fix bug #57151.
6731         * attribute.cs (Attribute.GetPositionalValue): New function.
6732         * class.cs (TypeContainer.VerifyMembers): New function.
6733         (TypeContainer.Emit): Use it.
6734         (ClassOrStruct): New base class for Class and Struct.
6735         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6736         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6737         class.
6738         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6739         then each non-static field should have a FieldOffset attribute.
6740         Otherwise, none of the fields should have a FieldOffset attribute.
6741         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6742         and FieldOffset attributes.
6743         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6744         (TypeManager.field_offset_attribute_type): New core types.
6745         (TypeManager.InitCoreTypes): Initialize them.
6746
6747 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6748
6749         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6750         Return correct type.
6751         From bug #58270.
6752
6753 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6754
6755         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6756         be implicitly converted to ulong.
6757         
6758         * expression.cs: The logic for allowing operator &, | and ^ worked
6759         was wrong, it worked before because we did not report an error in
6760         an else branch.  Fixes 57895.
6761
6762         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6763         allow volatile fields to be reference types.
6764
6765 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6766
6767         * driver.cs: Add support for /debug-
6768
6769 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6770
6771         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6772         Add a 'complain' parameter to silence errors.
6773         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6774         silently overlooked type-resolutions.
6775         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6776         to reflect changes.
6777         (Attributes.Search): New function.
6778         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6779         (Attributes.GetAttributeFullName): Remove hack.
6780         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6781         Update to reflect changes.
6782         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6783         Use Attributes.Search instead of nested loops.
6784
6785 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6786
6787         * decl.cs:
6788         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6789         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6790         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6791
6792         * report.cs: (Report.Warning): Renamed to Warning_T because of
6793         parameter collision.
6794
6795 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6796
6797         * expression.cs (MemberAccess.ResolveMemberAccess):
6798         Exit with non-zero status after Report.Error.
6799         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6800         Likewise.
6801         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6802
6803 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6804
6805         * support.cs: Don't hang when the file is empty.
6806
6807 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6808
6809         * support.cs: In SeekableStreamReader, compute the preamble size of the
6810           underlying stream. Position changes should take into account that initial
6811           count of bytes.
6812
6813 2004-05-03  Todd Berman  <tberman@sevenl.net>
6814
6815         * driver.cs: remove unused GetSysVersion function.
6816
6817 2004-05-03  Todd Berman  <tberman@sevenl.net>
6818
6819         * driver.cs: Remove the hack from saturday, as well as the hack
6820         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6821         link_paths to get that bit proper.
6822
6823 2004-05-01  Todd Berman  <tberman@sevenl.net>
6824
6825         * driver.cs: Try a LoadFrom before a Load, this checks the current
6826         path. This is currently a bug in mono that is be fixed, however, this
6827         provides a workaround for now. This will be removed when the bug
6828         is fixed.
6829
6830 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6831
6832         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6833         incomplete key pairs (#57941).
6834
6835 2004-05-01  Todd Berman  <tberman@sevenl.net>
6836
6837         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6838         from the GAC
6839
6840 2004-04-30  Jackson Harper  <jackson@ximian.com>
6841
6842         * codegen.cs: Open keys readonly.
6843         
6844 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6845
6846         * typemanager.cs: don't report cyclic struct layout when a struct
6847         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6848         which has 2 Pango.Rectangle fields.
6849
6850 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6851
6852         * expression.cs: Handle IntPtr comparisons with IL code
6853         rather than a method call.
6854
6855 2004-04-29  Martin Baulig  <martin@ximian.com>
6856
6857         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6858         the list of PropertyInfo's in class hierarchy and find the
6859         accessor.  Fixes #56013.
6860
6861 2004-04-29  Martin Baulig  <martin@ximian.com>
6862
6863         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6864
6865 2004-04-29  Martin Baulig  <martin@ximian.com>
6866
6867         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6868
6869         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6870
6871 2004-04-29  Martin Baulig  <martin@ximian.com>
6872
6873         * class.cs (ConstructorInitializer.Resolve): Check whether the
6874         parent .ctor is accessible.  Fixes #52146.
6875
6876 2004-04-29  Martin Baulig  <martin@ximian.com>
6877
6878         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6879
6880         * statement.cs (Using.EmitLocalVariableDecls): Use
6881         TypeManager.idisposable_type, not typeof (IDisposable).
6882         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6883
6884 2004-04-29  Martin Baulig  <martin@ximian.com>
6885
6886         * class.cs (Event.Define): Don't emit the field and don't set
6887         RTSpecialName and SpecialName for events on interfaces.  Fixes
6888         #57703. 
6889
6890 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6891
6892         Refactor Attribute.ApplyAttributes.
6893         * attribute.cs (Attributable): New base class for objects that can
6894         have Attributes applied on them.
6895         (Attribute): Make AttributeUsage fields public.
6896         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6897         (Attribute.IsInternalCall): New property.
6898         (Attribute.UsageAttr): Convert to a public read-only property.
6899         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6900         (Attribute.ResolveType, Attribute.Resolve)
6901         (Attribute.ScanForIndexerName): Update to reflect changes.
6902         (Attribute.CheckAttributeTarget): Re-format.
6903         (Attribute.ApplyAttributes): Refactor, to various
6904         Attributable.ApplyAttributeBuilder methods.
6905         * decl.cs (MemberCore): Make Attributable.
6906         * class.cs (Accessor): Make Attributable.
6907         (MethodData.ApplyAttributes): Use proper attribute types, not
6908         attribute names.
6909         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6910         (TypeContainer.ApplyAttributeBuilder)
6911         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6912         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6913         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6914         (Operator.ApplyAttributeBuilder): New factored-out methods.
6915         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6916         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6917         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6918         * parameter.cs (ParameterBase): New Attributable base class
6919         that can also represent Return types.
6920         (Parameter): Update to the changes.
6921
6922 2004-04-29  Jackson Harper  <jackson@ximian.com>
6923
6924         * driver.cs: Prefer the corlib system version when looking for
6925         assemblies in the GAC. This is still a hack, but its a better hack
6926         now.
6927         
6928 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6929
6930         * decl.cs, enum.cs: Improved error 3005 reporting.
6931   
6932         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6933         (related_symbols): New private member for list of symbols
6934         related to reported error/warning.
6935         
6936         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6937
6938 2004-04-29  Martin Baulig  <martin@ximian.com>
6939
6940         * ecore.cs (Expression.Constantify): If we're an enum and
6941         TypeManager.TypeToCoreType() doesn't give us another type, use
6942         t.UnderlyingSystemType.  Fixes #56178.  
6943
6944 2004-04-29  Martin Baulig  <martin@ximian.com>
6945
6946         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6947         interfaces and for each interface, only add members directly
6948         declared in that interface.  Fixes #53255.
6949
6950 2004-04-28  Martin Baulig  <martin@ximian.com>
6951
6952         * expression.cs (ConditionalLogicalOperator): Use a temporary
6953         variable for `left' to avoid that we evaluate it more than once;
6954         bug #52588.
6955
6956 2004-04-28  Martin Baulig  <martin@ximian.com>
6957
6958         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6959         `void[]' (CS1547).
6960
6961 2004-04-28  Martin Baulig  <martin@ximian.com>
6962
6963         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6964         void (CS1547).
6965
6966         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6967         whether the type is not void (CS1547).
6968
6969 2004-04-28  Martin Baulig  <martin@ximian.com>
6970
6971         * expression.cs (Unary.DoResolveLValue): Override this and report
6972         CS0131 for anything but Operator.Indirection.
6973
6974 2004-04-28  Martin Baulig  <martin@ximian.com>
6975
6976         Committing a patch from Ben Maurer; see bug #50820.
6977
6978         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6979         check for classes.
6980
6981         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6982         classes.        
6983
6984 2004-04-28  Martin Baulig  <martin@ximian.com>
6985
6986         Committing a patch from Ben Maurer; see bug #50820.
6987
6988         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6989         check for classes.
6990
6991         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6992         classes.        
6993
6994 2004-04-28  Martin Baulig  <martin@ximian.com>
6995
6996         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6997         (Block.AddLabel): Call DoLookupLabel() to only search in the
6998         current block.
6999
7000 2004-04-28  Martin Baulig  <martin@ximian.com>
7001
7002         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7003         comparing StringConstants and NullLiterals in Equality and Inequality.
7004
7005 2004-04-28  Jackson Harper  <jackson@ximian.com>
7006
7007         * driver.cs: Attempt to load referenced assemblies from the
7008         GAC. This is the quick and dirty version of this method that
7009         doesnt take into account versions and just takes the first
7010         canidate found. Will be good enough for now as we will not have more
7011         then one version installed into the GAC until I update this method.
7012
7013 2004-04-28  Martin Baulig  <martin@ximian.com>
7014
7015         * typemanager.cs (TypeManager.CheckStructCycles): New public
7016         static method to check for cycles in the struct layout.
7017
7018         * rootcontext.cs (RootContext.PopulateTypes): Call
7019         TypeManager.CheckStructCycles() for each TypeContainer.
7020         [Note: We only need to visit each type once.]
7021
7022 2004-04-28  Martin Baulig  <martin@ximian.com>
7023
7024         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7025
7026         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7027         success and added `out object value'.  Use a `bool resolved' field
7028         to check whether we've already been called rather than
7029         `ConstantValue != null' since this breaks for NullLiterals.
7030
7031 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7032
7033         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7034         setting of this flag, since the 'set' method may be non-public.
7035
7036 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7037
7038         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7039         check on current_vector.Block.
7040
7041 2004-04-27  Martin Baulig  <martin@ximian.com>
7042
7043         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7044         a field initializer.  Fixes #56459.
7045
7046 2004-04-27  Martin Baulig  <martin@ximian.com>
7047
7048         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7049         we're not attempting to use an indexer.  Fixes #52154.
7050
7051 2004-04-27  Martin Baulig  <martin@ximian.com>
7052
7053         * statement.cs (Return): Don't create a return label if we don't
7054         need it; reverts my change from January 20th.  Thanks to Ben
7055         Maurer for this.
7056
7057 2004-04-27  Martin Baulig  <martin@ximian.com>
7058
7059         According to the spec, `goto' can only leave a nested scope, but
7060         never enter it.
7061
7062         * statement.cs (Block.LookupLabel): Only lookup in the current
7063         block, don't recurse into parent or child blocks.
7064         (Block.AddLabel): Check in parent and child blocks, report
7065         CS0140/CS0158 if we find a duplicate.
7066         (Block): Removed this indexer for label lookups.
7067         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7068         this already does the error reporting for us.
7069
7070         * flowanalysis.cs
7071         (FlowBranching.UsageVector.Block): New public variable; may be null.
7072         (FlowBranching.CreateSibling): Added `Block' argument.
7073         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7074         label for the target of a `goto' and check whether we're not
7075         leaving a `finally'.
7076
7077 2004-04-27  Martin Baulig  <martin@ximian.com>
7078
7079         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7080         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7081         just for returns).
7082
7083 2004-04-27  Martin Baulig  <martin@ximian.com>
7084
7085         * statement.cs (Block.AddLabel): Also check for implicit blocks
7086         and added a CS0158 check.
7087
7088 2004-04-27  Martin Baulig  <martin@ximian.com>
7089
7090         * flowanalysis.cs (FlowBranchingLoop): New class.
7091         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7092         UsageVector's instead of an ArrayList.
7093         (FlowBranching.Label): Likewise.
7094         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7095         (FlowBranching.AddBreakVector): New method.
7096
7097 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7098
7099         * attribute.cs: Small regression fix: only convert the type if we
7100         the type is different, fixes System.Drawing build.
7101
7102 2004-04-27  Martin Baulig  <martin@ximian.com>
7103
7104         * attribute.cs (Attribute.Resolve): If we have a constant value
7105         for a named field or property, implicity convert it to the correct
7106         type.
7107
7108 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7109
7110         * statement.cs (Block.Block): Implicit blocks share
7111         'child_variable_names' fields with parent blocks.
7112         (Block.AddChildVariableNames): Remove.
7113         (Block.AddVariable): Mark variable as "used by a child block" in
7114         every surrounding block.
7115         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7116         been used in a child block, complain about violation of "Invariant
7117         meaning in blocks" rule.
7118         * cs-parser.jay (declare_local_variables): Don't use
7119         AddChildVariableNames.
7120         (foreach_statement): Don't create an implicit block: 'foreach'
7121         introduces a scope.
7122
7123 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7124
7125         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7126         converting from 0L to ulong.  Fixes 57522.
7127
7128 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7129
7130         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7131         derived class hides via 'new' keyword field from base class (test-242.cs).
7132         TODO: Handle this in the more general way.
7133         
7134         * class.cs (CheckBase): Ditto.
7135
7136 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7137
7138         * decl.cs (caching_flags): New member for storing cached values
7139         as bit flags.
7140         (MemberCore.Flags): New enum where bit flags for caching_flags
7141         are defined.
7142         (MemberCore.cls_compliance): Moved to caching_flags.
7143         (DeclSpace.Created): Moved to caching_flags.
7144
7145         * class.cs: Use caching_flags instead of DeclSpace.Created
7146         
7147 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7148
7149         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7150         if we are only a derived class, not a nested class.
7151
7152         * typemanager.cs: Same as above, but do this at the MemberLookup
7153         level (used by field and methods, properties are handled in
7154         PropertyExpr).   Allow for the qualified access if we are a nested
7155         method. 
7156
7157 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7158
7159         * class.cs: Refactoring.
7160         (IMethodData): New inteface; Holds links to parent members
7161         to avoid member duplication (reduced memory allocation).
7162         (Method): Implemented IMethodData interface.
7163         (PropertyBase): New inner classes for get/set methods.
7164         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7165         (Event): New inner classes for add/remove methods.
7166         (Event.DelegateMethod): Implemented IMethodData interface.
7167
7168         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7169         EmitContext (related to class.cs refactoring).
7170
7171 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7172
7173         * delegate.cs (Delegate.VerifyApplicability): If the number of
7174         arguments are the same as the number of parameters, first try to
7175         verify applicability ignoring  any 'params' modifier on the last
7176         parameter.
7177         Fixes #56442.
7178
7179 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7180
7181         * class.cs (TypeContainer.AddIndexer): Use
7182         'ExplicitInterfaceName' to determine if interface name was
7183         explicitly specified.  'InterfaceType' is not initialized at this time.
7184         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7185         Indexers array is already in the required order.  Initialize
7186         'IndexerName' only if there are normal indexers.
7187         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7188         (TypeContainer.Emit): Emit DefaultMember attribute only if
7189         IndexerName is initialized.
7190         Fixes #56300.
7191
7192 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7193
7194         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7195         Fixes #57007
7196
7197 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7198
7199         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7200         attributes.
7201         Fix for #56456.
7202
7203         * attribute.cs (Attribute.Resolve): Check for duplicate named
7204         attributes.
7205         Fix for #56463.
7206
7207 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7208
7209         * iterators.cs (MarkYield): track whether we are in an exception,
7210         and generate code accordingly.  Use a temporary value to store the
7211         result for our state.
7212
7213         I had ignored a bit the interaction of try/catch with iterators
7214         since their behavior was not entirely obvious, but now it is
7215         possible to verify that our behavior is the same as MS .NET 2.0
7216
7217         Fixes 54814
7218
7219 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7220
7221         * iterators.cs: Avoid creating temporaries if there is no work to
7222         do. 
7223
7224         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7225         Enumerations, use TypeManager.EnumToUnderlying and call
7226         recursively. 
7227
7228         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7229         bug #57013
7230
7231         (This.Emit): Use EmitContext.EmitThis to emit our
7232         instance variable.
7233
7234         (This.EmitAssign): Ditto.
7235
7236         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7237         codepaths, we will move all the functionality into
7238         Mono.CSharp.This 
7239
7240         (FieldExpr.EmitAssign): Ditto.
7241
7242         This fixes several hidden bugs that I uncovered while doing a code
7243         review of this today.
7244
7245         * codegen.cs (EmitThis): reworked so the semantics are more clear
7246         and also support value types "this" instances.
7247
7248         * iterators.cs: Changed so that for iterators in value types, we
7249         do not pass the value type as a parameter.  
7250
7251         Initialization of the enumerator helpers is now done in the caller
7252         instead of passing the parameters to the constructors and having
7253         the constructor set the fields.
7254
7255         The fields have now `assembly' visibility instead of private.
7256
7257 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7258
7259         * expression.cs (Argument.Resolve): Check if fields passed as ref
7260         or out are contained in a MarshalByRefObject.
7261
7262         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7263         another compiler type.
7264
7265 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7266
7267         * class.cs (Indexer.Define): use the new name checking method.
7268         Also, return false on an error.
7269         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7270         (is_identifier_[start/part]_character): make static.
7271
7272 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7273
7274         * expression.cs (Binary.ResolveOperator): Do no append strings
7275         twice: since we can be invoked more than once (array evaluation)
7276         on the same concatenation, take care of this here.  Based on a fix
7277         from Ben (bug #56454)
7278
7279 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7280
7281         * codegen.cs: Fix another case where CS1548 must be reported (when 
7282         delay-sign isn't specified and no private is available #56564). Fix
7283         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7284         error when MCS is used on the MS runtime and we need to delay-sign 
7285         (which seems unsupported by AssemblyBuilder - see #56621).
7286
7287 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7288
7289         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7290         (TypeManager.ComputeNamespaces): Faster implementation for
7291         Microsoft runtime.
7292
7293         * compiler.csproj: Updated AssemblyName to mcs.
7294
7295 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7296
7297         * rootcontext.cs: Add new types to the boot resolution.
7298
7299         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7300         MulticastDelegate is not allowed.
7301
7302         * typemanager.cs: Add new types to lookup: System.TypedReference
7303         and ArgIterator.
7304
7305         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7306         check for TypedReference or ArgIterator, they are not allowed. 
7307
7308         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7309         makes us properly catch 1510 in some conditions (see bug 56016 for
7310         details). 
7311
7312 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7313
7314         * CryptoConvert.cs: update from corlib version
7315         with endian fixes.
7316
7317 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7318
7319         * class.cs (Indexer.Define): Check indexername declaration
7320
7321 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7322
7323         * attribute.cs (IsClsCompliant): Fixed problem with handling
7324         all three states (compliant, not-compliant, undetected).
7325
7326 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7327
7328         * attribute.cs (Attribute): Location is now public.
7329         (Resolve): Store resolved arguments (pos_values) in attribute class.
7330         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7331         (GetClsCompliantAttributeValue): New method that gets
7332         CLSCompliantAttribute value.
7333         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7334         if exists else null.
7335         (AttributeTester): New class for CLS-Compliant verification routines.
7336
7337         * class.cs (Emit): Add CLS-Compliant verification.
7338         (Method.GetSignatureForError): Implemented.
7339         (Constructor.GetSignatureForError): Implemented
7340         (Constructor.HasCompliantArgs): Returns if constructor has
7341         CLS-Compliant arguments.
7342         (Constructor.Emit): Override.
7343         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7344         is needed to test only parameters.
7345         (FieldBase.GetSignatureForError): Implemented.
7346         (TypeContainer): New member for storing base interfaces.
7347         (TypeContainer.FindMembers): Search in base interfaces too.
7348
7349         * codegen.cs (GetClsComplianceAttribute): New method that gets
7350         assembly or module CLSCompliantAttribute value.
7351         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7352         for assembly.
7353         (ModuleClass.Emit): Add error 3012 test.
7354
7355         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7356
7357         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7358         state for all decl types.
7359         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7360         if CLS-Compliant tests are required.
7361         (IsClsCompliaceRequired): New method. Analyze whether code
7362         must be CLS-Compliant.
7363         (IsExposedFromAssembly): New method. Returns true when MemberCore
7364         is exposed from assembly.
7365         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7366         value or gets cached value.
7367         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7368         is explicitly marked with CLSCompliantAttribute.
7369         (IsIdentifierClsCompliant): New abstract method. This method is
7370         used to testing error 3005.
7371         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7372         for identifier and parameters CLS-Compliant testing.
7373         (VerifyClsCompliance): New method. The main virtual method for
7374         CLS-Compliant verifications.
7375         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7376         null. I don't know why is null (too many public members !).
7377         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7378         and get value of first CLSCompliantAttribute that found.
7379
7380         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7381         (VerifyClsCompliance): Override and add extra tests.
7382
7383         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7384         clscheck- disable CLS-Compliant verification event if assembly is has
7385         CLSCompliantAttribute(true).
7386
7387         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7388         ApllyAttribute is now called in emit section as in the other cases.
7389         Possible future Emit integration.
7390         (IsIdentifierClsCompliant): New override.
7391         (VerifyClsCompliance): New override.
7392         (GetEnumeratorName): Returns full enum name.
7393
7394         * parameter.cs (GetSignatureForError): Implemented.
7395
7396         * report.cs (WarningData): New struct for Warning message information.
7397         (LocationOfPreviousError): New method.
7398         (Warning): New method. Reports warning based on the warning table.
7399         (Error_T): New method. Reports error based on the error table.
7400
7401         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7402         verifications are done here.
7403
7404         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7405
7406         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7407         CLSCompliantAttribute.
7408         (all_imported_types): New member holds all imported types from other
7409         assemblies.
7410         (LoadAllImportedTypes): New method fills static table with exported types
7411         from all referenced assemblies.
7412         (Modules): New property returns all assembly modules.
7413
7414 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7415
7416         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7417         throwing a parser error.
7418
7419         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7420         which removes the hardcoded get_/set_ prefixes for properties, as
7421         IL allows for the properties to be named something else.  
7422
7423         Bug #56013
7424
7425         * expression.cs: Do not override operand before we know if it is
7426         non-null.  Fix 56207
7427
7428 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7429
7430         * typemanager.cs: support for pinned variables.
7431
7432 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7433
7434         * decl.cs, typemanager.cs: Avoid using an arraylist
7435         as a buffer if there is only one result set.
7436
7437 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7438
7439         * expression.cs: Make sure you cant call a static method
7440         with an instance expression, bug #56174.
7441
7442 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7443
7444         * class.cs (IsDuplicateImplementation): Improve error reporting to
7445         flag 663 (method only differs in parameter modifier).
7446
7447         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7448         in preprocessor directives.
7449
7450         * location.cs (LookupFile): Allow for the empty path.
7451
7452         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7453         better approach for some of that patch, but its failing with the
7454         CharSet enumeration.  For now try/catch will do.
7455
7456         * typemanager.cs: Do not crash if a struct does not have fields.
7457         Fixes 56150.
7458
7459 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7460
7461         * expression.cs: cs0213, cant fix a fixed expression.
7462         fixes 50231.
7463
7464 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7465
7466         * cs-parser.jay: detect invalid embeded statements gracefully.
7467         bug #51113.
7468
7469 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7470
7471         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7472         As a regex:
7473         s/
7474         the invocation type may not be a subclass of the tye of the item/
7475         The type of the item must be a subclass of the invocation item.
7476         /g
7477
7478         Fixes bug #50820.
7479
7480 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7481
7482         * attribute.cs: Added methods to get a string and a bool from an
7483         attribute. Required to information from AssemblyKeyFileAttribute,
7484         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7485         * codegen.cs: Modified AssemblyName creation to include support for
7486         strongnames. Catch additional exceptions to report them as CS1548.
7487         * compiler.csproj: Updated include CryptoConvert.cs.
7488         * compiler.csproj.user: Removed file - user specific configuration.
7489         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7490         Mono.Security assembly. The original class is maintained and tested in
7491         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7492         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7493         like CSC 8.0 (C# v2) supports.
7494         * Makefile: Added CryptoConvert.cs to mcs sources.
7495         * rootcontext.cs: Added new options for strongnames.
7496
7497 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7498
7499         * driver.cs: For --expect-error, report error code `2'
7500         if the program compiled with no errors, error code `1' if
7501         it compiled with an error other than the one expected.
7502
7503 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7504
7505         * compiler.csproj: Updated for Visual Studio .NET 2003.
7506         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7507         * compiler.sln: Updated for Visual Studio .NET 2003.
7508
7509 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7510
7511         * expression.cs: Fix bug #47234. We basically need to apply the
7512         rule that we prefer the conversion of null to a reference type
7513         when faced with a conversion to 'object' (csc behaviour).
7514
7515 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7516
7517         * statement.cs: Shorter form for foreach, eliminates
7518         a local variable. r=Martin.
7519
7520 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7521
7522         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7523         checks if we can use brtrue/brfalse to test for 0.
7524         * expression.cs: use the above in the test for using brtrue/brfalse.
7525         cleanup code a bit.
7526
7527 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7528
7529         * expression.cs: Rewrite string concat stuff. Benefits:
7530
7531         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7532         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7533         rather than a concat chain.
7534
7535         * typemanager.cs: Add lookups for more concat overloads.
7536
7537 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7538
7539         * expression.cs: Emit shorter il code for array init.
7540
7541         newarr
7542         dup
7543         // set 1
7544
7545         // set 2
7546
7547         newarr
7548         stloc.x
7549
7550         ldloc.x
7551         // set 1
7552
7553         ldloc.x
7554         // set 2
7555
7556 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7557
7558         * statement.cs: Before, two switch blocks would be merged if the
7559         total size of the blocks (end_item - begin_item + 1) was less than
7560         two times the combined sizes of the blocks.
7561
7562         Now, it will only merge if after the merge at least half of the
7563         slots are filled.
7564
7565         fixes 55885.
7566
7567 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7568
7569         * class.cs : csc build fix for GetMethods(). See bug #52503.
7570
7571 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7572
7573         * expression.cs: Make sure fp comparisons work with NaN.
7574         This fixes bug #54303. Mig approved this patch a long
7575         time ago, but we were not able to test b/c the runtime
7576         had a related bug.
7577
7578 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7579
7580         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7581
7582 2004-03-19  Martin Baulig  <martin@ximian.com>
7583
7584         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7585         error here and not in our caller.
7586
7587 2004-03-19  Martin Baulig  <martin@ximian.com>
7588
7589         * interface.cs: Completely killed this file.
7590         (Interface): We're now a TypeContainer and live in class.cs.
7591
7592         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7593         argument; we're now also called for interfaces.
7594         (TypeContainer.DefineMembers): Allow this method being called
7595         multiple times.
7596         (TypeContainer.GetMethods): New public method; formerly known as
7597         Interface.GetMethod().  This is used by PendingImplementation.
7598         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7599         it's now private and non-static.
7600         (Interface): Moved this here; it's now implemented similar to
7601         Class and Struct.
7602         (Method, Property, Event, Indexer): Added `bool is_interface'
7603         argument to their .ctor's.
7604         (MemberBase.IsInterface): New public field.
7605
7606         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7607         instances instead of InterfaceMethod, InterfaceProperty, etc.
7608         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7609         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7610
7611 2004-03-19  Martin Baulig  <martin@ximian.com>
7612
7613         * class.cs (MethodCore.IsDuplicateImplementation): New private
7614         method which does the CS0111 checking.
7615         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7616         Use IsDuplicateImplementation().
7617
7618 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7619
7620         * decl.cs (FindMemberToOverride): New method to find the correct
7621         method or property to override in the base class.
7622         * class.cs
7623             - Make Method/Property use the above method to find the
7624               version in the base class.
7625             - Remove the InheritableMemberSignatureCompare as it is now
7626               dead code.
7627
7628         This patch makes large code bases much faster to compile, as it is
7629         O(n) rather than O(n^2) to do this validation.
7630
7631         Also, it fixes bug 52458 which is that nested classes are not
7632         taken into account when finding the base class member.
7633
7634         Reviewed/Approved by Martin.
7635
7636 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7637
7638         * interface.cs: In all interface classes removed redundant
7639         member initialization.
7640
7641 2004-03-16  Martin Baulig  <martin@ximian.com>
7642
7643         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7644
7645 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7646
7647         * decl.cs (DefineTypeAndParents): New helper method to define a
7648         type's containers before the type itself is defined;  This is a
7649         bug exposed by the recent changes to Windows.Forms when an
7650         implemented interface was defined inside a class that had not been
7651         built yet.   
7652
7653         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7654
7655         (Check): Loop correctly to report errors modifiers
7656         (UNSAFE was not in the loop, since it was the same as TOP).
7657
7658         * interface.cs: Every interface member now takes a ModFlags,
7659         instead of a "is_new" bool, which we set on the base MemberCore. 
7660
7661         Every place where we called "UnsafeOk" in the interface, now we
7662         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7663         the unsafe settings from the member declaration instead of the
7664         container interface. 
7665
7666         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7667
7668         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7669         `set_indexer_name' to the pending bits (one per type).
7670
7671         We fixed a bug today that was picking the wrong method to
7672         override, since for properties the existing InterfaceMethod code
7673         basically ignored the method name.  Now we make sure that the
7674         method name is one of the valid indexer names.
7675
7676 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7677  
7678         * support.cs (SeekableStreamReader): Keep track of stream byte
7679         positions and don't mix them with character offsets to the buffer.
7680
7681         Patch from Gustavo Giráldez
7682
7683 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7684
7685         * interface.cs (InterfaceSetGetBase): Removed double member
7686         initialization, base class does it as well.
7687
7688 2004-03-13  Martin Baulig  <martin@ximian.com>
7689
7690         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7691         when compiling corlib.
7692
7693 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7694
7695         * convert.cs (ExplicitConversion): We were reporting an error on
7696         certain conversions (object_type source to a value type, when the
7697         expression was `null') before we had a chance to pass it through
7698         the user defined conversions.
7699
7700         * driver.cs: Replace / and \ in resource specifications to dots.
7701         Fixes 50752
7702
7703         * class.cs: Add check for duplicate operators.  Fixes 52477
7704
7705 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7706
7707         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7708         that are in the middle of the statements, not only at the end.
7709         Fixes #54987
7710
7711         * class.cs (TypeContainer.AddField): No longer set the
7712         `HaveStaticConstructor' flag, now we call it
7713         `UserDefineStaticConstructor' to diferentiate the slightly
7714         semantic difference.
7715
7716         The situation is that we were not adding BeforeFieldInit (from
7717         Modifiers.TypeAttr) to classes that could have it.
7718         BeforeFieldInit should be set to classes that have no static
7719         constructor. 
7720
7721         See:
7722
7723         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7724
7725         And most importantly Zoltan's comment:
7726
7727         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7728
7729         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7730          before its static fields are used', i.e. initialization does not need
7731          to be triggered by the first access to the type. Setting this flag
7732          helps the JIT to compile better code, since it can run the static
7733          constructor at JIT time, and does not need to generate code to call it
7734          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7735          this flag for lots of classes like String. 
7736          
7737          csc sets this flag if the type does not have an explicit static 
7738          constructor. The reasoning seems to be that if there are only static
7739          initalizers for a type, and no static constructor, then the programmer
7740          does not care when this initialization happens, so beforefieldinit
7741          can be used.
7742          
7743          This bug prevents the AOT compiler from being usable, since it 
7744          generates so many calls to mono_runtime_class_init that the AOT code
7745          is much slower than the JITted code. The JITted code is faster, 
7746          because it does not generate these calls if the vtable is type is
7747          already initialized, which is true in the majority of cases. But the
7748          AOT compiler can't do this."
7749
7750 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7751
7752         * class.cs (MethodData.Emit): Refactor the code so symbolic
7753         information is generated for destructors;  For some reasons we
7754         were taking a code path that did not generate symbolic information
7755         before. 
7756
7757 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7758
7759         * class.cs: Create a Constructor.CheckBase method that
7760         takes care of all validation type code. The method
7761         contains some code that was moved from Define.
7762
7763         It also includes new code that checks for duplicate ctors.
7764         This fixes bug #55148.
7765
7766 2004-03-09  Joshua Tauberer <tauberer@for.net>
7767
7768         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7769         a { ... }-style array creation invokes EmitStaticInitializers
7770         which is not good for reference-type arrays.  String, decimal
7771         and now null constants (NullCast) are not counted toward
7772         static initializers.
7773
7774 2004-03-05  Martin Baulig  <martin@ximian.com>
7775
7776         * location.cs (SourceFile.HasLineDirective): New public field;
7777         specifies whether the file contains or is referenced by a "#line"
7778         directive.
7779         (Location.DefineSymbolDocuments): Ignore source files which
7780         either contain or are referenced by a "#line" directive.        
7781
7782 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7783
7784         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7785         direct access to our parent, so check the method inline there.
7786
7787 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7788
7789         * expression.cs (Invocation.EmitCall): Miguel's last commit
7790         caused a regression. If you had:
7791
7792             T t = null;
7793             t.Foo ();
7794
7795         In Foo the implict this would be null.
7796
7797 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7798
7799         * expression.cs (Invocation.EmitCall): If the method is not
7800         virtual, do not emit a CallVirt to it, use Call.
7801
7802         * typemanager.cs (GetFullNameSignature): Improve the method to
7803         cope with ".ctor" and replace it with the type name.
7804
7805         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7806         as an argument the ConstructorBuilder where it is being defined,
7807         to catch the recursive constructor invocations.
7808
7809 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7810
7811         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7812         routines to check if a type is an enumerable/enumerator allow
7813         classes that implement the IEnumerable or IEnumerator interfaces.
7814
7815         * class.cs (Property, Operator): Implement IIteratorContainer, and
7816         implement SetYields.
7817
7818         (Property.Define): Do the block swapping for get_methods in the
7819         context of iterators.   We need to check if Properties also
7820         include indexers or not.
7821
7822         (Operator): Assign the Block before invoking the
7823         OperatorMethod.Define, so we can trigger the Iterator code
7824         replacement. 
7825
7826         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7827         Property and Operator classes are not created when we parse the
7828         declarator but until we have the block completed, so we use a
7829         singleton SimpleIteratorContainer.Simple to flag whether the
7830         SetYields has been invoked.
7831
7832         We propagate this setting then to the Property or the Operator to
7833         allow the `yield' to function.
7834
7835 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7836
7837         * codegen.cs: Implemented attribute support for modules.
7838         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7839         Assembly/Module functionality.
7840
7841         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7842         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7843         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7844
7845 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7846
7847         * interface.cs (FindMembers): The operation is performed on all base
7848         interfaces and not only on the first. It is required for future CLS Compliance patch.
7849
7850 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7851
7852         * statement.cs, codegen.cs:
7853         This patch deals with patterns such as:
7854
7855         public class List : IEnumerable {
7856
7857                 public MyEnumerator GetEnumerator () {
7858                         return new MyEnumerator(this);
7859                 }
7860
7861                 IEnumerator IEnumerable.GetEnumerator () {
7862                         ...
7863                 }
7864                 
7865                 public struct MyEnumerator : IEnumerator {
7866                         ...
7867                 }
7868         }
7869
7870         Before, there were a few things we did wrong:
7871         1) we would emit callvirt on a struct, which is illegal
7872         2) we emited ldarg when we needed to emit ldarga
7873         3) we would mistakenly call the interface methods on an enumerator
7874         type that derived from IEnumerator and was in another assembly. For example:
7875
7876         public class MyEnumerator : IEnumerator
7877
7878         Would have the interface methods called, even if there were public impls of the
7879         method. In a struct, this lead to invalid IL code.
7880
7881 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7882
7883         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7884           renamed to Emit.
7885
7886         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7887
7888 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7889
7890         * cs-parser.jay: Fix small regression: we were not testing V2
7891         compiler features correctly.
7892
7893         * interface.cs: If the emit context is null, then create one
7894
7895 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7896
7897         * decl.cs (GetSignatureForError): New virtual method to get full name
7898           for error messages.
7899
7900         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7901           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7902
7903         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7904           Duplicated members and code in these classes has been removed.
7905           Better encapsulation in these classes.
7906
7907 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7908
7909         * assign.cs (Assign.DoResolve): When dealing with compound
7910         assignments, there is a new rule in ECMA C# 2.4 (might have been
7911         there before, but it is documented here) that states that in:
7912
7913         a op= b;
7914
7915         If b is of type int, and the `op' is a shift-operator, then the
7916         above is evaluated as:
7917
7918         a = (int) a op b 
7919
7920         * expression.cs (Binary.ResolveOperator): Instead of testing for
7921         int/uint/long/ulong, try to implicitly convert to any of those
7922         types and use that in pointer arithmetic.
7923
7924         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7925         method to print information for from the type, not from the
7926         null-method we were given.
7927
7928 2004-02-01  Duncan Mak  <duncan@ximian.com>
7929
7930         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7931         parsing for cmd, fixes bug #53694.
7932
7933 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7934
7935         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7936         in the member name duplication tests. Property and operator name duplication
7937         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7938
7939 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7940
7941         * interface.cs (PopulateMethod): Fixed crash when interface method
7942         returns not existing type (error test cs0246-3.cs).
7943
7944 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7945
7946         * cs-parser.jay (interface_accessors): Re-write actions to also
7947         store attributes attached to get and set methods. Fix spelling
7948         while at it.
7949
7950         (inteface_property_declaration): Modify accordingly.
7951
7952         (InterfaceAccessorInfo): New helper class to store information to pass
7953         around between rules that use interface_accessors.
7954
7955         * interface.cs (Emit): Apply attributes on the get and set
7956         accessors of properties and indexers too.
7957
7958         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7959         right MethodBuilder when applying attributes to the get and set accessors.
7960
7961 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7962
7963         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7964
7965 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7966
7967         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7968
7969 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7970
7971         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7972         changes that treat `yield' specially when present before `break'
7973         or `return' tokens.
7974
7975         * cs-tokenizer.cs: yield is no longer a keyword.
7976
7977 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7978
7979         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7980         setting for default constructors.
7981         For default constructors are almost every time set wrong Modifier. The
7982         generated IL code has been alright. But inside mcs this values was
7983         wrong and this was reason why several of my CLS Compliance tests
7984         failed.
7985
7986 2004-01-22  Martin Baulig  <martin@ximian.com>
7987
7988         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7989         not a QualifiedIdentifier.  This is what `type_name_expression'
7990         was previously doing.
7991         (type_name_expression): Removed; the code is now in
7992         `namespace_or_type_name'.
7993         (qualified_identifier): Removed, use `namespace_or_type_name'
7994         instead.
7995         (QualifiedIdentifier): Removed this class.      
7996
7997 2004-01-22  Martin Baulig  <martin@ximian.com>
7998
7999         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8000         not a string as alias name.
8001
8002 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8003
8004         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8005         #52730 bug, and instead compute correctly the need to use a
8006         temporary variable when requesting an address based on the
8007         static/instace modified of the field and the constructor.
8008  
8009 2004-01-21  Martin Baulig  <martin@ximian.com>
8010
8011         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8012         class and namespace before looking up aliases.  Fixes #52517.
8013
8014 2004-01-21  Martin Baulig  <martin@ximian.com>
8015
8016         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8017         assinged in a 'try'; fixes exception4.cs.
8018
8019 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8020         * class.cs : Implemented parameter-less constructor for TypeContainer
8021
8022         * decl.cs: Attributes are now stored here. New property OptAttributes
8023
8024         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8025
8026         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8027
8028 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8029
8030         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8031           (CSharpSignature): New method for indexer and property signature.
8032
8033 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8034
8035         * pending.cs (IsVirtualFilter): Faster implementation.
8036
8037 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8038
8039         * typemanager.cs: Avoid inclusion of same assembly more than once.
8040
8041 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8042
8043         * cs-parser.jay: Fixed problem where the last assembly attribute
8044           has been applied also to following declaration (class, struct, etc.)
8045           
8046 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8047
8048         * class.cs: Added error CS0538, CS0539 reporting.
8049         Fixed crash on Microsoft runtime when field type is void.
8050
8051         * cs-parser.jay: Added error CS0537 reporting.
8052
8053         * pending.cs: Added error CS0535 reporting.
8054         Improved error report for errors CS0536, CS0534.
8055
8056 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8057
8058         Merge a few bits from the Anonymous Method MCS tree.
8059
8060         * statement.cs (ToplevelBlock): New class for toplevel methods,
8061         will hold anonymous methods, lifted variables.
8062
8063         * cs-parser.jay: Create toplevel blocks for delegates and for
8064         regular blocks of code. 
8065
8066 2004-01-20  Martin Baulig  <martin@ximian.com>
8067
8068         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8069         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8070         and `NeedExplicitReturn'; added `IsLastStatement'.
8071         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8072         have a `ReturnLabel' or we're not unreachable.
8073
8074         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8075         child's reachability; don't just override ours with it.  Fixes
8076         #58058 (lluis's example).
8077         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8078         InFinally(), InLoop(), InSwitch() and
8079         BreakCrossesTryCatchBoundary() methods.
8080
8081         * statement.cs (Return): Do all error checking in Resolve().
8082         Unless we are the last statement in a top-level block, always
8083         create a return label and jump to it.
8084         (Break, Continue): Do all error checking in Resolve(); also make
8085         sure we aren't leaving a `finally'.
8086         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8087         statement in a top-level block.
8088         (Block.Flags): Added `IsDestructor'.
8089         (Block.IsDestructor): New public property.
8090
8091 2004-01-20  Martin Baulig  <martin@ximian.com>
8092
8093         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8094
8095 2004-01-20  Martin Baulig  <martin@ximian.com>
8096
8097         * statement.cs (Statement.ResolveUnreachable): New public method.
8098         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8099         (Block.Resolve): Resolve unreachable statements.
8100
8101 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8102
8103         * expression.cs: We need to fix the case where we do
8104         not have a temp variable here.
8105
8106         * assign.cs: Only expression compound assignments need
8107         temporary variables.
8108
8109 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8110
8111         * flowanalysis.cs: Reduce memory allocation in a few ways:
8112           - A block with no variables should not allocate a bit
8113             vector for itself.
8114           - A method with no out parameters does not need any tracking
8115             for assignment of the parameters, so we need not allocate
8116             any data for it.
8117           - The arrays:
8118                 public readonly Type[] VariableTypes;
8119                 public readonly string[] VariableNames;
8120             Are redundant. The data is already stored in the variable
8121             map, so we need not allocate another array for it.
8122           - We need to add alot of checks for if (params | locals) == null
8123             due to the first two changes.
8124
8125 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8126
8127         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8128         implement IMemoryLocation, we store a copy on a local variable and
8129         take the address of it.  Patch from Benjamin Jemlich
8130
8131         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8132         to use a special "type_name_expression" rule which reduces the
8133         number of "QualifiedIdentifier" classes created, and instead
8134         directly creates MemberAccess expressions.
8135
8136 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8137
8138         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8139         that fixes #52853.  Null literal assignment to ValueType
8140
8141         * class.cs (MethodData.Emit): Instead of checking the name of the
8142         method to determine if its a destructor, create a new derived
8143         class from Method called Destructor, and test for that.  
8144
8145         * cs-parser.jay: Create a Destructor object instead of a Method.  
8146
8147         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8148
8149         Fixes: 52933
8150
8151 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * expression.cs (Binary.ResolveOperator): Perform an implicit
8154         conversion from MethodGroups to their delegate types on the
8155         Addition operation.
8156
8157         * delegate.cs: Introduce a new class DelegateCreation that is the
8158         base class for `NewDelegate' and `ImplicitDelegateCreation',
8159         factor some code in here.
8160
8161         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8162         conversion from MethodGroups to compatible delegate types. 
8163
8164         * ecore.cs (Expression.Resolve): Do not flag error 654
8165         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8166         we allow conversions from MethodGroups to delegate types now.
8167
8168         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8169         assignments in v2 either.
8170
8171 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8172
8173         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8174         static read-only fields in ctors.
8175
8176         Applied patch from Benjamin Jemlich 
8177
8178         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8179
8180 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8181
8182         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8183         here to return true, as they can be used like this:
8184
8185                 (XXX) int.MEMBER ()
8186
8187         Fixed 49836 and all the other dups
8188
8189 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8190
8191         * driver.cs: Implement /win32res and /win32icon.
8192
8193 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8194
8195         * cs-parser.jay: Add a rule to improve error handling for the
8196         common mistake of placing modifiers after the type.
8197
8198 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8199
8200         * cs-parser.jay (interface_event_declaration): Catch
8201         initialization of events on interfaces, and report cs0068
8202
8203         * cs-parser.jay (interface_event_declaration): Catch
8204         initialization of events. 
8205
8206         * ecore.cs: Better report missing constructors.
8207
8208         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8209         the error reporting done in the wrong place.  Fix.
8210
8211         * expression.cs (Binary.ResolveOperator): Catch the 
8212         operator + (E x, E y) error earlier, and later allow for implicit
8213         conversions in operator +/- (E e, U x) from U to the underlying
8214         type of E.
8215
8216         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8217         52596, if the container class is abstract, the default constructor
8218         is protected otherwise its public (before, we were always public).
8219
8220         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8221         fixed statement.
8222
8223         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8224         Jemlich that fixes bug #52597, MCS was generating invalid code for
8225         idisposable structs.   Thanks to Ben for following up with this
8226         bug as well.
8227
8228 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8229
8230         * driver.cs: Allow assemblies without code to be generated, fixes
8231         52230.
8232
8233 2004-01-07  Nick Drochak <ndrochak@gol.com>
8234
8235         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8236
8237 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8238
8239         * cs-parser.jay: Add rules to improve error reporting if fields or
8240         methods are declared at the namespace level (error 116)
8241
8242         * Add rules to catch event add/remove
8243
8244 2004-01-04  David Sheldon <dave-mono@earth.li>
8245
8246   * expression.cs: Added matching ")" to error message for 
8247   CS0077
8248
8249 2004-01-03 Todd Berman <tberman@gentoo.org>
8250
8251         * ecore.cs, attribute.cs:
8252         Applying fix from #52429.
8253
8254 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8255
8256         * ecore.cs, expression.cs, statement.cs:
8257         Total rewrite of how we handle branching. We
8258         now handle complex boolean expressions with fewer
8259         jumps. As well if (x == 0) no longer emits a ceq.
8260
8261         if (x is Foo) is much faster now, because we generate
8262         better code.
8263
8264         Overall, we get a pretty big improvement on our benchmark
8265         tests. The code we generate is smaller and more readable.
8266
8267         I did a full two-stage bootstrap. The patch was reviewed
8268         by Martin and Miguel.
8269
8270 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8271
8272         * cs-parser.jay: Make primary_expression not take a QI.
8273         we dont need this because the member_access rule covers
8274         us here. So we replace the rule with just IDENTIFIER.
8275
8276         This has two good effects. First, we remove a s/r conflict.
8277         Second, we allocate many fewer QualifiedIdentifier objects.
8278
8279 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8280
8281         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8282         set the correct information via SRE. This prevents
8283         hanging on the MS runtime. Fixes #29374.
8284
8285 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8286
8287         * convert.cs: correctly handle conversions to value types
8288         from Enum and ValueType as unboxing conversions.
8289
8290         Fixes bug #52569. Patch by Benjamin Jemlich.
8291
8292 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8293
8294         * expression.cs (BetterConversion): Prefer int -> uint
8295         over int -> ulong (csc's behaviour). This fixed bug #52046.
8296
8297 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8298
8299         * decl.cs (MemberCache.FindMembers): now returns a
8300         MemberInfo [].
8301
8302         * typemanager.cs: In general, go with with ^^.
8303         (CopyNewMethods): take an IList.
8304         (RealMemberLookup): Only allocate an arraylist
8305         if we copy from two sets of methods.
8306
8307         This change basically does two things:
8308         1) Fewer array lists allocated due to CopyNewMethods.
8309         2) the explicit cast in MemberList costed ALOT.
8310
8311 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8312
8313         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8314         a hashtable to avoid needless string allocations when an identifier is
8315         used more than once (the common case).
8316
8317 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8318
8319         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8320         is broken, it will not return anything. So, we
8321         have to use the information we have in mcs to
8322         do the task.
8323
8324         * typemanager.cs: Add a cache for GetInterfaces,
8325         since this will now be used more often (due to ^^)
8326
8327         (GetExplicitInterfaces) New method that gets the
8328         declared, not effective, interfaces on a type
8329         builder (eg, if you have interface IFoo, interface
8330         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8331         { IBar }.
8332
8333         This patch makes MCS able to bootstrap itself on
8334         Windows again.
8335
8336 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8337
8338         * expression.cs: Remove the Nop's that Miguel put
8339         in by mistake.
8340
8341 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8342
8343         * report.cs, codegen.cs: Give the real stack trace to
8344         the error when an exception is thrown.
8345
8346 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8347
8348         * decl.cs: only allocate hashtables for ifaces if 
8349         it is an iface!
8350
8351 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8352
8353         * expression.cs: fix the error from cs0121-2.cs
8354         (a parent interface has two child interfaces that
8355         have a function with the same name and 0 params
8356         and the function is called through the parent).
8357
8358 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8359
8360         * class.cs, rootcontext.cs, typmanager.cs: do not
8361         leak pointers.
8362
8363 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8364
8365         * codegen.cs: remove stack for the ec flow branching.
8366         It is already a linked list, so no need.
8367
8368 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8369
8370         * Makefile: Allow custom profiler here.
8371
8372 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8373
8374         * typemanager.cs (LookupType):
8375           - Use a static char [], because split takes
8376             a param array for args, so it was allocating
8377             every time.
8378           - Do not store true in a hashtable, it boxes.
8379
8380 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8381
8382         * flowanalysis.cs: bytify common enums.
8383
8384 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8385
8386         * modifiers.cs: Add a new set of flags for the
8387         flags allowed on explicit interface impls.
8388         * cs-parser.jay: catch the use of modifiers in
8389         interfaces correctly.
8390         * class.cs: catch private void IFoo.Blah ().
8391
8392         All related to bug #50572.
8393
8394 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8395
8396         * decl.cs: Rewrite the consistant accessability checking.
8397         Accessability is not linear, it must be implemented in
8398         a tableish way. Fixes #49704.
8399
8400 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8401
8402         * expression.cs: Handle negation in a checked context.
8403         We must use subtraction from zero. Fixes #38674.
8404
8405 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8406
8407         * class.cs: Ignore static void main in DLLs.
8408         * rootcontext.cs: Handle the target type here,
8409         since we are have to access it from class.cs
8410         * driver.cs: account for the above.
8411
8412 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8413
8414         * report.cs: Give line numbers and files if available.
8415
8416 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8417
8418         * driver.cs: Implement /addmodule.
8419
8420         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8421         ModuleBuilders.
8422
8423 2003-12-20  Martin Baulig  <martin@ximian.com>
8424
8425         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8426         (FieldBase.IsAssigned): Removed this field.
8427         (FieldBase.SetAssigned): New public method.
8428         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8429
8430 2003-12-20  Martin Baulig  <martin@ximian.com>
8431
8432         * expression.cs (LocalVariableReference.DoResolve): Don't set
8433         `vi.Used' if we're called from DoResolveLValue().
8434
8435         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8436         returns the usage vector it just merged into the current one -
8437         pass this one to UsageWarning().
8438         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8439         of the `EmitContext', don't call this recursively on our children.
8440
8441 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8442
8443         * driver.cs: Implement /target:module.
8444
8445 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8446
8447         * support.cs (CharArrayHashtable): New helper class.
8448
8449         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8450         char arrays, not strings, so we can avoid creating a string in
8451         consume_identifier if the identifier is a keyword.
8452
8453 2003-12-16  Martin Baulig  <martin@ximian.com>
8454
8455         * statement.cs (LocalInfo.Assigned): Removed this property.
8456         (LocalInfo.Flags): Removed `Assigned'.
8457         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8458         and uses flow analysis.
8459         (Block.UsageWarning): Made this method private.
8460         (Block.Resolve): Call UsageWarning() if appropriate.
8461
8462         * expression.cs (LocalVariableReference.DoResolve): Always set
8463         LocalInfo.Used here.
8464
8465 2003-12-13  Martin Baulig  <martin@ximian.com>
8466
8467         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8468         any value here; we're now using flow analysis to figure out
8469         whether a statement/block returns a value.
8470
8471 2003-12-13  Martin Baulig  <martin@ximian.com>
8472
8473         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8474         working again.
8475         (FlowBranching.MergeFinally): Don't call
8476         `branching.CheckOutParameters()' here, this is called in
8477         MergeTopBlock().
8478         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8479         when adding the `finally' vector.       
8480
8481 2003-12-13  Martin Baulig  <martin@ximian.com>
8482
8483         * flowanalysis.cs
8484         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8485         actually work and also fix #48962.
8486
8487 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8488
8489         * decl.cs: Do not check System.Object for nested types,
8490         since we know it does not have any. Big bang for buck:
8491
8492         BEFORE:
8493            Run 1:   8.35 seconds
8494            Run 2:   8.32 seconds
8495            corlib:  17.99 seconds
8496         AFTER:
8497            Run 1:   8.17 seconds
8498            Run 2:   8.17 seconds
8499            corlib:  17.39 seconds
8500
8501 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8502
8503         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8504         time we are returning 0 members, so we save alot here.
8505
8506 2003-12-11  Martin Baulig  <martin@ximian.com>
8507
8508         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8509         `MergeChild()', also just take the `FlowBranching' as argument;
8510         call Merge() on it and return the result.
8511         (FlowBranching.Merge): We don't need to do anything if we just
8512         have one sibling.
8513
8514 2003-12-11  Martin Baulig  <martin@ximian.com>
8515
8516         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8517         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8518         Maurer for this idea.
8519
8520 2003-12-11  Martin Baulig  <martin@ximian.com>
8521
8522         * flowanalysis.cs (MergeResult): This class is now gone; we now
8523         use the `UsageVector' for this.  The reason for this is that if a
8524         branching just has one sibling, we don't need to "merge" them at
8525         all - that's the next step to do.
8526         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8527         `MergeResult'.
8528
8529 2003-12-11  Martin Baulig  <martin@ximian.com>
8530
8531         Reworked flow analyis and made it more precise and bug-free.  The
8532         most important change is that we're now using a special `Reachability'
8533         class instead of having "magic" meanings of `FlowReturns'.  I'll
8534         do some more cleanups and optimizations and also add some more
8535         documentation this week.
8536
8537         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8538         largely reworked this class.
8539         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8540         the new `Reachability' class instead of having "magic" values here.
8541         (FlowBranching): We're now using an instance of `Reachability'
8542         instead of having separate `Returns', `Breaks' etc. fields.
8543
8544         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8545         based on flow analysis; ignore the return value of block.Emit ().
8546
8547 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8548
8549         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8550         if they are private.
8551
8552 2003-12-09  Martin Baulig  <martin@ximian.com>
8553
8554         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8555         call them directly on the UsageVector.
8556
8557 2003-12-09  Martin Baulig  <martin@ximian.com>
8558
8559         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8560         Changed return type from `FlowReturns' to `Reachability'.
8561
8562 2003-12-09  Martin Baulig  <martin@ximian.com>
8563
8564         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8565         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8566         `Reachable' fields with a single `Reachability' one.
8567
8568 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8569
8570         * class.cs (FindMembers): Remove foreach's.
8571
8572         Bootstrap times:
8573
8574         BEFORE
8575                 Run 1:   8.74 seconds
8576                 Run 2:   8.71 seconds
8577
8578         AFTER
8579                 Run 1:   8.64 seconds
8580                 Run 2:   8.58 seconds
8581
8582
8583 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8584
8585         * cs-parser.jay:
8586         * gen-treedump.cs:
8587         * statement.cs:
8588         This patch does a few things:
8589                 1. EmptyStatement is now a singleton, so it is never reallocated.
8590                 2. All blah is EmptyStatement constructs have been changed to
8591                    blah == EmptyStatement.Value, which is much faster and valid
8592                    now that EmptyStatement is a singleton.
8593                 3. When resolving a block, rather than allocating a new array for
8594                    the non-empty statements, empty statements are replaced with
8595                    EmptyStatement.Value
8596                 4. Some recursive functions have been made non-recursive.
8597         Mainly the performance impact is from (3), however (1) and (2) are needed for
8598         this to work. (4) does not make a big difference in normal situations, however
8599         it makes the profile look saner.
8600
8601         Bootstrap times:
8602
8603         BEFORE
8604         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8605         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8606         Total memory allocated: 56397 KB
8607
8608         AFTER
8609         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8610         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8611         Total memory allocated: 55666 KB
8612
8613 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8614
8615         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8616         than the hashtable in a hashtable version
8617
8618         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8619         we always end up concating a string. This results in a huge perf
8620         loss, because many strings have to be tracked by the GC. In this
8621         patch, we first use a hashtable that works with two keys, so that
8622         the strings do not need to be concat'ed.
8623
8624         Bootstrap times:
8625         BEFORE
8626                 Run 1:   8.74 seconds
8627                 Run 2:   8.71 seconds
8628
8629         AFTER
8630                 Run 1:   8.65 seconds
8631                 Run 2:   8.56 seconds
8632
8633 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8634
8635         * Makefile: Add a new target `do-time' that does a quick and simple
8636         profile, leaving easy to parse output.
8637
8638 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8639
8640         * codegen.cs (Init): Create the dynamic assembly with 
8641         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8642
8643 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8644
8645         * support.cs: Make the PtrHashtable use only one
8646         instance of its comparer.
8647
8648 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8649
8650         * typemanager.cs: Fix lookup of GetNamespaces.
8651
8652 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8653
8654         * expression.cs: Removed redundant line.
8655
8656         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8657         ArrayLists, use for loops with bounds.  
8658
8659         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8660         arraylist.
8661
8662         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8663         arraylists, use for loop with bounds.
8664
8665         The above three changes give us a 0.071 second performance
8666         improvement out of 3.294 seconds down to 3.223.  On my machine
8667         the above changes reduced the memory usage by 1,387 KB during
8668         compiler bootstrap.
8669
8670         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8671         QualifiedIdentifiers.  Before we created a new string through
8672         concatenation, and mostly later on, the result would be
8673         manipulated by DecomposeQI through string manipulation.
8674
8675         This reduced the compiler memory usage for bootstrapping from
8676         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8677         compile times in 0.05 seconds.
8678
8679 2003-11-28  Dick Porter  <dick@ximian.com>
8680
8681         * support.cs: Do string compares with the Invariant culture.
8682
8683         * rootcontext.cs: 
8684         * gen-treedump.cs: 
8685         * expression.cs: 
8686         * driver.cs: 
8687         * decl.cs: 
8688         * codegen.cs: 
8689         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8690         the comparison is done with the Invariant culture.
8691
8692 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8693
8694         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8695         GetEnumerator method.
8696
8697         (ProbeCollectionType): Iterate starting at the most specific type
8698         upwards looking for a GetEnumerator
8699
8700         * expression.cs: Shift count can be up to 31 for int/uint and 63
8701         for long/ulong.
8702
8703 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8704
8705         * statement.cs (Block.LookupLabel): Also look for the label on the
8706         children blocks.  Use a hash table to keep track of visited
8707         nodes. 
8708
8709         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8710         we actually did transform the other operand, otherwise fall back
8711         to the common codepath that casts to long.
8712
8713         * cs-tokenizer.cs: Use the same code pattern as the int case.
8714         Maybe I should do the parsing myself, and avoid depending on the
8715         Parse routines to get this done.
8716
8717 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8718
8719         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8720         which fixes bug 51347.  This time test it.
8721
8722         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8723         attributes for example can not tell the difference between these.
8724         The difference was only a syntax feature of the language. 
8725
8726         * attribute.cs: Apply attributes to delegates.
8727
8728         * delegate.cs: Call the apply attributes method.
8729
8730 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8731
8732         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8733         comparing 0 vs Byte.MinValue, not the value
8734
8735         (ImplicitConversionRequired): When reporting a conversion error,
8736         use error 31 to print out the constant error instead of the
8737         simpler 29.
8738
8739         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8740         which fixes bug 51347.
8741
8742 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8743
8744         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8745         which fixes the -warnaserror command line option.
8746
8747 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8748
8749         * cfold.cs (DoNumericPromotions): During constant folding of
8750         additions on UIntConstant, special case intconstants with
8751         IntConstants like we do on the expression binary operator. 
8752
8753 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8754
8755         * convert.cs (ImplicitReferenceConversion): We were missing a case
8756         (System.Enum are not value types or class types, so we need to
8757         classify them separatedly).
8758
8759         * driver.cs: We do not support error 2007.
8760
8761 2003-11-12 Jackson Harper <jackson@ximian.com>
8762
8763         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8764         system directory. Also use the full file name so users can
8765         libraries names mscorlib-o-tron.dll in a non system dir.
8766
8767 2003-11-10  Martin Baulig  <martin@ximian.com>
8768
8769         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8770         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8771         calling `ResolveType()' on them, directly assign their `Type'.
8772
8773 2003-11-08  Martin Baulig  <martin@ximian.com>
8774
8775         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8776         return value and the `out parent' parameter.
8777         (TypeContainer.DefineType): Moved the CS0644 check into
8778         GetClassBases().  Don't pass the interface types to the
8779         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8780         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8781
8782         * ecore.cs (TypeExpr.IsAttribute): New property.
8783         (TypeExpr.GetInterfaces): New method.
8784
8785         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8786         TypeExpr instead of a Type.
8787         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8788         (Interface.DefineType): Don't pass the interface types to the
8789         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8790         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8791
8792         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8793         instead of a `Type[]'.
8794         (TypeManager.RegisterBuilder): Likewise.
8795         (TypeManager.AddUserInterface): Likewise.
8796         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8797         `Type[]' and also return a `TypeExpr[]'.
8798         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8799
8800 2003-11-08  Martin Baulig  <martin@ximian.com>
8801
8802         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8803         Expression.     
8804
8805 2003-11-08  Martin Baulig  <martin@ximian.com>
8806
8807         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8808         TypeManager.ResolveExpressionTypes().
8809
8810         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8811         instead of an Expression.
8812         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8813         (TypeExpression): New public class; formerly known as `TypeExpr'.
8814
8815         * expression.cs (ComposedCast): Derive from TypeExpr.
8816
8817         * typemanager.cs (TypeManager.system_*_expr): These are now
8818         TypExpr's instead of Expression's.
8819         (TypeManager.ResolveExpressionTypes): New public static function;
8820         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8821         of them.        
8822
8823 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8824
8825         * expression.cs (New.DoResolve): Do not dereference value that
8826         might be a null return.
8827
8828         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8829         sure that the constant value has the right type.  Fixes an
8830         unreported bug, similar to 50425.
8831
8832         * const.cs (Const.LookupConstantValue): Call
8833         ImplicitStandardConversionExists before doing a conversion to
8834         avoid havng the TypeManager.ChangeType do conversions.
8835
8836         Reduced the number of casts used
8837
8838         (Const.ChangeType): New routine to enable reuse of the constant
8839         type changing code from statement.
8840
8841         * typemanager.cs (ChangeType): Move common initialization to
8842         static global variables.
8843
8844         Fixes #50425.
8845
8846         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8847         every value type to go through, even if it was void.  Fix that. 
8848
8849         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8850         character of the define, and the is_identifier_part_character for
8851         the rest of the string.
8852
8853 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8854
8855         * expression.cs (UnaryMutator.EmitCode): When I updated
8856         LocalVariableReference.DoResolve, I overdid it, and dropped an
8857         optimization done on local variable references.
8858
8859 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8860
8861         * ecore.cs: Convert the return from Ldlen into an int.
8862
8863 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8864
8865         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8866         the accessibility, this is a special case for toplevel non-public
8867         classes (internal for instance).
8868
8869 2003-10-20  Nick Drochak <ndrochak@gol.com>
8870
8871         * ecore.cs: Fix typo and build.  Needed another right paren.
8872
8873 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8874
8875         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8876         `internal' case regular and protected, but not allowing protected
8877         to be evaluated later.  Bug 49840
8878
8879 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8880
8881         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8882         to kb.Nlast, and not the kb.nFirst to isolate the switch
8883         statement.
8884
8885         Extract the underlying type, so enumerations of long/ulong are
8886         treated like long/ulong.
8887
8888 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8889
8890         * expression.cs (New): Overload the meaning of RequestedType to
8891         track the possible creation of the NewDelegate type, since
8892         DoResolve is invoked more than once for new constructors on field
8893         initialization.
8894
8895         See bugs: #48800 and #37014
8896
8897         * cs-parser.jay (declare_local_constants): Take an arraylist
8898         instead of a single constant.
8899
8900         (local_constant_declaration): It should take a
8901         constant_declarators, not a constant_declarator.  Fixes 49487
8902
8903         * convert.cs: Fix error report.
8904
8905 2003-10-13 Jackson Harper <jackson@ximian.com>
8906
8907         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8908         bug #49611
8909
8910 2003-10-09  Martin Baulig  <martin@ximian.com>
8911
8912         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8913         to the .ctor.
8914         (MethodCore.DoDefineParameters): Removed the TypeContainer
8915         argument; use the DeclSpace which was passed to the .ctor instead.
8916         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8917         TypeContainer; we only need a DeclSpace here.
8918
8919 2003-10-09  Martin Baulig  <martin@ximian.com>
8920
8921         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8922         to the .ctor.
8923         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8924         EmitContext's .ctor.    
8925
8926 2003-10-09  Martin Baulig  <martin@ximian.com>
8927
8928         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8929         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8930         AsAccessible(), moved them as well.
8931
8932         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8933
8934 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8935
8936         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8937
8938 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8939
8940         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8941         generation for >=, as spotted by Paolo, bug 48679.  
8942         Patch from David Waite.
8943
8944         * cs-tokenizer.cs: Add handling for #pragma.
8945
8946         * cs-parser.jay: Allow for both yield and yield return in the
8947         syntax.  The anti-cobolization of C# fight will go on!
8948
8949         * class.cs (TypeBuilder.DefineType): Catch error condition here
8950         (Parent.DefineType erroring out and returning null).
8951
8952         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8953         coping with enumerations variables, we were mistakenly processing
8954         them as a regular value type instead of built-in types.  Fixes the
8955         bug #48063
8956
8957         * typemanager.cs (IsBuiltinOrEnum): New method.
8958
8959 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8960
8961         * cs-parser.jay: Upgrade: yield now needs the return clause.
8962
8963 2003-09-19  Martin Baulig  <martin@ximian.com>
8964
8965         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8966         `MemberCache parent' argument.  Normally, an interface doesn't
8967         have a parent type except System.Object, but we use this in gmcs
8968         for generic type parameters.
8969
8970 2003-09-18  Martin Baulig  <martin@ximian.com>
8971
8972         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8973         on `type.IsInterface'; don't check whether the type has a parent
8974         to determine whether it's an interface.
8975
8976 2003-09-15  Martin Baulig  <martin@ximian.com>
8977
8978         * class.cs (TypeContainer.DefineType): Added an error flag to
8979         avoid reporting duplicate CS0146's ("class definition is
8980         circular.").
8981
8982         * driver.cs (Driver.MainDriver): Abort if
8983         RootContext.ResolveTree() reported any errors.
8984
8985 2003-09-07  Martin Baulig  <martin@ximian.com>
8986
8987         * report.cs (Error, Warning): Added overloaded versions which take
8988         a `params object[] args' and call String.Format().
8989
8990 2003-09-07  Martin Baulig  <martin@ximian.com>
8991
8992         * decl.cs (DeclSpace..ctor): Don't call
8993         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8994         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8995         (DeclSpace.RecordDecl): New method.
8996
8997         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8998
8999 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9000
9001         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9002         value attributes to be applied to ParameterBuilders.
9003
9004         * class.cs (MethodCore.LabelParameters): Make static and more
9005         generic so that it can be used from other places - like interface
9006         methods, for instance.
9007
9008         * interface.cs (Interface.Emit): Call LabelParameters before
9009         emitting attributes on the InterfaceMethod.
9010
9011 2003-08-26  Martin Baulig  <martin@ximian.com>
9012
9013         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9014         resolving aliases; fixes #47927.
9015
9016 2003-08-26  Martin Baulig  <martin@ximian.com>
9017
9018         * statement.cs (Using.DoResolve): This is internally emitting a
9019         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9020         do not always return.  Fixes #47681.
9021
9022 2003-08-26  Martin Baulig  <martin@ximian.com>
9023
9024         * decl.cs (MemberCore): Moved WarningNotHiding(),
9025         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9026         into MemberBase.
9027         (AdditionResult): Make this nested in DeclSpace.
9028         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9029         argument; call NamespaceEntry.Define() unless we're nested in a
9030         class or struct.
9031
9032         * namespace.cs (Namespace.DefineName): New public function.  This
9033         is called from DeclSpace's .ctor to add 
9034         (Namespace.Lookup): Include DeclSpaces in the lookup.
9035
9036         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9037
9038         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9039
9040 2003-08-25  Martin Baulig  <martin@ximian.com>
9041
9042         * convert.cs (Convert.ExplicitReferenceConversion): When
9043         converting from an interface type to a class, unbox if the target
9044         type is a struct type.  Fixes #47822.
9045
9046 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9047
9048         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9049         #47854.
9050
9051 2003-08-22  Martin Baulig  <martin@ximian.com>
9052
9053         * class.cs (TypeManager.DefineType): When defining a nested type,
9054         call DefineType() on our parent; fixes #47801.
9055
9056 2003-08-22  Martin Baulig  <martin@ximian.com>
9057
9058         * class.cs (MethodData.Define): While checking if a method is an
9059         interface implementation, improve the test a bit more to fix #47654.
9060
9061 2003-08-22  Martin Baulig  <martin@ximian.com>
9062
9063         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9064         correctly; fixes #47722.
9065
9066 2003-08-22  Martin Baulig  <martin@ximian.com>
9067
9068         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9069         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9070
9071         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9072
9073 2003-08-22  Martin Baulig  <martin@ximian.com>
9074
9075         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9076         can only be assigned in static constructors.  Fixes #47161.
9077
9078 2003-08-22  Martin Baulig  <martin@ximian.com>
9079
9080         Rewrote and improved the flow analysis code.
9081
9082         * flowbranching.cs (FlowBranching): Make this class abstract.
9083         (FlowBranching.CreateBranching): New static function to create a
9084         new flow branching.
9085         (FlowBranchingBlock, FlowBranchingException): New classes.
9086         (FlowBranching.UsageVector.Type): New public readonly field.
9087         (FlowBranching.UsageVector.Breaks): Removed the setter.
9088         (FlowBranching.UsageVector.Returns): Removed the setter.
9089         (FlowBranching.UsageVector): Added Break(), Return(),
9090         NeverReachable() and Throw() methods to modify the reachability.
9091         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9092         done by FlowBranching.Merge().
9093         (FlowBranching.UsageVector.MergeChild): New method; merges the
9094         merge result into the current vector.
9095         (FlowBranching.Merge): New abstract method to merge a branching.
9096
9097 2003-08-12  Martin Baulig  <martin@ximian.com>
9098
9099         * expression.cs (Indirection.CacheTemporaries): Create the
9100         LocalTemporary with the pointer type, not its element type.
9101
9102 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9103
9104         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9105         token was a keyword or not.
9106
9107         Add `error' options where an IDENTIFIER was expected;  Provide
9108         CheckToken and CheckIdentifierToken convenience error reporting
9109         functions. 
9110
9111         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9112
9113         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9114         NameSpaceEntry NameSpaceEntry.
9115
9116         (LookupInterfaceOrClass): Avoid creating a full qualified name
9117         from namespace and name: avoid doing lookups when we know the
9118         namespace is non-existant.   Use new Tree.LookupByNamespace which
9119         looks up DeclSpaces based on their namespace, name pair.
9120
9121         * driver.cs: Provide a new `parser verbose' to display the
9122         exception thrown during parsing.  This is turned off by default
9123         now, so the output of a failure from mcs is more graceful.
9124
9125         * namespace.cs: Track all the namespaces defined in a hashtable
9126         for quick lookup.
9127
9128         (IsNamespace): New method
9129
9130 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9131
9132         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9133         we know that we need to concatenate (full typename can never be
9134         null). 
9135
9136         * class.cs: ditto.
9137
9138         * statement.cs: Use a bitfield;  Do not initialize to null things
9139         which are done by the constructor by default.
9140
9141         * cs-parser.jay: bug fix, parameter was 4, not 3.
9142
9143         * expression.cs: Just use the property;
9144
9145         * statement.cs: No need for GetVariableInfo method.
9146
9147 2003-08-08  Martin Baulig  <martin@ximian.com>
9148
9149         * flowanalysis.cs (FlowReturns): This is now nested in the
9150         `FlowBranching' class.
9151         (MyBitVector): Moved this here from statement.cs.
9152         (FlowBranching.SiblingType): New enum type.
9153         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9154
9155 2003-08-07  Martin Baulig  <martin@ximian.com>
9156
9157         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9158         `FlowBranching' class and called `BranchingType'.
9159
9160 2003-08-07  Martin Baulig  <martin@ximian.com>
9161
9162         * flowanalysis.cs: Moved all the control flow analysis code into
9163         its own file.
9164
9165 2003-08-07  Martin Baulig  <martin@ximian.com>
9166
9167         * assign.cs (Assign.DoResolve): `target' must either be an
9168         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9169         #37319.
9170
9171 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9172
9173         * expression.cs (BinaryMethod): This kind of expression is created by the
9174         Binary class if it determines that the operator has to be handled
9175         by a method.
9176
9177         (BinaryDelegate): This kind of expression is created if we are
9178         dealing with a + or - operator on delegates.
9179
9180         (Binary): remove method, argumetns, and DelegateOperator: when
9181         dealing with methods, 
9182
9183         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9184
9185         * statement.cs (Block): use bitfields for the three extra booleans
9186         we had in use.   Remove unused topblock parameter.
9187
9188         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9189
9190         * assign.cs: Drop extra unneeded tests.
9191
9192 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9193
9194         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9195
9196         * statement.cs (Foreach): Use VariableStorage instead of
9197         LocalBuilders.   
9198
9199         * codegen.cs (VariableStorage): New class used by clients that
9200         require a variable stored: locals or fields for variables that
9201         need to live across yield.
9202
9203         Maybe provide a convenience api for EmitThis+EmitLoad?
9204
9205         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9206         these bad boys.
9207
9208 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9209
9210         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9211         RemapParameterLValue): New methods that are used to turn a
9212         precomputed FieldInfo into an expression like this:
9213
9214                 instance.FieldInfo
9215
9216         The idea is to use this instead of making LocalVariableReference
9217         have more than one meaning.
9218
9219         * cs-parser.jay: Add error production to BASE.
9220
9221         * ecore.cs: Deal with TypeManager.GetField returning null, which
9222         is now a valid return value.
9223
9224         (FieldExprNoAddress): New expression for Fields whose address can
9225         not be taken.
9226
9227         * expression.cs (LocalVariableReference): During the resolve
9228         phases, create new expressions if we are in a remapping context.
9229         Remove code that dealt with remapping here.
9230
9231         (ParameterReference): same.
9232
9233         (ProxyInstance): New expression, like the `This' expression, but
9234         it is born fully resolved.  We know what we are doing, so remove
9235         the errors that are targeted to user-provided uses of `this'.
9236
9237         * statement.cs (Foreach): our variable is now stored as an
9238         Expression;  During resolution, follow the protocol, dont just
9239         assume it will return this.
9240
9241 2003-08-06  Martin Baulig  <martin@ximian.com>
9242
9243         * support.cs (SeekableStreamReader.cs): New public class.
9244
9245         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9246         SeekableStreamReader instead of the normal StreamReader.
9247
9248 2003-08-04  Martin Baulig  <martin@ximian.com>
9249
9250         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9251         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9252         deambiguate casts and delegate invocations.
9253         (parenthesized_expression): Use the new tokens to ensure this is
9254         not a cast of method invocation.
9255
9256         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9257         when reading a `)' and Deambiguate_CloseParens () was previously
9258         called.
9259
9260         * expression.cs (ParenthesizedExpression): New class.  This is
9261         just used for the CS0075 test.
9262         (Binary.DoResolve): Check for CS0075.   
9263
9264 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9265
9266         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9267         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9268         reference comparison.
9269
9270         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9271         examine the ReturnType for equality - this is necessary in the
9272         cases of implicit and explicit operators whose signature also
9273         includes the return type.
9274
9275 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9276
9277         * namespace.cs: Cache the result of the namespace computation,
9278         instead of computing it every time.
9279
9280 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9281
9282         * decl.cs: Use a global arraylist that we reuse over invocations
9283         to avoid excesive memory consumption.  Reduces memory usage on an
9284         mcs compile by one meg (45 average).
9285
9286         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9287         private, work around that.
9288
9289 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9290
9291         * literal.cs (IntLiteral): Define Zero and One static literals. 
9292
9293         * cs-parser.jay (integer_literal): use static literals to reduce
9294         memory usage for the most used literals (0, 1 and -1).  211kb
9295         reduced in memory usage.
9296
9297         Replace all calls to `new ArrayList' with `new
9298         ArrayList(4)' which is a good average number for most allocations,
9299         and also requires only 16 bytes of memory for its buffer by
9300         default. 
9301
9302         This reduced MCS memory usage in seven megabytes for the RSS after
9303         bootstrapping.
9304
9305 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9306
9307         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9308         handle params methods the correct way by forming only one
9309         applicable set with params and normal methods in them. Earlier we
9310         were looking at params methods only if we found no normal methods
9311         which was not the correct thing to do.
9312
9313         (Invocation.BetterFunction): Take separate arguments indicating
9314         when candidate and the best method are params methods in their
9315         expanded form.
9316
9317         This fixes bugs #43367 and #46199.
9318
9319         * attribute.cs: Documentation updates.
9320
9321         (CheckAttribute): Rename to CheckAttributeTarget.
9322         (GetValidPlaces): Rename to GetValidTargets.
9323
9324         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9325         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9326
9327         Fixes bug #44468.
9328
9329 2003-07-28  Martin Baulig  <martin@ximian.com>
9330
9331         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9332         name when looking up the base class of a nested class.  Fixes #46977.
9333
9334 2003-07-26  Martin Baulig  <martin@ximian.com>
9335
9336         * expression.cs (Indexers.Indexer): New nested struct; contains
9337         getter, setter and the indexer's type.
9338         (Indexers.Properties): This is now an ArrayList of
9339         Indexers.Indexer's.
9340         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9341         indexer doesn't have any getters.
9342
9343         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9344         for embedded property and indexer assignments.
9345
9346 2003-07-26  Martin Baulig  <martin@ximian.com>
9347
9348         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9349         preprocessor directive is not the first non-whitespace character
9350         on a line.
9351
9352 2003-07-26  Martin Baulig  <martin@ximian.com>
9353
9354         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9355         namespace parsing, follow the spec more closely.
9356
9357         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9358         NamespaceEntry.Lookup().
9359
9360 2003-07-25  Martin Baulig  <martin@ximian.com>
9361
9362         * MethodCore.cs (OverridesSomething): New public field; it's set
9363         from TypeContainer.DefineMembers if this method overrides
9364         something (which doesn't need to be a method).  Fix #39462.
9365
9366 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9367
9368         * typemanager.cs (GetMembers): Ensure that the list of members is
9369         reversed. This keeps things in sync.
9370
9371         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9372         find an AttributeUsage attribute.
9373
9374         * expression.cs (Invocation.OverloadResolve): Perform the check
9375         which disallows Invoke to be directly called on a Delegate.
9376
9377         (Error_InvokeOnDelegate): Report error cs1533.
9378
9379 2003-07-25  Martin Baulig  <martin@ximian.com>
9380
9381         * expression.cs (Indexers.GetIndexersForType): Only look in the
9382         interface hierarchy if the requested type is already an
9383         interface.  Fixes #46788 while keeping #46502 fixed.
9384
9385 2003-07-25  Martin Baulig  <martin@ximian.com>
9386
9387         * class.cs (TypeContainer.DefineMembers): Check whether all
9388         readonly fields have been assigned and report warning CS0649 if
9389         not.
9390
9391         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9392         a valuetype.
9393
9394 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9395
9396         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9397         returned from GetMethods to make things consistent with the
9398         assumptions MCS makes about ordering of methods.
9399
9400         This should comprehensively fix bug #45127 and it does :-)
9401
9402         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9403         ordering is actually reverse.
9404
9405         * Clean up some debug messages I left lying around.
9406
9407         * interface.cs (Populate*): Get rid of code which emits attributes
9408         since the stage in which we emit attributes is the 'Emit' stage,
9409         not the define stage.
9410
9411         (Emit): Move attribute emission for interface members here.
9412
9413 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9414
9415         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9416         closely: we eliminate methods in base types when we have an
9417         applicable method in a top-level type.
9418
9419         Please see section 14.5.5.1 for an exact description of what goes
9420         on. 
9421
9422         This fixes bug #45127 and a host of other related to corlib compilation.
9423
9424         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9425         array is the method corresponding to the top-level type (this is
9426         because of the changes made to icall.c) so we change this
9427         accordingly.
9428
9429         (MethodGroupExpr.Name): This too.
9430
9431         * typemanager.cs (GetElementType): New method which does the right
9432         thing when compiling corlib. 
9433
9434         * everywhere: Make use of the above in the relevant places.
9435
9436 2003-07-22  Martin Baulig  <martin@ximian.com>
9437
9438         * cs-parser.jay (invocation_expression): Moved
9439         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9440         `cast_expression', but create a InvocationOrCast which later
9441         resolves to either an Invocation or a Cast.
9442
9443         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9444         method; call this before EmitStatement() to make sure that this
9445         expression can be used as a statement.
9446
9447         * expression.cs (InvocationOrCast): New class; resolves to either
9448         an Invocation or a Cast.
9449
9450         * statement.cs (StatementExpression): Call ResolveStatement() on
9451         the ExpressionStatement before emitting it.
9452
9453 2003-07-21  Martin Baulig  <martin@ximian.com>
9454
9455         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9456         `ref' and `out' attributes match; fixes #46220.
9457         (MemberAccess.ResolveMemberAccess): You can't reference a type
9458         through an expression; fixes #33180.
9459         (Indexers.GetIndexersForType): Don't return the indexers from
9460         interfaces the class implements; fixes #46502.
9461
9462 2003-07-21  Martin Baulig  <martin@ximian.com>
9463
9464         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9465         CS0661 checks; fixes bug #30442.
9466
9467 2003-07-21  Martin Baulig  <martin@ximian.com>
9468
9469         * decl.cs (AdditionResult): Added `Error'.
9470
9471         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9472
9473         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9474         makes cs0031.cs actually work.
9475
9476 2003-07-20  Martin Baulig  <martin@ximian.com>
9477
9478         * namespace.cs: Fixed that bug which caused a crash when compiling
9479         the debugger's GUI.
9480
9481 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9482
9483         * typemanager.cs (LookupTypeReflection): Never expose types which
9484         are NotPublic, NestedPrivate, NestedAssembly, or
9485         NestedFamANDAssem.  We used to return these, and later do a check
9486         that would report a meaningful error, but the problem is that we
9487         would not get the real match, if there was a name override.
9488
9489 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9490
9491         * namespace.cs (Namespace, Name): Do not compute the namespace
9492         name dynamically, compute it in the constructor.  This reduced
9493         memory usage by 1697 KB.
9494
9495         * driver.cs: Use --pause to pause at the end.
9496
9497 2003-07-17  Peter Williams  <peter@newton.cx>
9498
9499         * Makefile: Change the name of the test target so that it doesn't
9500         conflict with the recursive test target.
9501
9502 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9503
9504         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9505         AddressOf): Do not use EmitThis, that was wrong, use the actual
9506         this pointer.
9507
9508 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9509
9510         * class.cs (MethodData.Define): While checking if a method is an
9511         interface implementation, improve the test: If we are not public
9512         (use new test here: use the computed MethodAttributes directly,
9513         instead of the parsed modifier flags) check if the `implementing'
9514         method comes from an interface or not.
9515
9516         * pending.cs (VerifyPendingMethods): Slightly better error
9517         message.
9518
9519         * makefile: add test target that does the mcs bootstrap.
9520
9521 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9522
9523         * interface.cs (Define): Do nothing here since there are no
9524         members to populate etc. Move the attribute emission out of here
9525         since this was just totally the wrong place to put it. Attribute
9526         application happens during the 'Emit' phase, not in the 'Define'
9527         phase.
9528
9529         (Emit): Add this method and move the attribute emission here
9530
9531         * rootcontext.cs (EmitCode): Call the Emit method on interface
9532         types too.
9533
9534 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9535
9536         * expression.cs (OverloadResolve): Report error only if Location
9537         is not 'Null' which means that there was a probe going on.
9538
9539 2003-07-14  Martin Baulig  <martin@ximian.com>
9540
9541         * expression.cs (ConditionalLogicalOperator): New public class to
9542         implement user defined conditional logical operators.
9543         This is section 14.11.2 in the spec and bug #40505.
9544
9545 2003-07-14  Martin Baulig  <martin@ximian.com>
9546
9547         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9548
9549 2003-07-14  Martin Baulig  <martin@ximian.com>
9550
9551         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9552
9553         * ecore.cs (IVariable.VerifyFixed): New interface method.
9554
9555         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9556         operator, check whether the variable is actually fixed.  Fixes bug
9557         #36055.  Set a variable definitely assigned when taking its
9558         address as required by the spec.
9559
9560         * statement.cs (LocalInfo.IsFixed): New field.
9561         (LocalInfo.MakePinned): Set `IsFixed' to true.
9562
9563 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9564
9565         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9566         for .ctors, ensure that we only ask for members declared in the
9567         attribute type (BindingFlags.DeclaredOnly).
9568
9569         Fixes bug #43632.
9570
9571         * expression.cs (Error_WrongNumArguments): Report error 1501
9572         correctly the way CSC does.
9573
9574 2003-07-13  Martin Baulig  <martin@ximian.com>
9575
9576         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9577         lookup on the fully qualified name, to make things like "X.X" work
9578         where "X.X" is a fully qualified type name, but we also have a
9579         namespace "X" in the using list.  Fixes #41975.
9580
9581 2003-07-13  Martin Baulig  <martin@ximian.com>
9582
9583         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9584         function. If we're a CompoundAssign, we need to create an embedded
9585         CompoundAssign, not an embedded Assign.
9586         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9587         Fixes #45854.
9588
9589 2003-07-13  Martin Baulig  <martin@ximian.com>
9590
9591         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9592         work to fix bug #46088.
9593
9594 2003-07-13  Ravi Pratap <ravi@ximian.com>
9595
9596         * class.cs (Operator.Emit): Do not emit attributes here - it is
9597         taken care of by the Method class that we delegate too. This takes
9598         care of bug #45876.
9599
9600 2003-07-10  Martin Baulig  <martin@ximian.com>
9601
9602         * expression.cs (TypeOfVoid): New class.
9603         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9604
9605 2003-07-10  Martin Baulig  <martin@ximian.com>
9606
9607         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9608         bug #35957.
9609
9610 2003-07-10  Martin Baulig  <martin@ximian.com>
9611
9612         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9613         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9614
9615         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9616
9617         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9618
9619 2003-07-10  Martin Baulig  <martin@ximian.com>
9620
9621         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9622         of decimal.  Fixes #42850.
9623
9624         NOTE: I also fixed the created byte blob, but this doesn't work on
9625         the MS runtime and csc never produces any byte blobs for decimal
9626         arrays.
9627
9628 2003-07-10  Martin Baulig  <martin@ximian.com>
9629
9630         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9631         structs; fixes #32068.
9632         (Block.AddChildVariableNames): Fixed #44302.
9633
9634 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9635
9636         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9637
9638 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9639
9640         * attribute.cs: And this test is onger needed.
9641
9642 2003-07-08  Martin Baulig  <martin@ximian.com>
9643
9644         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9645         inaccessible types.  Fixes #36313.
9646
9647         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9648
9649         * namespace.cs (NamespaceEntry): Create implicit entries for all
9650         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9651         implicit entries for N1.N2 and N1.
9652
9653 2003-07-08  Martin Baulig  <martin@ximian.com>
9654
9655         Rewrote the handling of namespaces to fix a lot of the issues
9656         wrt. `using' aliases etc.
9657
9658         * namespace.cs (Namespace): Splitted this class into a
9659         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9660
9661         * typemanager.cs (TypeManager.IsNamespace): Removed.
9662         (TypeManager.ComputeNamespaces): Only compute namespaces from
9663         loaded assemblies here, not the namespaces from the assembly we're
9664         currently compiling.
9665
9666 2003-07-08  Martin Baulig  <martin@ximian.com>
9667
9668         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9669
9670 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9671
9672         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9673         already fixed it.  
9674
9675         I thought about the memory savings here, but LookupTypeReflection
9676         is used under already very constrained scenarios.  Compiling
9677         corlib or mcs only exposes one hit, so it would not really reduce
9678         any memory consumption.
9679
9680 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9681
9682         * typemanager.cs: fixes bug #45889 by only adding public types from
9683         other assemblies to the list of known types.
9684
9685 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9686
9687         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9688         on the type we resolved.
9689
9690 2003-07-05  Martin Baulig  <martin@ximian.com>
9691
9692         * pending.cs (PendingImplementation.ParentImplements): Don't
9693         create the proxy if the parent is abstract.
9694
9695         * class.cs (TypeContainer.DefineIndexers): Process explicit
9696         interface implementations first.  Fixes #37714.
9697
9698 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9699
9700         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9701         defined recursively;  but since we modify the input parameters
9702         (left is set to `this' temporarily), we reset this value if the
9703         left_is_explicit is false, which gives the original semantics to
9704         the code.  
9705
9706         * literal.cs (NullPointer): new class used to represent a null
9707         literal in a pointer context.
9708
9709         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9710         type is a pointer, use a NullPointer object instead of a
9711         NullLiteral.   Closes 43687
9712
9713         (ExplicitConversion): Convert pointer values using
9714         the conv opcode to the proper type.
9715
9716         * ecore.cs (New): change ValueTypeVariable property into a method,
9717         that returns whether the valuetype is suitable for being used.
9718
9719         * expression.cs (Binary.DoNumericPromotions): Only return if we
9720         the int constant was a valid uint, and we can return both left and
9721         right as uints.  If not, we continue processing, to trigger the
9722         type conversion.  This fixes 39018.
9723
9724         * statement.cs (Block.EmitMeta): During constant resolution, set
9725         the CurrentBlock property on the emitcontext, so that we resolve
9726         constants propertly.
9727
9728 2003-07-02  Martin Baulig  <martin@ximian.com>
9729
9730         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9731         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9732
9733         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9734         than emitting it here.
9735
9736         * statement.cs: Fixed some more flow analysis bugs.
9737
9738 2003-07-02  Martin Baulig  <martin@ximian.com>
9739
9740         * class.cs (MethodData.Define): When implementing interface
9741         methods, set Final unless we're Virtual.
9742
9743         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9744         check work for interface methods.
9745
9746 2003-07-01  Martin Baulig  <martin@ximian.com>
9747
9748         * ecore.cs (EmitContext.This): Replaced this property with a
9749         GetThis() method which takes a Location argument.  This ensures
9750         that we get the correct error location for a CS0188.
9751
9752 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9753
9754         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9755         ImplicitStandardConversion.
9756
9757         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9758
9759 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9760
9761         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9762         optimization.
9763
9764 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9765
9766         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9767         constructors.
9768
9769         (MethodData.Define): Turn off initlocals for unsafe methods.
9770
9771 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9772
9773         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9774         complete;  Fixes #37521.
9775
9776         * delegate.cs: Use Modifiers.TypeAttr to compute the
9777         TypeAttributes, instead of rolling our own.  This makes the flags
9778         correct for the delegates.
9779
9780 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9781
9782         * class.cs (Constructor.Define): Set the private flag for static
9783         constructors as well.
9784
9785         * cs-parser.jay (statement_expression): Set the return value to
9786         null, to avoid a crash when we catch an error.
9787
9788 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9789
9790         * cs-parser.jay: Applied patch from Jackson that adds support for
9791         extern and unsafe modifiers to destructor declarations.
9792
9793         * expression.cs: Report error 21 if the user is trying to index a
9794         System.Array.
9795
9796         * driver.cs: Add an error message, suggested by the bug report.
9797
9798         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9799         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9800
9801 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9802
9803         * namespace.cs: Add some information to reduce FAQs.
9804
9805 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9806
9807         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9808         underlying enumeration types.  Fixes #43915.
9809
9810         * expression.cs: Treat ushort/short as legal values to be used in
9811         bitwise operations.
9812
9813 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9814
9815         * delegate.cs: transfer custom attributes for paramenters from
9816         the delegate declaration to Invoke and BeginInvoke.
9817
9818 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9819
9820         * attribute.cs: handle custom marshalers and emit marshal info
9821         for fields, too.
9822
9823 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9824
9825         * makefile.gnu: Added anonymous.cs to the compiler sources.
9826
9827 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * iterators.cs: Change the name of the proxy class to include two
9830         underscores.
9831
9832         * cs-parser.jay: Update grammar to include anonymous methods.
9833
9834         * anonymous.cs: new file.
9835
9836 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9837
9838         * class.cs (Field.Define): Add missing test for pointers and
9839         safety. 
9840
9841 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9842
9843         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9844         we use the stobj opcode.
9845
9846         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9847         since it wasn't the correct fix. 
9848
9849         It still is puzzling that we are required to use stobj for IntPtr
9850         which seems to be a ValueType.
9851
9852 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9853
9854         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9855         during regular simple name resolution.   Now, the trick is that
9856         instead of returning for processing the simplename, we do a
9857         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9858         contextual lookup type).   If a match is found, return that, if
9859         not, return for further composition.
9860
9861         This fixes long-standing 30485.
9862
9863         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9864         using the address to initialize an object, do an Stobj instead of
9865         using the regular Stelem.
9866
9867         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9868         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9869         Because if we are a BaseIndexerAccess that value will be true.
9870         Fixes 43643.
9871
9872         * statement.cs (GotoCase.Resolve): Return after reporting an
9873         error, do not attempt to continue. 
9874
9875         * expression.cs (PointerArithmetic.Emit): If our operand is a
9876         long, convert our constants to match the operand before
9877         multiplying.  Convert to I type before adding.   Fixes 43670.
9878
9879 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9880
9881         * enum.cs (ImplicitConversionExists) : Rename to
9882         ImplicitEnumConversionExists to remove ambiguity. 
9883
9884         * ecore.cs (NullCast): New type of cast expression class which
9885         basically is very similar to EmptyCast with the difference being
9886         it still is a constant since it is used only to cast a null to
9887         something else
9888         (eg. (string) null)
9889
9890         * convert.cs (ImplicitReferenceConversion): When casting a null
9891         literal, we return a NullCast.
9892
9893         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9894         should be around anymore.
9895
9896         The renaming (reported was slightly wrong). Corrections:
9897
9898         ConvertImplicitStandard -> ImplicitConversionStandard
9899         ConvertExplicitStandard -> ExplicitConversionStandard
9900
9901         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9902         before passing them in !
9903
9904         * convert.cs (ImplicitConversionStandard): When comparing for
9905         equal expr and target types, ensure that expr is not a
9906         NullLiteral.
9907
9908         In general, we must not be checking (expr_type ==
9909         target_type) in the top level conversion methods
9910         (ImplicitConversion, ExplicitConversion etc). This checking is
9911         done in the methods that they delegate to.
9912
9913 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9914
9915         * convert.cs: Move Error_CannotConvertType,
9916         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9917         ImplicitNumericConversion, ImplicitConversionExists,
9918         ImplicitUserConversionExists, StandardConversionExists,
9919         FindMostEncompassedType, FindMostSpecificSource,
9920         FindMostSpecificTarget, ImplicitUserConversion,
9921         ExplicitUserConversion, GetConversionOperators,
9922         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9923         TryImplicitIntConversion, Error_CannotConvertImplicit,
9924         ConvertImplicitRequired, ConvertNumericExplicit,
9925         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9926         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9927         its own file.
9928
9929         Perform the following renames:
9930
9931         StandardConversionExists -> ImplicitStandardConversionExists
9932         ConvertImplicit -> ImplicitConversion
9933         ConvertImplicitStandard -> ImplicitStandardConversion
9934         TryImplicitIntConversion -> ImplicitIntConversion
9935         ConvertImplicitRequired -> ImplicitConversionRequired
9936         ConvertNumericExplicit -> ExplicitNumericConversion
9937         ConvertReferenceExplicit -> ExplicitReferenceConversion
9938         ConvertExplicit -> ExplicitConversion
9939         ConvertExplicitStandard -> ExplicitStandardConversion
9940
9941 2003-05-19  Martin Baulig  <martin@ximian.com>
9942
9943         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9944         (TypeInfo): Added support for structs having structs as fields.
9945
9946         * ecore.cs (FieldExpr): Implement IVariable.
9947         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9948         VariableInfo for the field.
9949
9950 2003-05-18  Martin Baulig  <martin@ximian.com>
9951
9952         * expression.cs (This.DoResolve): Report a CS0027 if we're
9953         emitting a field initializer.
9954
9955 2003-05-18  Martin Baulig  <martin@ximian.com>
9956
9957         * expression.cs (This.ResolveBase): New public function.
9958         (This.DoResolve): Check for CS0188.
9959
9960         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9961         This.Resolve().
9962
9963         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9964         `instance_expression' to null if we don't have any non-static
9965         methods.
9966
9967 2003-05-18  Martin Baulig  <martin@ximian.com>
9968
9969         Reworked the way how local variables and parameters are handled by
9970         the flow analysis code.
9971
9972         * statement.cs (TypeInfo, VariableMap): New public classes.
9973         (VariableInfo): New public class.  This is now responsible for
9974         checking whether a variable has been assigned.  It is used for
9975         parameters and local variables.
9976         (Block.EmitMeta): Take the InternalParameters as argument; compute
9977         the layout of the flow vectors here.
9978         (Block.LocalMap, Block.ParameterMap): New public properties.
9979         (FlowBranching): The .ctor doesn't get the InternalParameters
9980         anymore since Block.EmitMeta() now computes the layout of the flow
9981         vector.
9982         (MyStructInfo): This class is now known as `StructInfo' and nested
9983         in `TypeInfo'; we don't access this directly anymore.
9984
9985         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9986         property and removed IsAssigned(), IsFieldAssigned(),
9987         SetAssigned() and SetFieldAssigned(); we now call them on the
9988         VariableInfo so we don't need to duplicate this code everywhere.
9989
9990         * expression.cs (ParameterReference): Added `Block block' argument
9991         to the .ctor.
9992         (LocalVariableReference, ParameterReference, This): The new
9993         VariableInfo class is now responsible for all the definite
9994         assignment stuff.
9995
9996         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9997         IsParameterAssigned, SetParameterAssigned): Removed.
9998
9999 2003-05-18  Martin Baulig  <martin@ximian.com>
10000
10001         * typemanager.cs (InitCoreTypes): Try calling
10002         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10003         the 3-args-version.  Corlib now also needs our `void_type'.
10004         (GetMethod): Added overloaded version which takes an optional
10005         `bool report_errors' to allow lookups of optional methods.
10006
10007 2003-05-12  Martin Baulig  <martin@ximian.com>
10008
10009         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10010         only used for locals and not for parameters.
10011
10012 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10013
10014         * support.cs (InternalParameters.ParameterType): Return the
10015         ExternalType of the parameter.
10016
10017         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10018         they were unused.
10019
10020 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10021
10022         * class.cs (MethodData.Define): Do not set the `newslot' on
10023         interface members, if they are also flagged as "override".
10024
10025         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10026         better code for ++i and i++.  This only works for static fields
10027         and local variables.
10028
10029         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10030         want to pull the DeclSpace out of the builder_to_declspace instead
10031         of the TypeBuilder (like in TypeContainer.FindMembers).
10032
10033         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10034         instead of LookupTypeContainer.  Fixes the crash on .NET for
10035         looking up interface members.
10036
10037         * const.cs: Create our own emit context during the Definition
10038         stage, so that constants are evaluated in the proper context, when
10039         a recursive definition happens.
10040
10041 2003-05-11  Martin Baulig  <martin@ximian.com>
10042
10043         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10044         new block for a switch section.
10045         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10046         the adding/lookup in the switch block.  Fixes #39828.
10047
10048 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10049
10050         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10051         functionality: I needed to convert the data after I had performed
10052         the add/sub operation into the operands type size.
10053
10054         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10055         pass the type for the box operation, otherwise the resulting
10056         object would have been of type object.
10057
10058         (BoxedCast): Add constructor to specify the type to box as.
10059
10060 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10061
10062         * iterators.cs: I was reusing the `count' variable inadvertently,
10063         take steps to not allow this to happen.
10064
10065 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10066
10067         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10068         by creating an array at the point where the params starts and
10069         putting all those arguments there, then adjusting the size of the
10070         array.
10071
10072 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10073
10074         * expression.cs (New.AddressOf): Implement interface
10075         IMemoryLocation.  This is used when the `new' operator is used in
10076         the context of an invocation to a method on a value type.
10077
10078         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10079         example. 
10080
10081         * namespace.cs: Also check the using aliases here.
10082
10083         * driver.cs: Move the test for using validity after the types have
10084         been entered, so we do a single pass that also includes the using
10085         aliases. 
10086
10087         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10088         in the regular case.   CreateSiblingForFinally is doing extra
10089         error checking.
10090
10091         * attribute.cs (GetAttributeArgumentExpression): Store the result
10092         on an out value, and use the return value to indicate failure
10093         instead of using null (which is a valid return for Constant.GetValue).
10094
10095         * statement.cs: Perform the analysis flow for the increment
10096         portion after the statement, because this will be the real flow of
10097         execution.  Fixes #42385
10098
10099         * codegen.cs (EmitContext.EmitArgument,
10100         EmitContext.EmitStoreArgument): New helper functions when the
10101         RemapToProxy flag is set.
10102
10103         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10104         function.
10105
10106         Add support for remapping parameters. 
10107
10108         * iterators.cs: Propagate parameter values;  Store parameter
10109         values in the proxy classes.
10110
10111 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10112
10113         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10114         need a proxy reference;  I do not know what I was thinking
10115
10116         * cs-parser.jay (constructor_initializer): catch another error,
10117         and display nice message.
10118
10119         (field_declaration): catch void field declaration
10120         to flag a better error. 
10121
10122         * class.cs (MemberBase.CheckBase): Report an error instead of a
10123         warning if a new protected member is declared in a struct. 
10124         (Field.Define): catch the error of readonly/volatile.
10125
10126         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10127
10128         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10129         volatile variable is taken
10130
10131 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10132
10133         * statement.cs (Fixed.Resolve): Report an error if we are not in
10134         an unsafe context.
10135
10136 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10137
10138         * typemanager.cs: reuse the code that handles type clashes for
10139         delegates and enumerations.
10140
10141         * class.cs (Report28): Always report.
10142
10143         * expression.cs (EncodeAsAttribute): Allow nulls here.
10144
10145 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10146
10147         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10148         the functionality for testing whether an expression is valid for
10149         an attribute here.  Also handle the case of arrays of elements
10150         being stored. 
10151
10152         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10153         encoding a linear array into an array of objects that are suitable
10154         to be passed to an CustomAttributeBuilder.
10155
10156         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10157
10158         * ecore.cs: (FieldExpr): Handle field remapping here.
10159
10160         * iteratators.cs: Pass the instance variable (if the method is an
10161         instance method) to the constructors, so we can access the field
10162         variables on the class.
10163
10164         TODO: Test this with structs.  I think the THIS variable on
10165         structs might have to be a pointer, and not a refenrece
10166
10167 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10168
10169         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10170         local variables to fields in a proxy class.
10171
10172         * iterators.cs (PopulateProxy): Rename our internal fields to
10173         <XXX>.  
10174         Create a <THIS> field if we are an instance method, so we can
10175         reference our parent container variables.
10176         (MapVariable): Called back from the EmitContext code to enter a
10177         new variable to field mapping into the proxy class (we just create
10178         a FieldBuilder).
10179
10180         * expression.cs
10181         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10182         for using the remapped locals to fields.
10183
10184         I placed the code here, because that gives the same semantics to
10185         local variables, and only changes the Emit code.
10186
10187         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10188         statements inside iterators.
10189         (VariableInfo): Add a FieldBuilder for the cases when we are
10190         remapping local variables to fields in a proxy class
10191
10192         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10193         current_block != null.
10194
10195         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10196         not cope with strings, as it has been moved to the
10197         TableSwitchEmit.  Fixed bug in switch generation.
10198
10199         * expression.cs (New.DoResolve): Provide more context for the user
10200         when reporting an error.
10201
10202         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10203         pointers. 
10204
10205         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10206         check the permissions for it.  Note than in a type-resolution
10207         context the check was already present in DeclSpace.ResolveType,
10208         but was missing from the MemberAccess.
10209
10210         (ArrayCreation.CheckIndices): warn if the user has
10211         more nested levels of expressions, but there are no more
10212         dimensions specified.  Avoids crash on bug 41906.
10213
10214 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10215
10216         * statement.cs (Block): replace Implicit bool, for a generic
10217         flags.   
10218         New flag: `Unchecked'.  This is used during the EmitMeta phase
10219         (which is out-of-line with the regular Resolve/Emit process for a
10220         statement, as this is done ahead of time, but still gets a chance
10221         to call constant resolve).
10222
10223         (Block.Flags): new enum for adding a new flag.
10224
10225         (Block.EmitMeta): track the state of unchecked.
10226
10227         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10228         to enable constant resolution to work there as well.
10229
10230 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10231
10232         * typemanager.cs (ienumerable_type): Also look up
10233         System.Collections.IEnumerable. 
10234
10235 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10236
10237         TODO: Test more than one conditional per method.
10238
10239         * class.cs (Indexer.Define): Report the location where the user is
10240         referencing the unsupported feature.
10241
10242         (MethodData): Overload the use of `conditionals' to
10243         minimize the creation of needless ArrayLists.   This saves roughly
10244         212kb on my machine.
10245
10246         (Method): Implement the new IIteratorContainer interface.
10247         (Method.SetYields): Implement the method by setting the ModFlags
10248         to contain METHOD_YIELDS.
10249
10250         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10251         which just got set to null.
10252
10253         * iterators.cs: New file.
10254
10255         (Yield, YieldBreak): New statements.
10256
10257         * statement.cs (Return.Resolve): Flag an error if we are used in
10258         an iterator method.
10259
10260         * codegen.cs (InIterator): New flag set if the code is being
10261         compiled in an iterator method.
10262
10263         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10264         internal modifier, and we just use it to avoid adding extra
10265         fields, as this is seldom used.  
10266
10267         * cs-parser.jay: Add yield_statement (yield and yield break).
10268
10269         * driver.cs: New flag -v2 to turn on version 2 features. 
10270
10271         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10272         hashtable when v2 is enabled.
10273
10274 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10275
10276         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10277         there is already a namespace defined with this name.
10278
10279         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10280         people upgraded their corlibs.
10281
10282         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10283         always use fully qualified types, no need to use the compiler
10284         front end.
10285
10286         (TypeManager.IsNamespace): Use binarysearch.
10287
10288         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10289         AddDelegate): I did not quite use the new IsValid API properly: I
10290         have to pass the short-name and the fullname.  I was passing only
10291         the basename instead of the fullname sometimes. 
10292
10293         (TypeContainer.DefineType): call NamespaceClash.
10294
10295         * interface.cs (Interface.DefineType): use NamespaceClash before
10296         defining the type.
10297
10298         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10299         defining the type.
10300
10301         * enum.cs: (Enum.DefineType): use NamespaceClash before
10302         defining the type.
10303
10304         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10305         speed increase.  First, use the negative_hits cache when we get a
10306         negative.  Second, add the type with its full original name
10307         instead of the new . and + encoded name (reflection uses + to
10308         separate type from a nested type).  Use LookupTypeReflection
10309         directly which bypasses the type->name hashtable (that we already
10310         know does not contain the type.
10311
10312         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10313         location/container type. 
10314
10315         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10316
10317 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10318
10319         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10320
10321         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10322         method is being referenced in the method group from a static
10323         context, and report error 120 if so.
10324
10325         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10326         Error118. 
10327
10328         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10329         is created, we create the A namespace).
10330
10331         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10332         Fixes #41591
10333
10334 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10335
10336         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10337         invocation to ModuleBuilder.GetType with the same values will
10338         return a new type instance, so we need to cache its return
10339         values. 
10340
10341         * expression.cs (Binary.ResolveOperator): Only allow the compare
10342         operators on enums if they are of the same type.
10343
10344         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10345         types of ValueType on their own case.  Before we were giving them
10346         the same treatment as objects.
10347
10348         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10349         fullname.  Short name is used to compare against container name.
10350         Fullname is used to check against defined namespace names.
10351
10352         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10353         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10354
10355         (Method.CheckBase): Call parent.
10356         (MemberBase.CheckBase): Check for protected members on sealed
10357         classes.
10358         (PropertyBase.CheckBase): Call parent.
10359         (Field.Define): Call parent.
10360
10361         * report.cs: Negative error codes are now mapped to 8000 - code,
10362         so that the display is render more nicely.
10363
10364         * typemanager.cs: Do not use try/catch, instead report a regular
10365         error. 
10366
10367         (GetPointerType, GetReferenceType): These methods provide
10368         mechanisms to obtain the T* and T& from a T.  We had the code
10369         previously scattered around the code base, and it also used
10370         TypeManager.LookupType that would go through plenty of caches.
10371         This one goes directly to the type source.
10372
10373         In some places we did the Type.GetType followed by
10374         ModuleBuilder.GetType, but not in others, so this unifies the
10375         processing as well.
10376
10377         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10378         statements now that we have namespace information.
10379
10380         * typemanager.cs (IsNamespace): New method, returns whether the
10381         string presented is a namespace or not.
10382
10383         (ComputeNamespaces): New public entry point, computes the list of
10384         available namespaces, using the GetNamespaces API call in Mono, or
10385         the slower version in MS.NET.   
10386
10387         Now before we start the semantic analysis phase, we have a
10388         complete list of namespaces including everything that the user has
10389         provided.
10390
10391         Deleted old code to cache namespaces in .nsc files.
10392
10393 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10394
10395         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10396         class/struct location definition Location for the implicit
10397         constructor location.
10398
10399         (Operator.Define): Use the location of the operator for the
10400         implicit Method definition.
10401
10402         (Constructor.Emit): use the constructor location for the implicit
10403         base initializer constructor.
10404
10405         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10406         and the Expression class now contains two new methods:
10407
10408         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10409         isolate type lookup from the rest of the resolution process.
10410
10411         Since we use Expressions to hold type definitions due to the way
10412         we parse the input we have historically overloaded Resolve to
10413         perform the Type lookups if a special flag is passed.  Now this is
10414         eliminated and two methods take their place. 
10415
10416         The differences in the two methods between xStep and xTerminal is
10417         that xStep is involved in our current lookup system that uses
10418         SimpleNames to compose a name, while xTerminal is used just to
10419         catch the case where the simplename lookup failed.
10420
10421 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10422
10423         * expression.cs (ResolveMemberAccess): Remove redundant code.
10424         TypeExpr expressions are always born fully resolved.
10425
10426         * interface.cs (PopulateMethod): Do not lookup the types twice.
10427         We were doing it once during SemanticAnalysis and once during
10428         PopulateMethod.
10429
10430         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10431         in local variable type definitions, were being returned as a
10432         SimpleName (we decomposed everything into a string), that is
10433         because primary_expression was being used instead of a type in the
10434         grammar (reduce/reduce conflicts).
10435
10436         The part that was wrong is that we converted the expression into a
10437         string (an oversimplification in one hand, compounded with primary
10438         expressions doing string concatenation).
10439
10440         So things like:
10441
10442         A.B.C [] x;
10443
10444         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10445         using clauses from working on this particular context.  And a type
10446         was being matched directly against "A.B.C[]".
10447
10448         We now use the correct approach, and allow for ComposedCast to be
10449         part of the unary expression.  So the "A.B.C []" become a composed
10450         cast of "A.B.C" (as a nested group of MemberAccess with a
10451         SimpleName at the end) plus the rank composition "[]". 
10452
10453         Also fixes 35567
10454
10455 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10456
10457         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10458         for the access level checking.
10459
10460         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10461         `TypeContainer container', because I kept getting confused when I
10462         was debugging this code.
10463
10464         * expression.cs (Indexers): Instead of tracking getters/setters,
10465         we now track them in parallel.  We create one arraylist less, but
10466         most importantly it is possible now for the LValue code to find a
10467         matching get for a set.
10468
10469         (IndexerAccess.DoResolveLValue): Update the code.
10470         GetIndexersForType has been modified already to extract all the
10471         indexers from a type.  The code assumed it did not.
10472
10473         Also make the code set the correct return type for the indexer.
10474         This was fixed a long time ago for properties, but was missing for
10475         indexers.  It used to be void_type.
10476
10477         (Binary.Emit): Test first for doubles instead of
10478         floats, as they are more common.
10479
10480         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10481         when dealing with floats and the <=, >= operators.  This fixes bug
10482         #39314 
10483
10484         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10485         to load the array value by emitting a load on the foreach variable
10486         type.  This was incorrect.  
10487
10488         We now emit the code to load an element using the the array
10489         variable type, and then we emit the conversion operator.
10490
10491         Fixed #40176
10492
10493 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10494
10495         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10496
10497 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10498
10499         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10500         test for protection before we test for signatures. 
10501
10502         (MethodSignature.ToString): implement.
10503
10504         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10505         to the case where we reduced into a LongConstant.
10506
10507         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10508         depend on whether the information is acurrate, because the
10509         Microsoft runtime will always claim that the array type is public,
10510         regardless of the real state.
10511
10512         If the type is a pointer, another problem happens: the type is
10513         reported as non-public in Microsoft.  
10514
10515         In both cases we have to call CheckAccessLevel recursively with
10516         the underlying type as the argument to be tested.
10517
10518 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10519
10520         * assign.cs (Assign.Emit): If we are dealing with a compound
10521         assignment expression, we should use the code path that stores the
10522         intermediate result in a temporary value.  This fixes #40903.
10523
10524         *expression.cs (Indirection.ToString): Provide ToString method for
10525         debugging. 
10526
10527 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10528
10529         * class.cs: Null out fields holding references to Block objects so
10530         they can be garbage collected.
10531
10532         * expression.cs (OverloadResolve): Remove unused local.
10533
10534 2003-04-07  Martin Baulig  <martin@ximian.com>
10535
10536         * codegen.cs (EmitContext.CurrentFile): New public field.
10537         (EmitContext.Mark): Use the CurrentFile to check whether the
10538         location is in the correct file.
10539         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10540
10541 2003-04-07  Martin Baulig  <martin@ximian.com>
10542
10543         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10544
10545         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10546         location.  [FIXME: The location argument which gets passed to this
10547         method is sometimes wrong!]
10548
10549 2003-04-07  Nick Drochak <ndrochak@gol.com>
10550
10551         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10552
10553 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10554
10555         * expression.cs (Indirection.EmitAssign): We were using the
10556         temporary, but returning immediately instead of continuing the
10557         EmitAssing flow.
10558
10559 2003-04-06  Martin Baulig  <martin@ximian.com>
10560
10561         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10562         if it's a nested child, but also deriving from the outer class.
10563         See test 190.cs.
10564
10565         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10566         nested child, but also deriving from the outer class.  See
10567         test-190.cs.
10568         (FilterWithClosure): We may access private members of the outer
10569         class if we're a nested child and deriving from the outer class.
10570         (RealMemberLookup): Only set `closure_private_ok' if the
10571         `original_bf' contained BindingFlags.NonPublic.
10572
10573 2003-04-05  Martin Baulig  <martin@ximian.com>
10574
10575         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10576
10577 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10578
10579         * class.cs (Event.Define): Do not allow abstract events to have
10580         initializers. 
10581
10582 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10583
10584         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10585         block in event declarations.
10586
10587         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10588         value type, get its address.
10589
10590         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10591         leaving a class on the stack instead of a boolean value (int
10592         0/1).  Change the code so we compare against null, and then the
10593         result against zero.
10594
10595         * class.cs (TypeContainer.GetClassBases): We were checking for the
10596         parent class being sealed too late.
10597
10598         * expression.cs (Binary.Emit): For <= and >= when dealing with
10599         floating point values, use cgt.un and clt.un instead of cgt and
10600         clt alone.
10601
10602 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10603
10604         * statement.cs: Apply the same optimization as MS: skip the 
10605         GetEnumerator returning an IEnumerator, and use the one returning a 
10606         CharEnumerator instead. This allows us to avoid the try-finally block 
10607         and the boxing.
10608
10609 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10610
10611         * cs-parser.jay: Attributes cannot be applied to
10612                          namespaces. Fixes #40473
10613
10614 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10615
10616         * class.cs:
10617         (Add*): check if the name is valid using the full name for constants,
10618         fields, properties and events.
10619
10620 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10621
10622         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10623         char constants to be part of the enumeration.
10624
10625         * expression.cs (Conditional.DoResolve): Add support for operator
10626         true. Implements the missing functionality from 14.12
10627
10628         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10629         operator true/false as required by the spec.
10630
10631         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10632         implicit conversion to boolean.
10633
10634         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10635         also one where the type implements `operator true'. 
10636
10637         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10638         get an expression that will invoke operator true based on an
10639         expression.  
10640
10641         (GetConversionOperators): Removed the hack that called op_True
10642         here.  
10643
10644         (Expression.ResolveBoolean): Move this from Statement.
10645
10646 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10647
10648         * ecore.cs (FieldExpr): do not allow initialization of initonly
10649         fields on derived classes
10650
10651 2003-03-13  Martin Baulig  <martin@ximian.com>
10652
10653         * statement.cs (Block.Emit): Call ig.BeginScope() and
10654         ig.EndScope() when compiling with debugging info; call
10655         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10656
10657 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10658
10659         * expression.cs (Indexers): Do not construct immediately, allow
10660         for new members to be appended as we go.  Fixes 38143
10661
10662 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10663
10664         * expression.cs: save/restore context when resolving an unchecked
10665         expression.
10666
10667 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10668
10669         * cfold.cs: Catch division by zero in modulus operator during
10670         constant folding.
10671
10672 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10673
10674         * interface.cs (Interface.DefineMembers): Avoid defining members
10675         twice. 
10676
10677 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * driver.cs: handle the +/- options for -noconfig
10680
10681         * statement.cs (Unckeched.Resolve): Also track the state of
10682         unchecked in the Resolve phase.
10683
10684 2003-02-27  Martin Baulig  <martin@ximian.com>
10685
10686         * ecore.cs (Expression.MemberLookup): Don't create a
10687         MethodGroupExpr for something which is not a method.  Fixes #38291.
10688
10689 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10690
10691         * class.cs (MemberBase.CheckParameters): Also check that the type
10692         is unmanaged if it is a pointer.
10693
10694         * expression.cs (SizeOf.Resolve): Add location information.
10695
10696         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10697         a managed type is declared.
10698
10699         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10700         parameter modifiers as well.  Fixes bug 38606
10701
10702         * class.cs: Very sad.  Am backing out the speed up changes
10703         introduced by the ArrayList -> Array in the TypeContainer, as they
10704         were not actually that much faster, and introduced a bug (no error
10705         reports on duplicated methods).
10706
10707         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10708         source first, this will guarantee that we have a valid expression
10709         before calling in lower levels functions that will require a
10710         resolved object.  Then use this original_source in the
10711         target.ResolveLValue instead of the original source that was
10712         passed to us.
10713
10714         Another change.  Use target.Resolve instead of LValueResolve.
10715         Although we are resolving for LValues, we will let the Assign code
10716         take care of that (it will be called again from Resolve).  This
10717         basically allows code like this:
10718
10719         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10720         class Y { void A (X x) { x [0] += o; }
10721
10722         The problem was that the indexer was trying to resolve for
10723         set_Item (idx, object o) and never finding one.  The real set_Item
10724         was set_Item (idx, X).  By delaying the process we get the right
10725         semantics. 
10726
10727         Fixes bug 36505
10728
10729 2003-02-23  Martin Baulig  <martin@ximian.com>
10730
10731         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10732         while calling DoEmit ().
10733
10734         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10735         source files; if you use the #line directive inside a method, the
10736         compiler stops emitting line numbers for the debugger until it
10737         reaches the end of the method or another #line directive which
10738         restores the original file.
10739
10740 2003-02-23  Martin Baulig  <martin@ximian.com>
10741
10742         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10743
10744 2003-02-23  Martin Baulig  <martin@ximian.com>
10745
10746         * statement.cs (Block.AddChildVariableNames): We need to call this
10747         recursively, not just for our immediate children.
10748
10749 2003-02-23  Martin Baulig  <martin@ximian.com>
10750
10751         * class.cs (Event.Define): Always make the field private, like csc does.
10752
10753         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10754         actually work, fixes bug #37521.
10755
10756 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10757
10758         * delegate.cs: When creating the various temporary "Parameters"
10759         classes, make sure that we call the ComputeAndDefineParameterTypes
10760         on those new parameters (just like we do with the formal ones), to
10761         allow them to be resolved in the context of the DeclSpace.
10762
10763         This fixes the bug that Dick observed in Bugzilla #38530.
10764
10765 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10766
10767         * expression.cs (ResolveMemberAccess): When resolving a constant,
10768         do not attempt to pull a constant if the value was not able to
10769         generate a valid constant.
10770
10771         * const.cs (LookupConstantValue): Do not report more errors than required.
10772
10773 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10774
10775         * expression.cs: fixes bug #38328.
10776
10777 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10778
10779         * class.cs: Changed all the various members that can be part of a
10780         class from being an ArrayList to be an Array of the right type.
10781         During the DefineType type_list, interface_list, delegate_list and
10782         enum_list are turned into types, interfaces, delegates and enums
10783         arrays.  
10784
10785         And during the member population, indexer_list, event_list,
10786         constant_list, field_list, instance_constructor_list, method_list,
10787         operator_list and property_list are turned into their real arrays.
10788
10789         Although we could probably perform this operation earlier, for
10790         good error reporting we need to keep the lists and remove the
10791         lists for longer than required.
10792
10793         This optimization was triggered by Paolo profiling the compiler
10794         speed on the output of `gen-sample-program.pl' perl script. 
10795
10796         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10797         not crash in methods like MemberLookupFailed that use this field.  
10798
10799         This problem arises when the compiler fails to resolve a type
10800         during interface type definition for example.
10801
10802 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10803
10804         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10805         inherit from System.Object, so we have to stop at null, not only
10806         when reaching System.Object.
10807
10808 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10809
10810         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10811         DeclaredOnly because the parent indexer might have had a different
10812         name, but did not loop until the top of the hierarchy was reached.
10813
10814         The problem this one fixes is 35492: when a class implemented an
10815         indexer from an interface, we were getting the interface method
10816         (which was abstract) and we were flagging an error (can not invoke
10817         abstract method).
10818
10819         This also keeps bug 33089 functioning, and test-148 functioning.
10820
10821         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10822         out if a method is special is to see if it is declared in a
10823         property or event, or whether it is one of the predefined operator
10824         names.   This should fix correctly #36804.
10825
10826 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10827
10828         The goal here is to remove the dependency on EmptyCast.Peel ().
10829         Killing it completely.
10830
10831         The problem is that currently in a number of places where
10832         constants are expected, we have to "probe" for an EmptyCast, and
10833         Peel, which is not the correct thing to do, as this will be
10834         repetitive and will likely lead to errors. 
10835
10836         The idea is to remove any EmptyCasts that are used in casts that
10837         can be reduced to constants, so we only have to cope with
10838         constants. 
10839
10840         This bug hunt was triggered by Bug 37363 and the desire to remove
10841         the duplicate pattern where we were "peeling" emptycasts to check
10842         whether they were constants.  Now constants will always be
10843         constants.
10844
10845         * ecore.cs: Use an enumconstant here instead of wrapping with
10846         EmptyCast.  
10847
10848         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10849         throwing me off.  By handling this we can get rid of a few hacks.
10850
10851         * statement.cs (Switch): Removed Peel() code.
10852
10853 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10854
10855         * class.cs: Location information for error 508
10856
10857         * expression.cs (New.DoResolve): Add a guard against double
10858         resolution of an expression.  
10859
10860         The New DoResolve might be called twice when initializing field
10861         expressions (see EmitFieldInitializers, the call to
10862         GetInitializerExpression will perform a resolve on the expression,
10863         and later the assign will trigger another resolution
10864
10865         This leads to bugs (#37014)
10866
10867         * delegate.cs: The signature for EndInvoke should contain any ref
10868         or out parameters as well.  We were not doing this in the past. 
10869
10870         * class.cs (Field.Define): Do not overwrite the type definition
10871         inside the `volatile' group.  Turns out that volatile enumerations
10872         were changing the type here to perform a validity test, which
10873         broke conversions. 
10874
10875 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10876
10877         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10878         and structs, we do not want to load the instance variable
10879
10880         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10881         enum_type has to be handled like an object reference (implicit
10882         conversions exists from this to object), but the regular IsClass
10883         and IsValueType tests will never return true for this one.
10884
10885         Also we use TypeManager.IsValueType instead of type.IsValueType,
10886         just for consistency with the rest of the code (this is only
10887         needed if we ever use the construct exposed by test-180.cs inside
10888         corlib, which we dont today).
10889
10890 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10891
10892         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10893         just InternalCall.
10894
10895 2003-02-09  Martin Baulig  <martin@ximian.com>
10896
10897         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10898         (Namespace.DefineNamespaces): New static public method; this is
10899         called when we're compiling with debugging to add all namespaces
10900         to the symbol file.
10901
10902         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10903         pass it to the Namespace's .ctor.
10904
10905         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10906         and MethodBase arguments; pass the namespace ID to the symwriter;
10907         pass the MethodBase instead of the token to the symwriter.
10908         (SymbolWriter.DefineNamespace): New method to add a namespace to
10909         the symbol file.
10910
10911 2003-02-09  Martin Baulig  <martin@ximian.com>
10912
10913         * symbolwriter.cs: New file.  This is a wrapper around
10914         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10915         methods here in near future.
10916
10917 2003-02-09  Martin Baulig  <martin@ximian.com>
10918
10919         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10920         ILGenerator.MarkSequencePoint() which are actually used by the
10921         symbol writer.
10922
10923 2003-02-09  Martin Baulig  <martin@ximian.com>
10924
10925         * location.cs (SourceFile): New public sealed class.  This
10926         contains the name and an index which is used in the location's token.
10927         (Location): Reserve an appropriate number of bits in the token for
10928         the source file instead of walking over that list, this gives us a
10929         really huge performance improvement when compiling with debugging.
10930
10931         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10932         `SourceFile' argument instead of a string.
10933         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10934         but don't parse/tokenize here, we need to generate the list of all
10935         source files before we do that.
10936         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10937         the files.
10938
10939         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10940         instead of a string.
10941
10942         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10943         of a string.
10944
10945 2003-02-09  Martin Baulig  <martin@ximian.com>
10946
10947         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10948         filename on `#line default'.
10949
10950 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10951
10952         * statement.cs: don't clear the pinned var when the fixed statement
10953         returns from the method (fixes bug#37752).
10954
10955 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10956
10957         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10958         to IsValueType.
10959
10960 2003-02-07  Martin Baulig  <martin@ximian.com>
10961
10962         * driver.cs: Removed the `--debug-args' command line argument.
10963
10964         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10965         automatically by the AsssemblyBuilder.
10966         (CodeGen.InitializeSymbolWriter): We don't need to call any
10967         initialization function on the symbol writer anymore.  This method
10968         doesn't take any arguments.
10969
10970 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10971
10972         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10973         from referenced assemblies as well.
10974
10975 2003-02-02  Martin Baulig  <martin@ximian.com>
10976
10977         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10978
10979 2003-02-02  Martin Baulig  <martin@ximian.com>
10980
10981         * class.cs (Constructor.Emit): Open the symbol writer before
10982         emitting the constructor initializer.
10983         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10984         single-stepping through constructor initializers.
10985
10986 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10987
10988         * class.cs: Handle error 549: do not allow virtual methods in
10989         sealed classes. 
10990
10991 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10992
10993         * decl.cs: Check access levels when resolving types
10994
10995 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10996
10997         * statement.cs: Add parameters and locals set in catch blocks that might 
10998         return to set vector
10999
11000 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11001
11002         * class.cs (Operator): Set the SpecialName flags for operators.
11003
11004         * expression.cs (Invocation.DoResolve): Only block calls to
11005         accessors and operators on SpecialName methods.
11006
11007         (Cast.TryReduce): Handle conversions from char constants.
11008
11009
11010 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11011
11012         * statement.cs: small memory and time optimization in FlowBranching.
11013
11014 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11015
11016         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11017         problem that the last fix but in the other sid (Set).
11018
11019         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11020         access when there is no indexer in the hierarchy.
11021
11022 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11023
11024         * class.cs: Combine some if statements.
11025
11026 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11027
11028         * driver.cs: fixed bug #37187.
11029
11030 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11031
11032         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11033         any indexer, it's needed to build a list with all the indexers in the
11034         hierarchy (AllGetters), else we have problems. Fixes #35653.
11035
11036 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11037
11038         * class.cs (MethodData.Define): It is wrong for an interface
11039         implementation to be static in both cases: explicit and implicit.
11040         We were only handling this in one case.
11041
11042         Improve the if situation there to not have negations.
11043
11044         * class.cs (Field.Define): Turns out that we do not need to check
11045         the unsafe bit on field definition, only on usage.  Remove the test.
11046
11047 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11048
11049         * driver.cs: use assembly.Location instead of Codebase (the latest
11050         patch made mcs fail when using MS assemblies).
11051
11052 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11053
11054         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11055         get the path to *corlib.dll.
11056
11057 2003-01-21  Nick Drochak <ndrochak@gol.com>
11058
11059         * cs-tokenizer.cs:
11060         * pending.cs:
11061         * typemanager.cs: Remove compiler warnings
11062
11063 2003-01-20  Duncan Mak  <duncan@ximian.com>
11064
11065         * AssemblyInfo.cs: Bump the version number to 0.19.
11066
11067 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11068
11069         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11070
11071 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11072
11073         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11074
11075 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * cs-parser.jay: Small fix: we were not comparing the constructor
11078         name correctly.   Thanks to Zoltan for the initial pointer.
11079
11080 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11081
11082         * cs-tokenizer.cs: Set file name when specified with #line
11083
11084 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11085
11086         * cs-parser.jay: Only perform the constructor checks here if we
11087         are named like the class;  This will help provider a better
11088         error.  The constructor path is taken when a type definition is
11089         not found, but most likely the user forgot to add the type, so
11090         report that rather than the constructor error.
11091
11092 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11093
11094         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11095         allocations.
11096
11097 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11098
11099         * cs-parser.jay: Add cleanup call.
11100
11101 2003-01-13  Duncan Mak  <duncan@ximian.com>
11102
11103         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11104         consistent with other methods.
11105
11106 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11107
11108         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11109
11110 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11111
11112         * attribute.cs: only set GuidAttr to true when we have a
11113         GuidAttribute.
11114
11115 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11116
11117         * ecore.cs:
11118         * expression.cs:
11119         * typemanager.cs: fixes to allow mcs compile corlib with the new
11120         Type.IsSubclassOf fix.
11121
11122 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11123
11124         * expression.cs (LocalVariableReference.DoResolve): Classify a
11125         constant as a value, not as a variable.   Also, set the type for
11126         the variable.
11127
11128         * cs-parser.jay (fixed_statement): take a type instead of a
11129         pointer_type, so we can produce a better error message later.
11130
11131         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11132         as an error.  
11133
11134         (For.DoEmit): Make inifinite loops have a
11135         non-conditional branch back.
11136
11137         (Fixed.DoEmit): First populate the pinned variables, then emit the
11138         statement, then clear the variables.  Before I was emitting the
11139         code once for each fixed piece.
11140
11141
11142 2003-01-08  Martin Baulig  <martin@ximian.com>
11143
11144         * statement.cs (FlowBranching.MergeChild): A break in a
11145         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11146
11147 2003-01-08  Martin Baulig  <martin@ximian.com>
11148
11149         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11150         lives in the same number space than `param_map'.  Fixes #36154.
11151
11152 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11153
11154         * cs-parser.jay (constructor_declaration): Set the
11155         Constructor.ModFlags before probing for it.  This makes the
11156         compiler report 514, 515 and 132 (the code was there, but got
11157         broken). 
11158
11159         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11160         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11161         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11162
11163 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11164
11165         * enum.cs: create the enum static fields using the enum type.
11166
11167 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11168
11169         * class.cs: don't try to create the ParamBuilder for the return
11170         type if it's not needed (and handle it breaking for the ms runtime
11171         anyway).
11172
11173 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11174
11175         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11176
11177 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11178
11179         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11180         the command.   This showed up while compiling the JANET source
11181         code, which used \r as its only newline separator.
11182
11183 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11184
11185         * class.cs (Method.Define): If we are an operator (because it
11186         reuses our code), then set the SpecialName and HideBySig.  #36128
11187
11188 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11189
11190         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11191         exception, report error 120 `object reference required'.
11192
11193         * driver.cs: Add --pause option, used during to measure the size
11194         of the process as it goes with --timestamp.
11195
11196         * expression.cs (Invocation.DoResolve): Do not allow methods with
11197         SpecialName to be invoked.
11198
11199 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11200
11201         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11202         number before adding it.
11203
11204 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11205
11206         * ecore.cs (StandardImplicitConversion): When in an unsafe
11207         context, we allow conversion between void * to any other pointer
11208         type. This fixes bug #35973.
11209
11210 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11211
11212         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11213         is not thrown when extensionless outputs are used 
11214
11215 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11216
11217         * rootcontext.cs: fixed compilation of corlib.
11218
11219 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11220
11221         * attribute.cs (Attributes.Contains): Add new method.
11222
11223         * class.cs (MethodCore.LabelParameters): if the parameter is an
11224         `out' parameter, check that no attribute `[In]' has been passed.
11225
11226         * enum.cs: Handle the `value__' name in an enumeration.
11227
11228 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11229
11230         * decl.cs: Added special case to allow overrides on "protected
11231         internal" methods
11232
11233 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11234
11235         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11236         since it makes much more sense.
11237
11238         (Attributes.ctor): Don't require a Location parameter.
11239
11240         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11241
11242         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11243         since we already have that information per attribute.
11244
11245         * everywhere : make appropriate changes.
11246
11247         * class.cs (LabelParameters): Write the code which actually
11248         applies attributes to the return type. We can't do this on the MS
11249         .NET runtime so we flag a warning in the case an exception is
11250         thrown.
11251
11252 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11253
11254         * const.cs: Handle implicit null conversions here too.
11255
11256 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11257
11258         * class.cs (MethodCore.LabelParameters): Remove the extra
11259         Type [] parameter since it is completely unnecessary. Instead
11260         pass in the method's attributes so that we can extract
11261         the "return" attribute.
11262
11263 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11264
11265         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11266         of ignoring it and letting the compile continue.
11267
11268         * typemanager.cs (ChangeType): use an extra argument to return an
11269         error condition instead of throwing an exception.
11270
11271 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11272
11273         * expression.cs (Unary.TryReduce): mimic the code for the regular
11274         code path.  Perform an implicit cast in the cases where we can
11275         implicitly convert to one of the integral types, and then reduce
11276         based on that constant.   This fixes bug #35483.
11277
11278 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11279
11280         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11281
11282 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11283
11284         * namespace.cs: fixed bug #35489.
11285
11286 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11287
11288         * class.cs: Remove some dead code.
11289
11290         * cs-parser.jay: Estimate the number of methods needed
11291         (RootContext.MethodCount);
11292
11293         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11294         numbers instead of StringBuilders.
11295
11296         * support.cs (PtrHashtable): Add constructor with initial size;
11297         We can now reduce reallocations of the method table.
11298
11299 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11300
11301         * attribute.cs (ApplyAttributes): Keep track of the emitted
11302         attributes on a per-target basis. This fixes bug #35413.
11303
11304 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11305
11306         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11307         default to the Windows 1252 encoding.
11308
11309         (UnixParseOption): Support version, thanks to Alp for the missing
11310         pointer. 
11311
11312         * AssemblyInfo.cs: Add nice assembly information.
11313
11314         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11315         (bug 35169).
11316
11317         * cs-parser.jay: Allow a trailing comma before the close bracked
11318         in the attribute_section production.
11319
11320         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11321         address of the instance was being taken, I will take this out,
11322         because we take the address of the object immediately here.
11323
11324 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11325
11326         * typemanager.cs (AreMultipleAllowed): Take care of the most
11327         obvious case where attribute type is not in the current assembly -
11328         stupid me ;-)
11329
11330 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11331
11332         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11333         definitions, instead of doing that afterwards.  
11334
11335         Also we use a nice little hack, depending on the constructor, we
11336         know if we are a "composed" name or a simple name.  Hence, we
11337         avoid the IndexOf test, and we avoid 
11338
11339         * codegen.cs: Add code to assist in a bug reporter to track down
11340         the source of a compiler crash. 
11341
11342 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11343
11344         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11345         types have been emitted for a given element and flag an error
11346         if something which does not have AllowMultiple set is used more
11347         than once.
11348
11349         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11350         attribute types and their corresponding AllowMultiple properties
11351
11352         (AreMultipleAllowed): Check the property for a given type.
11353
11354         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11355         property in the case we have a TypeContainer.
11356
11357         (Attributes.AddAttribute): Detect duplicates and just skip on
11358         adding them. This trivial fix catches a pretty gross error in our
11359         attribute emission - global attributes were being emitted twice!
11360
11361         Bugzilla bug #33187 is now fixed.
11362
11363 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11364
11365         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11366         instead of pp_and).
11367
11368         * expression.cs (Binary.ResolveOperator): I can only use the
11369         Concat (string, string, string) and Concat (string, string,
11370         string, string) if the child is actually a concatenation of
11371         strings. 
11372
11373 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11374
11375         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11376         context where we need a 2-character lookahead.
11377
11378         * pending.cs (PendingImplementation): Rework so we can keep track
11379         of interface types all the time, and flag those which were
11380         implemented by parents as optional.
11381
11382 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11383
11384         * expression.cs (Binary.ResolveOperator): Use
11385         String.Concat(string,string,string) or
11386         String.Concat(string,string,string,string) when possible. 
11387
11388         * typemanager: More helper methods.
11389
11390
11391 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11392
11393         * pending.cs: remove the bogus return from GetMissingInterfaces()
11394         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11395
11396 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11397
11398         * namespace.cs: avoid duplicated 'using xxx' being added to
11399         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11400         when we get more than one 'using' statement for the same namespace.
11401         Report a CS0105 warning for it.
11402
11403 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11404
11405         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11406         of calling getChar/putback, uses internal knowledge of it.    
11407
11408         (xtoken): Reorder tokenizer so most common patterns are checked
11409         first.  This reduces the compilation time in another 5% (from 8.11s
11410         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11411
11412         The parsing time is 22% of the compilation in mcs, and from that
11413         64% is spent on the tokenization process.  
11414
11415         I tried using a binary search for keywords, but this is slower
11416         than the hashtable.  Another option would be to do a couple of
11417         things:
11418
11419                 * Not use a StringBuilder, instead use an array of chars,
11420                   with a set value.  Notice that this way we could catch
11421                   the 645 error without having to do it *afterwards*.
11422
11423                 * We could write a hand-parser to avoid the hashtable
11424                   compares altogether.
11425
11426         The identifier consumption process takes 37% of the tokenization
11427         time.  Another 15% is spent on is_number.  56% of the time spent
11428         on is_number is spent on Int64.Parse:
11429
11430                 * We could probably choose based on the string length to
11431                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11432                   computations. 
11433
11434         Another 3% is spend on wrapping `xtoken' in the `token' function.
11435
11436         Handle 0xa0 as whitespace (#34752)
11437
11438 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11439
11440         * typemanager.cs (IsCLRType): New routine to tell whether a type
11441         is one of the builtin types.  
11442
11443         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11444         typecode in more places instead of doing pointer comparissions.
11445         We could leverage some knowledge about the way the typecodes are
11446         laid out.
11447
11448         New code to cache namespaces in assemblies, it is currently not
11449         invoked, to be used soon.
11450
11451         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11452
11453         * expression.cs (Binary.ResolveOperator): specially handle
11454         strings, and do not perform user-defined operator overloading for
11455         built-in types.
11456
11457 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11458
11459         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11460         internalcall as it is a pretty simple operation;  Avoid whenever
11461         possible to call Char.IsLetter.
11462
11463         (consume_identifier): Cut by half the number of
11464         hashtable calls by merging the is_keyword and GetKeyword behavior.
11465
11466         Do not short-circuit, because if we do, we
11467         report errors (ie, #if false && true would produce an invalid
11468         directive error);
11469
11470
11471 2002-11-24  Martin Baulig  <martin@ximian.com>
11472
11473         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11474         check constant ranges and report a CS0221.  Fixes #33186.
11475
11476 2002-11-24  Martin Baulig  <martin@ximian.com>
11477
11478         * cs-parser.jay: Make this work for uninitialized variable
11479         declarations in the `for' initializer.  Fixes #32416.
11480
11481 2002-11-24  Martin Baulig  <martin@ximian.com>
11482
11483         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11484         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11485
11486 2002-11-24  Martin Baulig  <martin@ximian.com>
11487
11488         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11489         argument; if true, we also check for user-defined conversions.
11490         This is only needed if both arguments are of a user-defined type.
11491         Fixes #30443, added test-175.cs.
11492         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11493
11494         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11495
11496 2002-11-24  Martin Baulig  <martin@ximian.com>
11497
11498         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11499         function to get the store opcode.
11500         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11501         only emit the Ldelema if the store opcode is Stobj.  You must run
11502         both test-34 and test-167 to test this.  Fixes #34529.
11503
11504 2002-11-23  Martin Baulig  <martin@ximian.com>
11505
11506         * ecore.cs (Expression.MemberLookup): Added additional
11507         `qualifier_type' argument which is used when we're being called
11508         from MemberAccess.DoResolve() and null if we're called from a
11509         SimpleName lookup.
11510         (Expression.MemberLookupFailed): New method to report errors; this
11511         does the CS1540 check and reports the correct error message.
11512
11513         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11514         argument for the CS1540 check and redone the way how we're dealing
11515         with private members.  See the comment in the source code for details.
11516         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11517         `closure_start_type' to `closure_qualifier_type' and check whether
11518         it's not null.  It was not this filter being broken, it was just
11519         being called with the wrong arguments.
11520
11521         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11522         and pass it the correct `qualifier_type'; this also does the error
11523         handling for us.
11524
11525 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11526
11527         * expression.cs (Invocation.EmitParams): If the we are dealing
11528         with a non-built-in value type, load its address as well.
11529
11530         (ArrayCreation): Use a a pretty constant instead
11531         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11532         static initializers.  
11533
11534         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11535         because they are not really value types, just glorified integers. 
11536
11537         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11538
11539         * ecore.cs: Remove redundant code for enumerations, make them use
11540         the same code path as everything else, fixes the casting issue
11541         with enumerations in Windows.Forms.
11542
11543         * attribute.cs: Do only cast to string if it is a string, the
11544         validation happens later.
11545
11546         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11547         people upgrade their corlibs.
11548
11549         * ecore.cs: Oops, enumerations were not following the entire code path
11550
11551 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11552
11553         * typemanager.cs (FilterWithClosure): Commented out the test for
11554         1540 in typemanager.cs, as it has problems when accessing
11555         protected methods from a parent class (see test-174.cs). 
11556
11557         * attribute.cs (Attribute.ValidateGuid): new method.
11558         (Attribute.Resolve): Use above.
11559
11560 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11561
11562         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11563
11564         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11565         handling for enumerations, as we only needed the TypeContainer
11566         functionality to begin with (this is required for the fix below to
11567         work for enums that reference constants in a container class for
11568         example). 
11569
11570         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11571
11572         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11573         a valid TypeBuilder to perform lookups on.o
11574
11575         * class.cs (InheritableMemberSignatureCompare): Use true in the
11576         call to GetGetMethod and GetSetMethod, because we are comparing
11577         the signature, and we need to get the methods *even* if they are
11578         private. 
11579
11580         (PropertyBase.CheckBase): ditto.
11581
11582         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11583         GotoCase.Resolve): Use Peel on EmpytCasts.
11584
11585         * ecore.cs (EmptyCast): drop child, add Peel method.
11586
11587 2002-11-17  Martin Baulig  <martin@ximian.com>
11588
11589         * ecore.cs (EmptyCast.Child): New public property.
11590
11591         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11592         label resolved to an EmptyCast.  Fixes #34162.
11593         (GotoCase.Resolve): Likewise.
11594         (Block.EmitMeta): Likewise.
11595
11596 2002-11-17  Martin Baulig  <martin@ximian.com>
11597
11598         * expression.cs (Invocation.BetterConversion): Prefer int over
11599         uint; short over ushort; long over ulong for integer literals.
11600         Use ImplicitConversionExists instead of StandardConversionExists
11601         since we also need to check for user-defined implicit conversions.
11602         Fixes #34165.  Added test-173.cs.
11603
11604 2002-11-16  Martin Baulig  <martin@ximian.com>
11605
11606         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11607         with the `true' and `false' literals.  Fixes #33151.
11608
11609 2002-11-16  Martin Baulig  <martin@ximian.com>
11610
11611         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11612         October 22nd; don't do the cs1540 check for static members.
11613
11614         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11615         now using our own filter here and doing the cs1540 check again.
11616
11617 2002-11-16  Martin Baulig  <martin@ximian.com>
11618
11619         * support.cs (InternalParameters): Don't crash if we don't have
11620         any fixed parameters.  Fixes #33532.
11621
11622 2002-11-16  Martin Baulig  <martin@ximian.com>
11623
11624         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11625         when looking up static methods to make this work on Windows.
11626         Fixes #33773.
11627
11628 2002-11-16  Martin Baulig  <martin@ximian.com>
11629
11630         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11631         a setter rather than using PropertyInfo.CanWrite.
11632
11633 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11634
11635         * class.cs: Allow acces to block member by subclasses. Fixes build
11636         breaker.
11637
11638 2002-11-14  Martin Baulig  <martin@ximian.com>
11639
11640         * class.cs (Constructor.Emit): Added the extern/block check.
11641         Fixes bug #33678.
11642
11643 2002-11-14  Martin Baulig  <martin@ximian.com>
11644
11645         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11646         iteration while looking for indexers, this is needed because the
11647         indexer may have a different name in our base classes.  Fixed the
11648         error reporting (no indexers at all, not get accessor, no
11649         overloaded match).  Fixes bug #33089.
11650         (IndexerAccess.DoResolveLValue): Likewise.
11651
11652 2002-11-14  Martin Baulig  <martin@ximian.com>
11653
11654         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11655         indexers.  Fixes the first part of bug #33089.
11656         (MethodSignature.InheritableMemberSignatureCompare): Added support
11657         for properties.
11658
11659 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11660
11661         * attribute.cs (Attribute.Resolve): Catch the
11662         NullReferenceException and report it since it isn't supposed to
11663         happen. 
11664
11665 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11666
11667         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11668         LogicalOr and LogicalAnd that can benefit from recursively
11669         handling EmitBranchable.  The code now should be nice for Paolo.
11670
11671 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11672
11673         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11674         the Type lookups, as we perform quite a number of lookups on
11675         non-Types.  This can be removed once we can deterministically tell
11676         whether we have a type or a namespace in advance.
11677
11678         But this might require special hacks from our corlib.
11679
11680         * TODO: updated.
11681
11682         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11683         and double which avoids a conversion from an integer to a double.
11684
11685         * expression.cs: tiny optimization, avoid calling IsConstant,
11686         because it effectively performs the lookup twice.
11687
11688 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11689
11690         But a bogus return here to keep the semantics of the old code
11691         until the Mono runtime is fixed.
11692
11693         * pending.cs (GetMissingInterfaces): New method used to remove all
11694         the interfaces that are already implemented by our parent
11695         classes from the list of pending methods. 
11696
11697         * interface.cs: Add checks for calls after ResolveTypeExpr.
11698
11699 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11700
11701         * class.cs (Class.Emit): Report warning 67: event not used if the
11702         warning level is beyond 3.
11703
11704         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11705         being a NullLiteral.
11706
11707         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11708         specifiers. 
11709
11710         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11711         path that might fail if a type can not be resolved.
11712
11713         * expression.cs (Binary.Emit): Emit unsigned versions of the
11714         operators. 
11715
11716         * driver.cs: use error 5.
11717
11718 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11719
11720         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11721
11722 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11723
11724         * cs-parser.jay (switch_section): A beautiful patch from Martin
11725         Baulig that fixed 33094.
11726
11727 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11728
11729         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11730         Check whether the base is abstract and report an error if so.
11731
11732         * expression.cs (IndexerAccess.DoResolveLValue,
11733         IndexerAccess.DoResolve): ditto. 
11734
11735         (Invocation.DoResolve): ditto.
11736
11737         (Invocation.FullMethodDesc): Improve the report string.
11738
11739         * statement.cs (Block): Eliminate IsVariableDefined as it is
11740         basically just a wrapper for GetVariableInfo.
11741
11742         * ecore.cs (SimpleName): Use new 
11743
11744         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11745         type, as we return the actual parameter ref/unref state on a
11746         different call.
11747
11748 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11749
11750         * support.cs: Return proper flags REF/OUT fixing the previous
11751         commit.  
11752
11753         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11754         not used to mean `ref' but `ref or out' in ParameterReference
11755
11756         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11757         full type signature instead of calling TypeManger.CSharpName
11758         ourselves. 
11759
11760         * support.cs (InternalParameters.ParameterDesc): Do not compare
11761         directly to the modflags, because REF/OUT will actually be bitsets
11762         if set. 
11763
11764         * delegate.cs (VerifyMethod): Check also the modifiers.
11765
11766         * cs-tokenizer.cs: Fix bug where floating point values with an
11767         exponent where a sign was missing was ignored.
11768
11769         * driver.cs: Allow multiple assemblies to be specified in a single
11770         /r: argument
11771
11772 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11773
11774         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11775         because identifiers after a parenthesis would end up in this kind
11776         of production, and we needed to desamiguate it for having casts
11777         like:
11778
11779                 (UserDefinedType *) xxx
11780
11781 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11782
11783         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11784         we should set on the Bindingflags.NonPublic, but not turn on
11785         private_ok.  private_ok controls whether a Private member is
11786         returned (this is chekced on the filter routine), while the
11787         BindingFlags.NonPublic just controls whether private/protected
11788         will be allowed.   This fixes the problem part of the problem of
11789         private properties being allowed to be used in derived classes.
11790
11791         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11792         so we can call the children DoResolveLValue method (this will
11793         properly signal errors on lvalue assignments to base properties)
11794
11795         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11796         getter are null, and we have a property info, we know that this
11797         happened because the lookup failed, so we report an error 122 for
11798         protection level violation.
11799
11800         We also silently return if setter and getter are null in the
11801         resolve functions, this condition only happens if we have flagged
11802         the error before.  This is the other half of the problem. 
11803
11804         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11805         not have accessibility information, that is why we were returning
11806         true in the filter function in typemanager.cs.
11807
11808         To properly report 122 (property is inaccessible because of its
11809         protection level) correctly, we report this error in ResolveAccess
11810         by failing if both the setter and the getter are lacking (ie, the
11811         lookup failed). 
11812
11813         DoResolve and DoLResolve have been modified to check for both
11814         setter/getter being null and returning silently, the reason being
11815         that I did not want to put the knowledge about this error in upper
11816         layers, like:
11817
11818         int old = Report.Errors;
11819         x = new PropertyExpr (...);
11820         if (old != Report.Errors)
11821                 return null;
11822         else
11823                 return x;
11824
11825         So the property expr is returned, but it is invalid, so the error
11826         will be flagged during the resolve process. 
11827
11828         * class.cs: Remove InheritablePropertySignatureCompare from the
11829         class, as we no longer depend on the property signature to compute
11830         whether it is possible to implement a method or not.
11831
11832         The reason is that calling PropertyInfo.GetGetMethod will return
11833         null (in .NET, in Mono it works, and we should change this), in
11834         cases where the Get Method does not exist in that particular
11835         class.
11836
11837         So this code:
11838
11839         class X { public virtual int A { get { return 1; } } }
11840         class Y : X { }
11841         class Z : Y { public override int A { get { return 2; } } }
11842
11843         Would fail in Z because the parent (Y) would not have the property
11844         defined.  So we avoid this completely now (because the alternative
11845         fix was ugly and slow), and we now depend exclusively on the
11846         method names.
11847
11848         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11849         reference method, instead of using the property.
11850
11851         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11852         routines are gone now.
11853
11854         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11855         names, they were incorrectly named.
11856
11857         * cs-tokenizer.cs: Return are more gentle token on failure. 
11858
11859         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11860         had an out-of-sync index variable, which caused it to remove from
11861         the list of pending methods the wrong method sometimes.
11862
11863 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11864
11865         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11866         CanWrite, because those refer to this particular instance of the
11867         property, and do not take into account the fact that we can
11868         override single members of a property.
11869
11870         Constructor requires an EmitContext.  The resolution process does
11871         not happen here, but we need to compute the accessors before,
11872         because the resolution does not always happen for properties.
11873
11874         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11875         subclass, before we did not update this flag, but we did update
11876         bindingflags. 
11877
11878         (GetAccessors): Drop this routine, as it did not work in the
11879         presence of partially overwritten set/get methods. 
11880
11881         Notice that this broke the cs1540 detection, but that will require
11882         more thinking. 
11883
11884 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11885
11886         * class.cs:
11887         * codegen.cs:
11888         * driver.cs: issue a warning instead of an error if we don't support
11889         debugging for the platform. Also ignore a couple of errors that may
11890         arise when trying to write the symbols. Undo my previous patch.
11891
11892 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11893
11894         * driver.cs: ignore /debug switch except for Unix platforms.
11895
11896 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11897
11898         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11899
11900 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11901
11902         * driver.cs: Do not make mcs-debug conditional, so we do not break
11903         builds that use it.
11904
11905         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11906         review this patch.  But basically after all the children variables
11907         have been merged, the value of "Breaks" was not being set to
11908         new_breaks for Switch blocks.  I think that it should be set after
11909         it has executed.  Currently I set this to the value of new_breaks,
11910         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11911         conservative, but I do not understand this code very well.
11912
11913         I did not break anything in the build, so that is good ;-)
11914
11915         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11916
11917 2002-10-20  Mark Crichton  <crichton@gimp.org>
11918
11919         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11920
11921 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11922
11923         * cfold.cs: Fixed compile blocker.
11924
11925 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11926
11927         * driver.cs: I was chekcing the key, not the file.
11928
11929 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11930
11931         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11932         message that we were generating - we just need to silently return
11933         a null.
11934
11935 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11936
11937         * class.cs (Event.Define): Change my previous commit, as this
11938         breaks the debugger.  This is a temporary hack, as it seems like
11939         the compiler is generating events incorrectly to begin with.
11940
11941         * expression.cs (Binary.ResolveOperator): Added support for 
11942         "U operator - (E x, E y)"
11943
11944         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11945         y)".
11946
11947         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11948         init-only variables, but this path did not take into account that
11949         there might be also instance readonly variables.  Correct this
11950         problem. 
11951
11952         This fixes bug 32253
11953
11954         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11955         delegates as well.
11956
11957         * driver.cs: Change the extension for modules to `netmodule'
11958
11959         * cs-parser.jay: Improved slightly the location tracking for
11960         the debugger symbols.
11961
11962         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11963         modifiers that were specified instead of the hardcoded value
11964         (FamAndAssem).  This was basically ignoring the static modifier,
11965         and others.  Fixes 32429.
11966
11967         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11968         fixed a bug in the process (32476)
11969
11970         * expression.cs (ArrayAccess.EmitAssign): Patch from
11971         hwang_rob@yahoo.ca that fixes bug 31834.3
11972
11973 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11974
11975         * driver.cs: Make the module extension .netmodule.
11976
11977 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11978
11979         * driver.cs: Report an error if the resource file is not found
11980         instead of crashing.
11981
11982         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11983         false, like Emit does.
11984
11985 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11986
11987         * typemanager.cs: Remove unused private member.  Also reported mcs
11988         bug to report this as a warning like csc.
11989
11990 2002-10-15  Martin Baulig  <martin@gnome.org>
11991
11992         * statement.cs (Statement.Emit): Made this a virtual method; emits
11993         the line number info and calls DoEmit().
11994         (Statement.DoEmit): New protected abstract method, formerly knows
11995         as Statement.Emit().
11996
11997         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11998
11999 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12000
12001         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12002         have fixed a remaining problem: not every AddXXXX was adding a
12003         fully qualified name.  
12004
12005         Now everyone registers a fully qualified name in the DeclSpace as
12006         being defined instead of the partial name.  
12007
12008         Downsides: we are slower than we need to be due to the excess
12009         copies and the names being registered this way.  
12010
12011         The reason for this is that we currently depend (on the corlib
12012         bootstrap for instance) that types are fully qualified, because
12013         we dump all the types in the namespace, and we should really have
12014         types inserted into the proper namespace, so we can only store the
12015         basenames in the defined_names array.
12016
12017 2002-10-10  Martin Baulig  <martin@gnome.org>
12018
12019         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12020         from bug #31834, see the bug report for a testcase which is
12021         miscompiled.
12022
12023 2002-10-10  Martin Baulig  <martin@gnome.org>
12024
12025         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12026         flow analysis code for this.
12027
12028         * statement.cs (Do, While, For): Tell the flow analysis code about
12029         infinite loops.
12030         (FlowBranching.UsageVector): Added support for infinite loops.
12031         (Block.Resolve): Moved the dead code elimination here and use flow
12032         analysis to do it.
12033
12034 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12035
12036         * class.cs (Field.Define): Catch cycles on struct type
12037         definitions. 
12038
12039         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12040         fields if the fields are static.  We only need to check instance
12041         fields. 
12042
12043         * expression.cs (As.DoResolve): Test for reference type.
12044
12045         * statement.cs (Using.ResolveExpression): Use
12046         ConvertImplicitRequired, not ConvertImplicit which reports an
12047         error on failture
12048         (Using.ResolveLocalVariableDecls): ditto.
12049
12050         * expression.cs (Binary.ResolveOperator): Report errors in a few
12051         places where we had to.
12052
12053         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12054
12055 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12056
12057         * expression.cs: Use StoreFromPtr instead of extracting the type
12058         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12059
12060         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12061         an enumeration value to a System.Enum, but System.Enum is not a
12062         value type, but an class type, so we need to box.
12063
12064         (Expression.ConvertExplicit): One codepath could return
12065         errors but not flag them.  Fix this.  Fixes #31853
12066
12067         * parameter.cs (Resolve): Do not allow void as a parameter type.
12068
12069 2002-10-06  Martin Baulig  <martin@gnome.org>
12070
12071         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12072         if it's a class type and not a struct.  Fixes #31815.
12073
12074 2002-10-06  Martin Baulig  <martin@gnome.org>
12075
12076         * statement.cs: Reworked the flow analysis code a bit to make it
12077         usable for dead code elimination.
12078
12079 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12080
12081         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12082
12083 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12084
12085         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12086         to fix the test 165, will investigate deeper.
12087
12088 2002-10-04  Martin Baulig  <martin@gnome.org>
12089
12090         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12091         finally blocks actually work.
12092         (Try.Resolve): We don't need to create a sibling for `finally' if
12093         there is no finally block.
12094
12095 2002-10-04  Martin Baulig  <martin@gnome.org>
12096
12097         * class.cs (Constructor.Define): The default accessibility for a
12098         non-default constructor is private, not public.
12099
12100 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12101
12102         * class.cs (Constructor): Make AllowedModifiers public, add
12103         EXTERN.
12104
12105         * cs-parser.jay: Perform the modifiers test here, as the
12106         constructor for the Constructor class usually receives a zero
12107         because of the way we create it (first we create, later we
12108         customize, and we were never checking the modifiers).
12109
12110         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12111         is a version of LookupTypeReflection that includes the type-name
12112         cache.  This can be used as a fast path for functions that know
12113         the fully qualified name and are only calling into *.GetType() to
12114         obtain a composed type.
12115
12116         This is also used by TypeManager.LookupType during its type
12117         composition.
12118
12119         (LookupType): We now also track the real type name, as sometimes
12120         we can get a quey for the real type name from things like
12121         ComposedCast.  This fixes bug 31422.
12122
12123         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12124         complete type fullname, it does not have to go through the type
12125         resolution system to obtain the composed version of the type (for
12126         obtaining arrays or pointers).
12127
12128         (Conditional.Emit): Use the EmitBoolExpression to
12129         generate nicer code, as requested by Paolo.
12130
12131         (ArrayCreation.CheckIndices): Use the patch from
12132         hwang_rob@yahoo.ca to validate the array initializers. 
12133
12134 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12135
12136         * class.cs (ConstructorInitializer.Emit): simplify code by using
12137         Invocation.EmitCall, and at the same time, fix the bugs in calling
12138         parent constructors that took variable arguments. 
12139
12140         * ecore.cs (Expression.ConvertNumericExplicit,
12141         Expression.ImplicitNumericConversion): Remove the code that
12142         manually wrapped decimal (InternalTypeConstructor call is now gone
12143         as well).
12144
12145         * expression.cs (Cast.TryReduce): Also handle decimal types when
12146         trying to perform a constant fold on the type.
12147
12148         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12149
12150         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12151         that only turned off an error report, and did nothing else. 
12152
12153 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12154
12155         * driver.cs: Handle and ignore /fullpaths
12156
12157 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12158
12159         * expression.cs (Binary.ResolveOperator): Catch the case where
12160         DoNumericPromotions returns true, 
12161
12162         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12163
12164 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12165
12166         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12167         report error 70.
12168
12169 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12170
12171         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12172         conversion exists, but it is also required that the conversion be
12173         performed.  This manifested in "(Type64Enum) 2".  
12174
12175         * class.cs (TypeManager.AddMethod): The fix is not to change
12176         AddEnum, because that one was using a fully qualified name (every
12177         DeclSpace derivative does), but to change the AddMethod routine
12178         that was using an un-namespaced name.  This now correctly reports
12179         the duplicated name.
12180
12181         Revert patch until I can properly fix it.  The issue
12182         is that we have a shared Type space across all namespaces
12183         currently, which is wrong.
12184
12185         Options include making the Namespace a DeclSpace, and merge
12186         current_namespace/current_container in the parser.
12187
12188 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12189
12190         * cs-parser.jay: Improve error reporting when we get a different
12191         kind of expression in local_variable_type and
12192         local_variable_pointer_type. 
12193
12194         Propagate this to avoid missleading errors being reported.
12195
12196         * ecore.cs (ImplicitReferenceConversion): treat
12197         TypeManager.value_type as a target just like object_type.   As
12198         code like this:
12199
12200         ValueType v = 1;
12201
12202         Is valid, and needs to result in the int 1 being boxed before it
12203         is assigned to the value type v.
12204
12205         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12206         to validate the enumeration name.
12207
12208         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12209         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12210         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12211
12212         * ecore.cs (TryImplicitIntConversion): When doing an
12213         implicit-enumeration-conversion, check if the type is 64-bits and
12214         perform a conversion before passing to EnumConstant.
12215
12216 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12217
12218         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12219         report ambiguous type references.  Unlike the MS version, we
12220         report what the ambiguity is.   Innovation at work ;-)
12221
12222         (DeclSpace.FindType): Require a location argument to
12223         display when we display an ambiguous error.
12224
12225         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12226
12227         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12228
12229         * expression.cs (EmitDynamicInitializers): Apply patch from
12230         hwang_rob@yahoo.ca that fixes the order in which we emit our
12231         initializers. 
12232
12233 2002-09-21  Martin Baulig  <martin@gnome.org>
12234
12235         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12236         delegate takes no arguments.
12237
12238 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12239
12240         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12241         from integers.
12242
12243         * expression.cs: Extract the underlying type.
12244
12245         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12246
12247         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12248
12249 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12250
12251         * class.cs (TypeContainer.DefineType): We can not use the nice
12252         PackingSize with the size set to 1 DefineType method, because it
12253         will not allow us to define the interfaces that the struct
12254         implements.
12255
12256         This completes the fixing of bug 27287
12257
12258         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12259         means also structs.  This fixes part of the problem. 
12260         (Expresion.ImplicitReferenceConversionExists): ditto.
12261
12262         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12263         error if there were no errors reported during the type lookup
12264         process, to avoid duplicates or redundant errors.  Without this
12265         you would get an ambiguous errors plus a type not found.  We have
12266         beaten the user enough with the first error.  
12267
12268         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12269         reference. 
12270
12271         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12272         during the resolution process, stop the lookup, this avoids
12273         repeated error reports (same error twice).
12274
12275         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12276
12277         * typemanager.cs (LookupType): Redo the type lookup code to match
12278         the needs of System.Reflection.  
12279
12280         The issue is that System.Reflection requires references to nested
12281         types to begin with a "+" sign instead of a dot.  So toplevel
12282         types look like: "NameSpace.TopLevelClass", and nested ones look
12283         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12284         levels. 
12285
12286 2002-09-19  Martin Baulig  <martin@gnome.org>
12287
12288         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12289         says that a method always returns or always throws an exception,
12290         don't report the CS0161.
12291
12292         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12293         set `Returns = new_returns'.
12294
12295 2002-09-19  Martin Baulig  <martin@gnome.org>
12296
12297         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12298         to an enum constant, check for a CS0176.
12299
12300 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12301
12302         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12303         for operators that must be in pairs and report errors.
12304
12305         * ecore.cs (SimpleName.DoResolveType): During the initial type
12306         resolution process, when we define types recursively, we must
12307         check first for types in our current scope before we perform
12308         lookups in the enclosing scopes.
12309
12310         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12311
12312         (Invocation.VerifyArgumentsCompat): Call
12313         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12314         I thought we were supposed to always call this, but there are a
12315         few places in the code where we dont do it.
12316
12317 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12318
12319         * driver.cs: Add support in -linkres and -resource to specify the
12320         name of the identifier.
12321
12322 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12323
12324         * ecore.cs (StandardConversionExists): Sync with the conversion
12325         code: allow anything-* to void* conversions.
12326
12327         (FindMostSpecificSource): Use an Expression argument
12328         instead of a Type, because we might be handed over a Literal which
12329         gets a few more implicit conversions that plain types do not.  So
12330         this information was being lost.
12331
12332         Also, we drop the temporary type-holder expression when not
12333         required.
12334
12335 2002-09-17  Martin Baulig  <martin@gnome.org>
12336
12337         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12338         this is an explicit interface implementation.
12339
12340 2002-09-17  Martin Baulig  <martin@gnome.org>
12341
12342         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12343         different `IndexerName' attributes.
12344
12345         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12346         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12347         virtual CommonResolve().
12348
12349 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12350
12351         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12352         and convert that to the UnderlyingType.
12353
12354         * statement.cs (Foreach.Resolve): Indexers are just like variables
12355         or PropertyAccesses.
12356
12357         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12358         inside quoted strings, we were not doing this before.
12359
12360 2002-09-16  Martin Baulig  <martin@gnome.org>
12361
12362         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12363         resolve it.  This is needed for the definite assignment check of the
12364         instance expression, fixes bug #29846.
12365         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12366
12367 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12368
12369         * parameter.cs: Fix compile error.  Cannot reference static member
12370         from an instance object.  Is this an mcs bug?
12371
12372 2002-09-14  Martin Baulig  <martin@gnome.org>
12373
12374         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12375         multiple times.  Fixes bug #30295, added test-166.cs.
12376
12377 2002-09-14  Martin Baulig  <martin@gnome.org>
12378
12379         * statement.cs (Block.Emit): Don't emit unreachable code.
12380         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12381         `break' statements.
12382         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12383
12384 2002-09-14  Martin Baulig  <martin@gnome.org>
12385
12386         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12387         is set.
12388
12389 2002-09-14  Martin Baulig  <martin@gnome.org>
12390
12391         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12392         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12393         be false on the ms runtime.
12394
12395 2002-09-13  Martin Baulig  <martin@gnome.org>
12396
12397         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12398         the CS0038 error message.
12399
12400 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12401
12402         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12403         constant inside, return it.
12404
12405 2002-09-12  Martin Baulig  <martin@gnome.org>
12406
12407         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12408         implicit conversion can be done between enum types.
12409
12410         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12411         check whether an implicit conversion to the current enum's UnderlyingType
12412         exists and report an error if not.
12413
12414         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12415         without debugging support.
12416
12417         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12418         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12419
12420 2002-09-12  Martin Baulig  <martin@gnome.org>
12421
12422         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12423
12424         * ecore.cs (IMemberExpr.DeclaringType): New property.
12425         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12426         nonstatic member of an outer type (CS0038).
12427
12428 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12429
12430         * driver.cs: Activate the using-error detector at warning level
12431         4 (at least for MS-compatible APIs).
12432
12433         * namespace.cs (VerifyUsing): Small buglett fix.
12434
12435         * pending.cs (PendingImplementation): pass the container pointer. 
12436
12437         * interface.cs (GetMethods): Allow for recursive definition.  Long
12438         term, I would like to move every type to support recursive
12439         definitions, not the current ordering mechanism that we have right
12440         now.
12441
12442         The situation is this: Attributes are handled before interfaces,
12443         so we can apply attributes to interfaces.  But some attributes
12444         implement interfaces, we will now handle the simple cases
12445         (recursive definitions will just get an error).  
12446
12447         * parameter.cs: Only invalidate types at the end if we fail to
12448         lookup all types.  
12449
12450 2002-09-09  Martin Baulig  <martin@gnome.org>
12451
12452         * ecore.cs (PropertyExpr.Emit): Also check for
12453         TypeManager.system_int_array_get_length so this'll also work when
12454         compiling corlib.  Fixes #30003.
12455
12456 2002-09-09  Martin Baulig  <martin@gnome.org>
12457
12458         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12459         and throw an exception if we can't get the type's size.  Fixed #30040,
12460         added test-165.cs.
12461
12462 2002-09-09  Martin Baulig  <martin@gnome.org>
12463
12464         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12465
12466         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12467         context.  Fixes bug #30027.
12468
12469         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12470         virtual functions.  Fixes bug #30043, added test-164.cs.
12471
12472 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12473
12474         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12475
12476 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12477
12478         * driver.cs: Use an object to get the windows codepage since it's not a
12479         static property.
12480
12481 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12482
12483         * statement.cs (For.Emit): for infinite loops (test == null)
12484         return whether there is a break inside, not always "true".
12485
12486         * namespace.cs (UsingEntry): New struct to hold the name of the
12487         using definition, the location where it is defined, and whether it
12488         has been used in a successful type lookup.
12489
12490         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12491         strings.
12492
12493         * decl.cs: ditto.
12494
12495 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12496
12497         * attribute.cs : Fix incorrect code which relied on catching
12498         a NullReferenceException to detect a null being passed in
12499         where an object was expected.
12500
12501 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12502
12503         * statement.cs (Try): flag the catch variable as assigned
12504
12505         * expression.cs (Cast): Simplified by using ResolveType instead of
12506         manually resolving.
12507
12508         * statement.cs (Catch): Fix bug by using ResolveType.
12509
12510 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12511
12512         * expression.cs (BetterConversion): Special case for when we have
12513         a NullLiteral as the argument and we have to choose between string
12514         and object types - we choose string the way csc does.
12515
12516         * attribute.cs (Attribute.Resolve): Catch the
12517         NullReferenceException and report error #182 since the Mono
12518         runtime no more has the bug and having this exception raised means
12519         we tried to select a constructor which takes an object and is
12520         passed a null.
12521
12522 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12523
12524         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12525         message (1502, 1503) when we can't locate a method after overload
12526         resolution. This is much more informative and closes the bug
12527         Miguel reported.
12528
12529         * interface.cs (PopulateMethod): Return if there are no argument
12530         types. Fixes a NullReferenceException bug.
12531
12532         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12533         expressions too. Previously we were checking only in one place for
12534         positional arguments leaving out named arguments.
12535
12536         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12537         type to the enum type is not allowed. Remove code corresponding to
12538         that.
12539
12540         (ConvertNumericExplicit): Allow explicit conversions from
12541         the underlying type to enum type. This precisely follows the spec
12542         and closes a bug filed by Gonzalo.
12543
12544 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12545
12546         * compiler.csproj:
12547         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12548
12549 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12550
12551         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12552         it was important that we stored the right value after the
12553         reduction in `converted'.
12554
12555 2002-09-04  Martin Baulig  <martin@gnome.org>
12556
12557         * location.cs (Location.SymbolDocument): Use full pathnames for the
12558         source files.
12559
12560 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12561
12562         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12563         of the expression resolve mechanism, because that will catch the
12564         SimpleName error failures.
12565
12566         (Conditional): If we can not resolve the
12567         expression, return, do not crash.
12568
12569 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12570
12571         * cs-tokenizer.cs:
12572         (location): display token name instead of its number.
12573
12574 2002-08-28  Martin Baulig  <martin@gnome.org>
12575
12576         * expression.cs (Binary.ResolveOperator): Don't silently return
12577         but return an error if an operator cannot be applied between two
12578         enum types.
12579
12580 2002-08-28  Martin Baulig  <martin@gnome.org>
12581
12582         * class.cs (Constructor.Define): Set the permission attributes
12583         correctly instead of making all constructors public.
12584
12585 2002-08-28  Martin Baulig  <martin@gnome.org>
12586
12587         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12588         for private members before reporting a CS0103; if we find anything,
12589         it's a CS0122.
12590
12591 2002-08-28  Martin Baulig  <martin@gnome.org>
12592
12593         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12594         to check whether `closure_start_type == closure_invocation_type',
12595         we also need to check whether `m.DeclaringType == closure_invocation_type'
12596         before bypassing the permission checks.  We might be accessing
12597         protected/private members from the base class.
12598         (TypeManager.RealMemberLookup): Only set private_ok if private
12599         members were requested via BindingFlags.NonPublic.
12600
12601         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12602
12603         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12604         MethodGroupExpr.IsExplicitImpl if appropriate.
12605         (Invocation.DoResolve): Don't report the CS0120 for explicit
12606         interface implementations.
12607
12608 2002-08-27  Martin Baulig  <martin@gnome.org>
12609
12610         * expression.cs (Invocation.DoResolve): If this is a static
12611         method and we don't have an InstanceExpression, we must report
12612         a CS0120.
12613
12614 2002-08-25  Martin Baulig  <martin@gnome.org>
12615
12616         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12617         `==' between a valuetype and an object.
12618
12619 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12620
12621         * ecore.cs (TypeExpr): Provide a ToString method.
12622
12623 2002-08-24  Martin Baulig  <martin@gnome.org>
12624
12625         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12626         now called proggie.dbg and it's a binary file.
12627
12628 2002-08-23  Martin Baulig  <martin@gnome.org>
12629
12630         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12631
12632 2002-08-23  Martin Baulig  <martin@gnome.org>
12633
12634         * struct.cs (MyStructInfo.ctor): Make this work with empty
12635         structs; it's not allowed to use foreach() on null.
12636
12637 2002-08-23  Martin Baulig  <martin@gnome.org>
12638
12639         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12640         writer the full pathname of the generated assembly.
12641
12642 2002-08-23  Martin Baulig  <martin@gnome.org>
12643
12644         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12645         A `finally' block never returns or breaks; improved handling of
12646         unreachable code.
12647
12648 2002-08-23  Martin Baulig  <martin@gnome.org>
12649
12650         * statement.cs (Throw.Resolve): Allow `throw null'.
12651
12652 2002-08-23  Martin Baulig  <martin@gnome.org>
12653
12654         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12655         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12656         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12657         MemberLookup would return a wrong event if this is an explicit
12658         interface implementation and the class has an event with the same
12659         name.
12660
12661 2002-08-23  Martin Baulig  <martin@gnome.org>
12662
12663         * statement.cs (Block.AddChildVariableNames): New public method.
12664         (Block.AddChildVariableName): Likewise.
12665         (Block.IsVariableNameUsedInChildBlock): Likewise.
12666         (Block.AddVariable): Check whether a variable name has already
12667         been used in a child block.
12668
12669         * cs-parser.jay (declare_local_variables): Mark all variable names
12670         from the current block as being used in a child block in the
12671         implicit block.
12672
12673 2002-08-23  Martin Baulig  <martin@gnome.org>
12674
12675         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12676         find the symbol writer.
12677
12678         * driver.cs: csc also allows the arguments to /define being
12679         separated by commas, not only by semicolons.
12680
12681 2002-08-23  Martin Baulig  <martin@gnome.org>
12682
12683         * interface.cs (Interface.GetMembers): Added static check for events.
12684
12685 2002-08-15  Martin Baulig  <martin@gnome.org>
12686
12687         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12688         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12689
12690         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12691         why the MethodData.EmitDestructor() change was necessary.
12692
12693 2002-08-20  Martin Baulig  <martin@gnome.org>
12694
12695         * class.cs (TypeContainer.FindMembers): Added static check for events.
12696
12697         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12698
12699         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12700         use Type.GetEvents(), not Type.FindMembers().
12701
12702 2002-08-20  Martin Baulig  <martin@gnome.org>
12703
12704         * decl.cs (MemberCache): Added a special method cache which will
12705         be used for method-only searched.  This ensures that a method
12706         search will return a MethodInfo with the correct ReflectedType for
12707         inherited methods.      
12708
12709 2002-08-20  Martin Baulig  <martin@gnome.org>
12710
12711         * decl.cs (DeclSpace.FindMembers): Made this public.
12712
12713 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12714
12715         * delegate.cs: fixed build on windows.
12716         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12717
12718 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12719
12720         * ecore.cs (StandardConversionExists): Return a false
12721         if we are trying to convert the void type to anything else
12722         since that is not allowed.
12723
12724         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12725         we flag error 70 in the event an event is trying to be accessed
12726         directly from outside the declaring type.
12727
12728 2002-08-20  Martin Baulig  <martin@gnome.org>
12729
12730         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12731         MemberCache from typemanager.cs to decl.cs.
12732
12733 2002-08-19  Martin Baulig  <martin@gnome.org>
12734
12735         * class.cs (TypeContainer): Implement IMemberContainer.
12736         (TypeContainer.DefineMembers): Create the MemberCache.
12737         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12738         return public members if BindingFlags.Public was given, check
12739         whether members are static.
12740
12741 2002-08-16  Martin Baulig  <martin@gnome.org>
12742
12743         * decl.cs (DeclSpace.Define): Splitted this in Define and
12744         DefineMembers.  DefineMembers is called first and initializes the
12745         MemberCache.
12746
12747         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12748         DefineMembers() on all our DeclSpaces.
12749
12750         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12751         but call DefineMembers() on all nested interfaces.  We call their
12752         Define() in our new Define() function.
12753
12754         * interface.cs (Interface): Implement IMemberContainer.
12755         (Interface.Define): Moved all code except the attribute stuf to
12756         DefineMembers().
12757         (Interface.DefineMembers): Initialize the member cache.
12758
12759         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12760         need this anymore since we can use MemberCache.FindMembers directly.
12761
12762 2002-08-19  Martin Baulig  <martin@gnome.org>
12763
12764         * typemanager.cs (MemberCache): When creating the cache for an
12765         interface type, add all inherited members.
12766         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12767         to `out bool used_cache' and documented it.
12768         (TypeManager.MemberLookup): If we already used the cache in the first
12769         iteration, we don't need to do the interfaces check.
12770
12771 2002-08-19  Martin Baulig  <martin@gnome.org>
12772
12773         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12774         here from IMemberFinder and don't implement this interface anymore.
12775         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12776
12777         * typemanager.cs (IMemberFinder): This interface is now only used by
12778         classes which actually support the member cache.
12779         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12780         since we only put DeclSpaces into this Hashtable.
12781         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12782         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12783
12784 2002-08-16  Martin Baulig  <martin@gnome.org>
12785
12786         * typemanager.cs (ICachingMemberFinder): Removed.
12787         (IMemberFinder.MemberCache): New property.
12788         (TypeManager.FindMembers): Merged this with RealFindMembers().
12789         This function will never be called from TypeManager.MemberLookup()
12790         so we can't use the cache here, just the IMemberFinder.
12791         (TypeManager.MemberLookup_FindMembers): Check whether the
12792         IMemberFinder has a MemberCache and call the cache's FindMembers
12793         function.
12794         (MemberCache): Rewrote larger parts of this yet another time and
12795         cleaned it up a bit.
12796
12797 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12798
12799         * driver.cs (LoadArgs): Support quoting.
12800
12801         (Usage): Show the CSC-like command line arguments.
12802
12803         Improved a few error messages.
12804
12805 2002-08-15  Martin Baulig  <martin@gnome.org>
12806
12807         * typemanager.cs (IMemberContainer.Type): New property.
12808         (IMemberContainer.IsInterface): New property.
12809
12810         The following changes are conditional to BROKEN_RUNTIME, which is
12811         defined at the top of the file.
12812
12813         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12814         class'es members, but add all members from TypeHandle.ObjectType
12815         if we're an interface.
12816         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12817         is the current type.
12818         (MemberCache.CacheEntry.Container): Removed this field.
12819         (TypeHandle.GetMembers): Include inherited members.
12820
12821 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12822
12823         * typemanager.cs: fixed compilation and added a comment on a field that
12824         is never used.
12825
12826 2002-08-15  Martin Baulig  <martin@gnome.org>
12827
12828         * class.cs (ConstructorInitializer.Resolve): In the
12829         Expression.MemberLookup call, use the queried_type as
12830         invocation_type.
12831
12832         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12833         declared' attribute, it's always true.
12834         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12835         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12836         temporary wrapper for FindMembers which tells MemberLookup whether
12837         members from the base classes are included in the return value.
12838         This will go away soon.
12839         (TypeManager.MemberLookup): Use this temporary hack here; once the
12840         new MemberCache is completed, we don't need to do the DeclaredOnly
12841         looping here anymore since the MemberCache will take care of this.
12842         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12843         (MemberCache): When creating the MemberCache for a class, get
12844         members from the current class and all its base classes.
12845         (MemberCache.CacheEntry.Container): New field.  This is a
12846         temporary hack until the Mono runtime is fixed to distinguish
12847         between ReflectedType and DeclaringType.  It allows us to use MCS
12848         with both the MS runtime and the unfixed Mono runtime without
12849         problems and without accecting performance.
12850         (MemberCache.SearchMembers): The DeclaredOnly looping from
12851         TypeManager.MemberLookup is now done here.      
12852
12853 2002-08-14  Martin Baulig  <martin@gnome.org>
12854
12855         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12856         Type.GetFields on dynamic types but get the fields from the
12857         corresponding TypeContainer.
12858         (MyStructInfo.GetStructInfo): Added check for enum types.
12859
12860         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12861         (MemberList.SyncRoot): Implemented.
12862         (TypeManager.FilterWithClosure): No need to check permissions if
12863         closure_start_type == closure_invocation_type, don't crash if
12864         closure_invocation_type is null.
12865
12866 2002-08-13  Martin Baulig  <martin@gnome.org>
12867
12868         Rewrote TypeContainer.FindMembers to use a member cache.  This
12869         gives us a speed increase of about 35% for the self-hosting MCS
12870         build and of about 15-20% for the class libs (both on GNU/Linux).
12871
12872         * report.cs (Timer): New class to get enhanced profiling.  This
12873         whole class is "TIMER" conditional since it remarkably slows down
12874         compilation speed.
12875
12876         * class.cs (MemberList): New class.  This is an IList wrapper
12877         which we're now using instead of passing MemberInfo[]'s around to
12878         avoid copying this array unnecessarily.
12879         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12880         (ICachingMemberFinder, IMemberContainer): New interface.
12881         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12882         has already been checked, otherwise use it for the name comparision.
12883         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12884         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12885         if possible.  Returns a MemberList, not a MemberInfo [].
12886         (TypeHandle): New class, implements IMemberContainer.  We create
12887         one instance of this class per type, it contains a MemberCache
12888         which is used to do the member lookups.
12889         (MemberCache): New class.  Each instance of this class contains
12890         all members of a type and a name-based hash table.
12891         (MemberCache.FindMembers): This is our new member lookup
12892         function.  First, it looks up all members of the requested name in
12893         the hash table.  Then, it walks this list and sorts out all
12894         applicable members and returns them.
12895
12896 2002-08-13  Martin Baulig  <martin@gnome.org>
12897
12898         In addition to a nice code cleanup, this gives us a performance
12899         increase of about 1.4% on GNU/Linux - not much, but it's already
12900         half a second for the self-hosting MCS compilation.
12901
12902         * typemanager.cs (IMemberFinder): New interface.  It is used by
12903         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12904         Enum, Delegate or Interface.
12905         (TypeManager.finder_to_member_finder): New PtrHashtable.
12906         (TypeManager.finder_to_container): Removed.
12907         (TypeManager.finder_to_delegate): Removed.
12908         (TypeManager.finder_to_interface): Removed.
12909         (TypeManager.finder_to_enum): Removed.
12910
12911         * interface.cs (Interface): Implement IMemberFinder.
12912
12913         * delegate.cs (Delegate): Implement IMemberFinder.
12914
12915         * enum.cs (Enum): Implement IMemberFinder.
12916
12917         * class.cs (TypeContainer): Implement IMemberFinder.
12918
12919 2002-08-12  Martin Baulig  <martin@gnome.org>
12920
12921         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12922
12923 2002-08-12  Martin Baulig  <martin@gnome.org>
12924
12925         * ecore.cs (ITypeExpression): New interface for expressions which
12926         resolve to a type.
12927         (TypeExpression): Renamed to TypeLookupExpression.
12928         (Expression.DoResolve): If we're doing a types-only lookup, the
12929         expression must implement the ITypeExpression interface and we
12930         call DoResolveType() on it.
12931         (SimpleName): Implement the new ITypeExpression interface.
12932         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12933         hack, the situation that we're only looking up types can't happen
12934         anymore when this method is called.  Moved the type lookup code to
12935         DoResolveType() and call it.
12936         (SimpleName.DoResolveType): This ITypeExpression interface method
12937         is now doing the types-only lookup.
12938         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12939         (ResolveFlags): Added MaskExprClass.
12940
12941         * expression.cs (MemberAccess): Implement the ITypeExpression
12942         interface.
12943         (MemberAccess.DoResolve): Added support for a types-only lookup
12944         when we're called via ITypeExpression.DoResolveType().
12945         (ComposedCast): Implement the ITypeExpression interface.
12946
12947         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12948         Expression.Resolve() with ResolveFlags.Type instead.
12949
12950 2002-08-12  Martin Baulig  <martin@gnome.org>
12951
12952         * interface.cs (Interface.Define): Apply attributes.
12953
12954         * attribute.cs (Attribute.ApplyAttributes): Added support for
12955         interface attributes.
12956
12957 2002-08-11  Martin Baulig  <martin@gnome.org>
12958
12959         * statement.cs (Block.Emit): Only check the "this" variable if we
12960         do not always throw an exception.
12961
12962         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12963         whether the property has a set accessor.
12964
12965 2002-08-11  Martin Baulig  <martin@gnome.org>
12966
12967         Added control flow analysis support for structs.
12968
12969         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12970         with control flow analysis turned off.
12971         (IVariable): New interface.
12972         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12973         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12974         (FieldExpr.DoResolve): Resolve the instance expression with flow
12975         analysis turned off and do the definite assignment check after the
12976         resolving when we know what the expression will resolve to.
12977
12978         * expression.cs (LocalVariableReference, ParameterReference):
12979         Implement the new IVariable interface, only call the flow analysis
12980         code if ec.DoFlowAnalysis is true.
12981         (This): Added constructor which takes a Block argument.  Implement
12982         the new IVariable interface.
12983         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12984         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12985         This does the definite assignment checks for struct members.
12986
12987         * class.cs (Constructor.Emit): If this is a non-static `struct'
12988         constructor which doesn't have any initializer, call
12989         Block.AddThisVariable() to tell the flow analysis code that all
12990         struct elements must be initialized before control returns from
12991         the constructor.
12992
12993         * statement.cs (MyStructInfo): New public class.
12994         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12995         argument to this indexer.  If non-zero, check an individual struct
12996         member, not the whole struct.
12997         (FlowBranching.CheckOutParameters): Check struct members.
12998         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12999         overloaded versions of these methods which take an additional
13000         `int field_idx' argument to check struct members.
13001         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13002         overloaded versions of these methods which take an additional
13003         `string field_name' argument to check struct member.s
13004         (VariableInfo): Implement the IVariable interface.
13005         (VariableInfo.StructInfo): New public property.  Returns the
13006         MyStructInfo instance of the variable if it's a struct or null.
13007         (Block.AddThisVariable): New public method.  This is called from
13008         Constructor.Emit() for non-static `struct' constructor which do
13009         not have any initializer.  It creates a special variable for the
13010         "this" instance variable which will be checked by the flow
13011         analysis code to ensure that all of the struct's fields are
13012         initialized before control returns from the constructor.
13013         (UsageVector): Added support for struct members.  If a
13014         variable/parameter is a struct with N members, we reserve a slot
13015         in the usage vector for each member.  A struct is considered fully
13016         initialized if either the struct itself (slot 0) or all its
13017         members are initialized.
13018
13019 2002-08-08  Martin Baulig  <martin@gnome.org>
13020
13021         * driver.cs (Driver.MainDriver): Only report an error CS5001
13022         if there were no compilation errors.
13023
13024         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13025         `UnsafeContext' property to determine whether the parent is in
13026         unsafe context rather than checking the parent's ModFlags:
13027         classes nested in an unsafe class are unsafe as well.
13028
13029 2002-08-08  Martin Baulig  <martin@gnome.org>
13030
13031         * statement.cs (UsageVector.MergeChildren): Distinguish between
13032         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13033         we return.  Added test17() and test18() to test-154.cs.
13034
13035 2002-08-08  Martin Baulig  <martin@gnome.org>
13036
13037         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13038         Family access, make sure the invoking type isn't a subclass of the
13039         queried type (that'd be a CS1540).
13040
13041         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13042         this method which takes an additional `Type invocation_type'.
13043
13044         * expression.cs (BaseAccess.DoResolve): Use the base type as
13045         invocation and query type.
13046         (MemberAccess.DoResolve): If the lookup failed and we're about to
13047         report a CS0122, try a lookup with the ec.ContainerType - if this
13048         succeeds, we must report a CS1540.
13049
13050 2002-08-08  Martin Baulig  <martin@gnome.org>
13051
13052         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13053         (MethodGroupExpr): Implement the IMemberExpr interface.
13054
13055         * expression (MemberAccess.ResolveMemberAccess): No need to have
13056         any special code for MethodGroupExprs anymore, they're now
13057         IMemberExprs.   
13058
13059 2002-08-08  Martin Baulig  <martin@gnome.org>
13060
13061         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13062         Family, FamANDAssem and FamORAssem permissions.
13063         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13064
13065 2002-08-08  Martin Baulig  <martin@gnome.org>
13066
13067         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13068         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13069         or loop block.
13070
13071 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13072
13073         * driver.cs: implemented /resource option to embed managed resources.
13074
13075 2002-08-07  Martin Baulig  <martin@gnome.org>
13076
13077         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13078         (FieldBase.HasFieldInitializer): New public property.
13079         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13080         returns the field initializer and makes sure it is only resolved once.
13081         (TypeContainer.EmitFieldInitializers): Call
13082         FieldBase.GetInitializerExpression to get the initializer, this ensures
13083         that it isn't resolved multiple times.
13084
13085         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13086         the resolving process (SimpleName/MemberLookup) that we're currently
13087         emitting a field initializer (which must not access any instance members,
13088         this is an error CS0236).
13089
13090         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13091         argument, if the `IsFieldInitializer' flag is set, we must report and
13092         error CS0236 and not an error CS0120.   
13093
13094 2002-08-07  Martin Baulig  <martin@gnome.org>
13095
13096         * ecore.cs (IMemberExpr): New public interface.
13097         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13098         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13099         if the expression is an IMemberExpr.
13100
13101         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13102         to be null, implicitly default to `this' if we're non-static in
13103         this case.  Simplified the code a lot by using the new IMemberExpr
13104         interface.  Also fixed bug #28176 here.
13105
13106 2002-08-06  Martin Baulig  <martin@gnome.org>
13107
13108         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13109         ParameterReferences during semantic analysis so that we can do a
13110         type-only search when resolving Cast, TypeOf and SizeOf.
13111         (block): Pass the `current_local_parameters' to the Block's
13112         constructor.
13113
13114         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13115         argument to the constructor.
13116         (ConstructorInitializer.Resolve): Create a temporary implicit
13117         block with the parameters.
13118
13119         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13120         references here if we aren't doing a type-only search.
13121
13122         * statement.cs (Block): Added constructor which takes a
13123         `Parameters parameters' argument.
13124         (Block.Parameters): New public property.
13125
13126         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13127         to `Parameters' and made it public readonly.
13128
13129 2002-08-06  Martin Baulig  <martin@gnome.org>
13130
13131         * ecore.cs (Expression.Warning): Made this public as well.
13132
13133         * report.cs (Report.Debug): Print the contents of collections.
13134
13135 2002-08-06  Martin Baulig  <martin@gnome.org>
13136
13137         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13138         used to tell Resolve() which kinds of expressions it may return.
13139         (Expression.Resolve): Added overloaded version of this method which
13140         takes a `ResolveFlags flags' argument.  This can be used to tell
13141         Resolve() which kinds of expressions it may return.  Reports a
13142         CS0118 on error.
13143         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13144         ResolveFlags.SimpleName.
13145         (Expression.Error118): Added overloaded version of this method which
13146         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13147         which kinds of expressions are allowed.
13148
13149         * expression.cs (Argument.ResolveMethodGroup): New public method.
13150         Resolves an argument, but allows a MethodGroup to be returned.
13151         This is used when invoking a delegate.
13152
13153         * TODO: Updated a bit.
13154
13155 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13156
13157         Fixed compilation with csc.
13158
13159         * ecore.cs: Expression.Error made public. Is this correct? Should
13160         Warning be made public too?
13161
13162         * expression.cs: use ea.Location instead of ea.loc.
13163         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13164
13165 2002-08-06  Martin Baulig  <martin@gnome.org>
13166
13167         * ecore.cs (Expression.loc): Moved the location here instead of
13168         duplicating it in all derived classes.
13169         (Expression.Location): New public property.
13170         (Expression.Error, Expression.Warning): Made them non-static and
13171         removed the location argument.
13172         (Expression.Warning): Added overloaded version which takes an
13173         `int level' argument.
13174         (Expression.Error118): Make this non-static and removed the
13175         expression and location arguments.
13176         (TypeExpr): Added location argument to the constructor.
13177
13178         * expression.cs (StaticCallExpr): Added location argument to
13179         the constructor.
13180         (Indirection, PointerArithmetic): Likewise.
13181         (CheckedExpr, UnCheckedExpr): Likewise.
13182         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13183         (StringPtr): Likewise.
13184
13185
13186 2002-08-05  Martin Baulig  <martin@gnome.org>
13187
13188         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13189
13190         * assign.cs (Assign.DoResolve): Check whether the source
13191         expression is a value or variable.
13192
13193         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13194         while resolving the corresponding blocks.
13195
13196         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13197         an error, don't silently return null.
13198
13199         * statement.cs (Block.AddVariable): Do the error reporting here
13200         and distinguish between CS0128 and CS0136.
13201         (Block.DoResolve): Report all unused labels (warning CS0164).
13202         (LabeledStatement): Pass the location to the constructor.
13203         (LabeledStatement.HasBeenReferenced): New property.
13204         (LabeledStatement.Resolve): Set it to true here.
13205
13206         * statement.cs (Return.Emit): Return success even after reporting
13207         a type mismatch error (CS0126 or CS0127), this is what csc does and
13208         it avoids confusing the users with any consecutive errors.
13209
13210 2002-08-05  Martin Baulig  <martin@gnome.org>
13211
13212         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13213
13214         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13215
13216         * expression.cs (MemberAccess.DoResolve): Silently return if an
13217         error has already been reported.
13218
13219         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13220         error has already been reported.
13221
13222 2002-08-05  Martin Baulig  <martin@gnome.org>
13223
13224         * statement.cs (UsageVector): Only initialize the `parameters'
13225         vector if we actually have any "out" parameters.
13226
13227 2002-08-05  Martin Baulig  <martin@gnome.org>
13228
13229         * expression.cs (Binary.ResolveOperator): When combining delegates,
13230         they must have the same type.
13231
13232 2002-08-05  Martin Baulig  <martin@gnome.org>
13233
13234         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13235         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13236         work with the ms runtime and we also don't need it: if we're a
13237         PropertyBuilder and not in the `indexer_arguments' hash, then we
13238         are a property and not an indexer.
13239
13240         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13241         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13242         since the latter one doesn't work with the ms runtime.
13243
13244 2002-08-03  Martin Baulig  <martin@gnome.org>
13245
13246         Fixed bugs #27998 and #22735.
13247
13248         * class.cs (Method.IsOperator): New public field.
13249         (Method.CheckBase): Report CS0111 if there's already a method
13250         with the same parameters in the current class.  Report CS0508 when
13251         attempting to change the return type of an inherited method.
13252         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13253         and it's not marked abstract or extern.
13254         (PropertyBase): New abstract base class for Property and Indexer.
13255         (PropertyBase.CheckBase): Moved here from Property and made it work
13256         for indexers.
13257         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13258         the same so we can reuse it there.
13259         (Property, Indexer): Derive from PropertyBase.
13260         (MethodSignature.inheritable_property_signature_filter): New delegate
13261         to find properties and indexers.
13262
13263         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13264         argument and improved error reporting.
13265
13266         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13267         EmptyReadOnlyParameters and made it a property.
13268
13269         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13270         version of this method which takes a `PropertyInfo indexer'.
13271         (TypeManager.RegisterIndexer): New method.
13272
13273         * class.cs: Added myself as author of this file :-)
13274
13275 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13276
13277         * class.cs: fixed compilation on windoze.
13278
13279 2002-08-03  Martin Baulig  <martin@gnome.org>
13280
13281         * interface.cs (Interface.GetInterfaceBases): Check whether all
13282         base interfaces are at least as accessible than the current one.
13283
13284         * class.cs (TypeContainer.GetClassBases): Check whether base types
13285         are at least as accessible than the current type.
13286         (TypeContainer.AsAccessible): Implemented and made non-static.
13287         (MemberBase.CheckParameters): Report errors if the accessibility
13288         checks fail.
13289
13290         * delegate.cs (Delegate.Delegate): The default visibility is
13291         internal for top-level types and private for nested types.
13292         (Delegate.Define): Report errors if the accessibility checks fail.
13293
13294         * enum.cs (Enum.Enum): The default visibility is internal for
13295         top-level types and private for nested types.
13296         (Enum.DefineType): Compute the correct visibility.
13297
13298         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13299         function which takes a `bool is_toplevel' instead of a TypeContainer.
13300
13301         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13302         builtin type.
13303
13304 2002-08-02  Martin Baulig  <martin@gnome.org>
13305
13306         * expression.cs (LocalVariableReferenc): Added constructor which
13307         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13308         (LocalVariableReference.IsReadOnly): New property.
13309         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13310         variable is readonly, use our own readonly flag to do this; you can
13311         use the new constructor to get a writable reference to a read-only
13312         variable.
13313
13314         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13315         reference to the local variable.
13316
13317 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13318
13319         * rootcontext.cs (ResolveCore): Also include System.Exception
13320
13321         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13322         we reach an EmptyStatement.
13323
13324         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13325         is also fine.
13326
13327         * expression.cs (Binary.ResolveOperator): Check error result in
13328         two places.
13329
13330         use brtrue/brfalse directly and avoid compares to null.
13331
13332 2002-08-02  Martin Baulig  <martin@gnome.org>
13333
13334         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13335         Fixes bug #28407, added test-155.cs.
13336
13337 2002-08-01  Martin Baulig  <martin@gnome.org>
13338
13339         * class.cs (Event.EmitDefaultMethod): Make this work with static
13340         events.  Fixes #28311, added verify-3.cs.
13341
13342 2002-08-01  Martin Baulig  <martin@gnome.org>
13343
13344         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13345         `is_disposable' fields.
13346         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13347         `hm.is_disposable' if we're using the collection pattern.
13348         (Foreach.EmitCollectionForeach): Use the correct type for the
13349         enumerator's local variable, only emit the try/finally block if
13350         necessary (fixes #27713).
13351
13352 2002-08-01  Martin Baulig  <martin@gnome.org>
13353
13354         * ecore.cs (Expression.report118): Renamed to Error118 and made
13355         it public static.
13356
13357         * statement.cs (Throw.Resolve): Check whether the expression is of
13358         the correct type (CS0118) and whether the type derives from
13359         System.Exception (CS0155).
13360         (Catch.Resolve): New method.  Do the type lookup here and check
13361         whether it derives from System.Exception (CS0155).
13362         (Catch.CatchType, Catch.IsGeneral): New public properties.
13363
13364         * typemanager.cs (TypeManager.exception_type): Added.
13365
13366 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13367
13368         * driver.cs: Updated About function.
13369
13370 2002-07-31  Martin Baulig  <martin@gnome.org>
13371
13372         Implemented Control Flow Analysis.
13373
13374         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13375         (EmitContext.CurrentBranching): Added.
13376         (EmitContext.StartFlowBranching): Added.
13377         (EmitContext.EndFlowBranching): Added.
13378         (EmitContext.KillFlowBranching): Added.
13379         (EmitContext.IsVariableAssigned): Added.
13380         (EmitContext.SetVariableAssigned): Added.
13381         (EmitContext.IsParameterAssigned): Added.
13382         (EmitContext.SetParameterAssigned): Added.
13383         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13384         Added control flow analysis stuff here.
13385
13386         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13387         resolve the expression as lvalue.
13388         (LocalVariableReference.DoResolve): Check whether the variable has
13389         already been assigned.
13390         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13391         the parameter as assigned here.
13392         (ParameterReference.DoResolve): Check whether the parameter has already
13393         been assigned.
13394         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13395         expression as lvalue.
13396
13397         * statement.cs (FlowBranching): New class for the flow analysis code.
13398         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13399         (LabeledStatement.IsDefined): New public property.
13400         (LabeledStatement.AddUsageVector): New public method to tell flow
13401         analyis that the label may be reached via a forward jump.
13402         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13403         flow analysis.
13404         (VariableInfo.Number): New public field.  This is used by flow analysis
13405         to number all locals of a block.
13406         (Block.CountVariables): New public property.  This is the number of
13407         local variables in this block (including the locals from all parent
13408         blocks).
13409         (Block.EmitMeta): Number all the variables.
13410
13411         * statement.cs: Added flow analysis support to all classes.
13412
13413 2002-07-31  Martin Baulig  <martin@gnome.org>
13414
13415         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13416         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13417         then use this argument.
13418
13419         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13420
13421         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13422         use this to specify /define options.
13423
13424 2002-07-29  Martin Baulig  <martin@gnome.org>
13425
13426         * statement.cs (Fixed): Moved all code that does variable lookups
13427         and resolvings from Emit to Resolve.
13428
13429         * statement.cs (For): Moved all code that does variable lookups
13430         and resolvings from Emit to Resolve.
13431
13432         * statement.cs (Using): Moved all code that does variable lookups
13433         and resolvings from Emit to Resolve.
13434
13435 2002-07-29  Martin Baulig  <martin@gnome.org>
13436
13437         * attribute.cs (Attribute.Resolve): Explicitly catch a
13438         System.NullReferenceException when creating the
13439         CustromAttributeBuilder and report a different warning message.
13440
13441 2002-07-29  Martin Baulig  <martin@gnome.org>
13442
13443         * support.cs (ParameterData.ParameterName): Added method to
13444         get the name of a parameter.
13445
13446         * typemanager.cs (TypeManager.IsValueType): New public method.
13447
13448 2002-07-29  Martin Baulig  <martin@gnome.org>
13449
13450         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13451         is a flag which specifies that it's either ref or out.
13452         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13453         the out parameter to `out Parameter.Modifier mod', also set the
13454         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13455
13456         * support.cs (InternalParameters.ParameterModifier): Distinguish
13457         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13458         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13459
13460         * expression.cs (Argument.GetParameterModifier): Distinguish
13461         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13462         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13463
13464 2002-07-29  Martin Baulig  <martin@gnome.org>
13465
13466         * expression.cs (ParameterReference.ParameterReference): Added
13467         `Location loc' argument to the constructor.
13468
13469         * cs-parser.jay: Pass location to ParameterReference.
13470
13471 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13472
13473         * statement.cs (Try): Initialize the location.
13474
13475         * cs-parser.jay: pass location to Try.
13476
13477         * expression.cs (Unary.Reduce): Change the prototype to return
13478         whether a constant fold could be performed or not.  The result is
13479         returned in an out parameters.  In the case of Indirection and
13480         AddressOf, we want to perform the full tests.
13481
13482 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13483
13484         * statement.cs (Statement.Emit): Flag dead code.
13485
13486 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13487
13488         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13489
13490 2002-07-27  Martin Baulig  <martin@gnome.org>
13491
13492         * class.cs (MethodData.Define): Put back call to
13493         TypeManager.AddMethod(), accidentally commented this out.
13494
13495         * report.cs (Debug): New public method to print debugging information,
13496         this is `[Conditional ("DEBUG")]'.
13497
13498 2002-07-26  Martin Baulig  <martin@gnome.org>
13499
13500         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13501         (switch_statement): Push the current_block to the switch_stack and
13502         pop it again when we're done with the switch.
13503         (switch_section): The new block is a child of the current_block.
13504         Fixes bug #24007, added test-152.cs.
13505
13506 2002-07-27  Martin Baulig  <martin@gnome.org>
13507
13508         * expression.cs (Invocation.EmitArguments): When calling a varargs
13509         function with only its fixed arguments, we need to pass an empty
13510         array.
13511
13512 2002-07-27  Martin Baulig  <martin@gnome.org>
13513
13514         Mono 0.13 has been released.
13515
13516 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13517
13518         * driver.cs: Rename --resource to --linkres, because that is what
13519         we do currently, we dont support --resource yet.
13520
13521         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13522
13523 2002-07-25  Martin Baulig  <martin@gnome.org>
13524
13525         * class.cs (MethodData): New public class.  This is a `method builder'
13526         class for a method or one accessor of a Property/Indexer/Event.
13527         (MethodData.GetMethodFlags): Moved here from MemberBase.
13528         (MethodData.ApplyAttributes): Likewise.
13529         (MethodData.ApplyObsoleteAttribute): Likewise.
13530         (MethodData.ApplyConditionalAttribute): Likewise.
13531         (MethodData.ApplyDllImportAttribute): Likewise.
13532         (MethodData.CheckAbstractAndExternal): Likewise.
13533         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13534         (MethodData.Emit): Formerly known as Method.Emit().
13535         (MemberBase): Moved everything which was specific to a single
13536         accessor/method to MethodData.
13537         (Method): Create a new MethodData and call Define() and Emit() on it.
13538         (Property, Indexer, Event): Create a new MethodData objects for each
13539         accessor and call Define() and Emit() on them.
13540
13541 2002-07-25  Martin Baulig  <martin@gnome.org>
13542
13543         Made MethodCore derive from MemberBase to reuse the code from there.
13544         MemberBase now also checks for attributes.
13545
13546         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13547         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13548         as virtual.
13549         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13550         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13551         (MemberBase.ApplyAttributes): New virtual method; applies the
13552         attributes to a method or accessor.
13553         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13554         (MemberBase.ApplyConditionalAttribute): Likewise.
13555         (MemberBase.ApplyDllImportAttribute): Likewise.
13556         (MemberBase.CheckAbstractAndExternal): Likewise.
13557         (MethodCore.ParameterTypes): This is now a property instead of a
13558         method, it's initialized from DoDefineParameters().
13559         (MethodCore.ParameterInfo): Removed the set accessor.
13560         (MethodCore.DoDefineParameters): New protected virtual method to
13561         initialize ParameterTypes and ParameterInfo.
13562         (Method.GetReturnType): We can now simply return the MemberType.
13563         (Method.GetMethodFlags): Override the MemberBase version and add
13564         the conditional flags.
13565         (Method.CheckBase): Moved some code from Define() here, call
13566         DoDefineParameters() here.
13567         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13568         here to avoid some larger code duplication.
13569         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13570         ensure that abstract and external accessors don't declare a body.
13571
13572         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13573         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13574         lookup in the attribute's parent classes, so we need to abort as soon
13575         as we found the first match.
13576         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13577         the attribute has no arguments.
13578
13579         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13580         of a Method.
13581
13582 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13583
13584         * cs-parser.jay: reverted previous patch.
13585
13586 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13587
13588         * cs-parser.jay: fixed bug #22119.
13589
13590 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13591
13592         * attribute.cs: fixed compilation. The error was:
13593         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13594         be assigned to before control leaves the current method."
13595         [FIXME:  Filed as bug #28186: MCS must report this error.]
13596
13597 2002-07-25  Martin Baulig  <martin@gnome.org>
13598
13599         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13600         method to pull the condition name ouf of a Conditional attribute.
13601         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13602         the obsolete message and error flag out of an Obsolete attribute.
13603
13604         * class.cs (Method.GetMethodFlags): New public method to get the
13605         TypeManager.MethodFlags for this method.
13606         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13607         private methods.
13608         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13609         if we're overriding a virtual function, set the new private variable
13610         `parent_method'; call the new TypeManager.AddMethod().
13611
13612         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13613         the MethodBuilder and the Method in a PtrHashtable.
13614         (TypeManager.builder_to_method): Added for this purpose.
13615         (TypeManager.MethodFlags): Added IsObsoleteError.
13616         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13617         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13618         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13619         the message from the attribute.
13620
13621 2002-07-24  Martin Baulig  <martin@gnome.org>
13622
13623         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13624         preprocessor directives, ensure that the argument to #define/#undef is
13625         exactly one identifier and that it's actually an identifier.
13626
13627         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13628         did not work ....
13629
13630 2002-07-24  Martin Baulig  <martin@gnome.org>
13631
13632         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13633         initialize it to TypeManager.object_type in the constructor.
13634         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13635         of the `hm.get_current' method if we're using the collection pattern.
13636         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13637         for the explicit conversion to make it work when we're using the collection
13638         pattern and the `Current' property has a different return type than `object'.
13639         Fixes #27713.
13640
13641 2002-07-24  Martin Baulig  <martin@gnome.org>
13642
13643         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13644         does not match, but don't report any errors.  This method is called in
13645         order for all methods in a MethodGroupExpr until a matching method is
13646         found, so we don't want to bail out if the first method doesn't match.
13647         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13648         matches, report the 123.  Fixes #28070.
13649
13650 2002-07-24  Martin Baulig  <martin@gnome.org>
13651
13652         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13653         TypeManager.TypeToCoreType() to the top of the method so the
13654         following equality checks will work.  Fixes #28107.
13655
13656 2002-07-24  Martin Baulig  <martin@gnome.org>
13657
13658         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13659         operand is of type uint, and the other operand is of type sbyte,
13660         short or int, the operands are converted to type long." -
13661         Actually do what this comment already told us.  Fixes bug #28106,
13662         added test-150.cs.
13663
13664 2002-07-24  Martin Baulig  <martin@gnome.org>
13665
13666         * class.cs (MethodBase): New abstract class.  This is now a base
13667         class for Property, Indexer and Event to avoid some code duplication
13668         in their Define() and DefineMethods() methods.
13669         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13670         generic methods for Define() and DefineMethods().
13671         (FieldBase): Derive from MemberBase, not MemberCore.
13672         (Property): Derive from MemberBase, not MemberCore.
13673         (Property.DefineMethod): Moved all the code from this method to the
13674         new MethodBase.DefineAccessor(), just call it with appropriate
13675         argumetnts.
13676         (Property.Define): Call the new Property.DoDefine(), this does some
13677         sanity checks and we don't need to duplicate the code everywhere.
13678         (Event): Derive from MemberBase, not MemberCore.
13679         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13680         accessors, this will also make them work with interface events.
13681         (Indexer): Derive from MemberBase, not MemberCore.
13682         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13683         (Indexer.Define): Use the new MethodBase functions.
13684
13685         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13686         argument to the constructor.
13687         (Interface.FindMembers): Added support for interface events.
13688         (Interface.PopluateEvent): Implemented.
13689
13690         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13691
13692 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13693
13694         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13695         but this is required to check for a method name being the same as
13696         the containing class.  
13697
13698         Handle this now.
13699
13700 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13701
13702         * interface.cs: initialize variable.
13703
13704 2002-07-23  Martin Baulig  <martin@gnome.org>
13705
13706         Implemented the IndexerName attribute in interfaces.
13707
13708         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13709         name if this is an explicit interface implementation.
13710         (Indexer.InterfaceIndexerName): New public variable.  If we're
13711         implementing an interface indexer, this is the IndexerName in that
13712         interface.  Otherwise, it's the IndexerName.
13713         (Indexer.DefineMethod): If we're implementing interface indexer,
13714         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13715         and Pending.ImplementIndexer methods.
13716         (Indexer.Define): Also define the PropertyBuilder if we're
13717         implementing an interface indexer and this is neither an explicit
13718         interface implementation nor do the IndexerName match the one in
13719         the interface.
13720
13721         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13722         If a method is defined here, then we always need to create a proxy
13723         for it.  This is used when implementing interface indexers.
13724         (Pending.IsInterfaceIndexer): New public method.
13725         (Pending.ImplementIndexer): New public method.
13726         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13727         This is used when implementing interface indexers to define a proxy
13728         if necessary.
13729         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13730         define a proxy if necessary.
13731
13732         * interface.cs (Interface.IndexerName): New public variable.
13733         (Interface.PopulateIndexer): Set the IndexerName.
13734         (Interface.DefineIndexers): New private method.  Populate all the
13735         indexers and make sure their IndexerNames match.
13736
13737         * typemanager.cs (IndexerPropertyName): Added support for interface
13738         indexers.
13739
13740 2002-07-22  Martin Baulig  <martin@gnome.org>
13741
13742         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13743         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13744         ret if HasReturnLabel.
13745         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13746         variables.
13747
13748         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13749         and set the ec.LoopBeginTryCatchLevel.
13750         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13751         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13752         the current ec.TryCatchLevel, the branch goes out of an exception
13753         block.  In this case, we need to use Leave and not Br.
13754
13755 2002-07-22  Martin Baulig  <martin@gnome.org>
13756
13757         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13758         block unless the block does not always return or it is contained in
13759         another try { ... } catch { ... } block.  Fixes bug #26506.
13760         Added verify-1.cs to the test suite.
13761
13762 2002-07-22  Martin Baulig  <martin@gnome.org>
13763
13764         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13765         then we do not always return.  Fixes bug #24985.
13766
13767 2002-07-22  Martin Baulig  <martin@gnome.org>
13768
13769         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13770         lookup on a per-class level; ie. walk up the class hierarchy until we
13771         found at least one applicable method, then choose the best among them.
13772         Fixes bug #24463 and test-29.cs.
13773
13774 2002-07-22  Martin Baulig  <martin@gnome.org>
13775
13776         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13777         return types of the methods.  The return type is not part of the
13778         signature and we must not check it to make the `new' modifier work.
13779         Fixes bug #27999, also added test-147.cs.
13780         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13781
13782         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13783         on the method's return type.
13784
13785 2002-07-21  Martin Baulig  <martin@gnome.org>
13786
13787         * assign.cs: Make this work if the rightmost source is a constant and
13788         we need to do an implicit type conversion.  Also adding a few more tests
13789         to test-38.cs which should have caught this.
13790
13791         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13792         target in the makefile for this.  The makefile.gnu is primarily intended
13793         for end-users who don't want to debug the compiler.
13794
13795 2002-07-21  Martin Baulig  <martin@gnome.org>
13796
13797         * assign.cs: Improved the Assign class so it can now handle embedded
13798         assignments (X = Y = Z = something).  As a side-effect this'll now also
13799         consume less local variables.  test-38.cs now passes with MCS, added
13800         a few new test cases to that test.
13801
13802 2002-07-20  Martin Baulig  <martin@gnome.org>
13803
13804         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13805         instructions.  Fixes bug #27977, also added test-146.cs.
13806
13807 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13808
13809         * cs-tokenizer.cs: fixed getHex ().
13810
13811 2002-07-19  Martin Baulig  <martin@gnome.org>
13812
13813         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13814         not Type.GetType() to lookup the array type.  This is needed when
13815         we're constructing an array of a user-defined type.
13816         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13817         single-dimensional arrays, but also for single-dimensial arrays of
13818         type decimal.
13819
13820 2002-07-19  Martin Baulig  <martin@gnome.org>
13821
13822         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13823         this function is called, it's not allowed to share LocalBuilders
13824         among ILGenerators.
13825
13826 2002-07-19  Martin Baulig  <martin@gnome.org>
13827
13828         * expression.cs (Argument.Resolve): Report an error 118 when trying
13829         to pass a type as argument.
13830
13831 2002-07-18  Martin Baulig  <martin@gnome.org>
13832
13833         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13834         Conv_R_Un for the signed `long' type.
13835
13836 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13837
13838         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13839         `expr' for the temporary result, as that will fail if we do
13840         multiple resolves on the same expression.
13841
13842 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13845         ec.TypeContainer for looking up aliases. 
13846
13847         * class.cs (TypeContainer): Remove LookupAlias from here.
13848
13849         * decl.cs (DeclSpace); Move here.
13850
13851 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13852
13853         * class.cs (FindMembers): Only call filter if the constructor
13854         bulider is not null.
13855
13856         Also handle delegates in `NestedTypes' now.  Now we will perform
13857         type lookups using the standard resolution process.  This also
13858         fixes a bug.
13859
13860         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13861         This uses Expressions (the limited kind that can be parsed by the
13862         tree) instead of strings.
13863
13864         * expression.cs (ComposedCast.ToString): Implement, used to flag
13865         errors since now we have to render expressions.
13866
13867         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13868         FormArrayType. 
13869
13870         * ecore.cs (SimpleName.ToString): ditto.
13871
13872         * cs-parser.jay: Instead of using strings to assemble types, use
13873         Expressions to assemble the type (using SimpleName, ComposedCast,
13874         MemberAccess).  This should fix the type lookups in declarations,
13875         because we were using a different code path for this.
13876
13877         * statement.cs (Block.Resolve): Continue processing statements
13878         even when there is an error.
13879
13880 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13881
13882         * class.cs (Event.Define): Also remove the `remove' method from
13883         the list of pending items.
13884
13885         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13886         generate more compact code. 
13887
13888 2002-07-17  Martin Baulig  <martin@gnome.org>
13889
13890         * const.cs (Const.LookupConstantValue): Add support for constant
13891         `unchecked' and `checked' expressions.
13892         Also adding test case test-140.cs for this.
13893
13894 2002-07-17  Martin Baulig  <martin@gnome.org>
13895
13896         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13897         check whether mi.ReturnType implements the IEnumerator interface; the
13898         `==' and the IsAssignableFrom() will fail in this situation.
13899
13900 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13901
13902         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13903         here too.
13904
13905 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13906
13907         * expression.cs: fixed bug #27811.
13908
13909 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13910
13911         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13912         Molaro: when we are a ref, the value already contains a pointer
13913         value, do not take the address of it.
13914
13915 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13916         * removed mb-parser.jay and mb-tokenizer.cs
13917
13918 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13919
13920         * expression.cs: check against the building corlib void type.
13921
13922 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13923
13924         * ecore.cs: fix for valuetype static readonly fields: when 
13925         initializing them, we need their address, not the address of a copy.
13926
13927 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13928
13929         * typemanager.cs: register also enum_type in corlib.
13930
13931 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13932
13933         * class.cs: allow calling this (but not base) initializers in structs.
13934
13935 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13936
13937         * ecore.cs: make sure we compare against the building base types
13938         in GetTypeSize ().
13939
13940 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13941
13942         * typemanager.cs: fix TypeToCoreType() to handle void and object
13943         (corlib gets no more typerefs after this change).
13944
13945 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13946
13947         * expression.cs (ArrayCreation.EmitArrayArguments): use
13948         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13949
13950         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13951         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13952         array indexes, the runtime actually forbids them.
13953
13954         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13955         for array arguments here.
13956
13957         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13958         instead of the default for ValueTypes.
13959
13960         (New.DoEmit): Use IsValueType instead of
13961         IsSubclassOf (value_type)
13962         (New.DoResolve): ditto.
13963         (Invocation.EmitCall): ditto.
13964
13965         * assign.cs (Assign): ditto.
13966
13967         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13968         Statements *are* currently doing part of their resolution during
13969         Emit.  
13970
13971         Expressions do always resolve during resolve, but statements are
13972         only required to propagate resolution to their children.
13973
13974 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13977
13978         (LoadAssembly): Do not add the dll if it is already specified
13979
13980         (MainDriver): Add the System directory to the link path at the end,
13981         after all the other -L arguments. 
13982
13983         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13984         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13985         ldelem.u1) and using the opposite for sbytes.
13986
13987         This fixes Digger, and we can finally run it.
13988
13989         * driver.cs (UnixParseOption): Move the option parsing here.  
13990         (CSCParseOption): Implement CSC-like parsing of options.
13991
13992         We now support both modes of operation, the old Unix way, and the
13993         new CSC-like way.  This should help those who wanted to make cross
13994         platform makefiles.
13995
13996         The only thing broken is that /r:, /reference: and /lib: are not
13997         implemented, because I want to make those have the same semantics
13998         as the CSC compiler has, and kill once and for all the confussion
13999         around this.   Will be doing this tomorrow.
14000
14001         * statement.cs (Unsafe.Resolve): The state is checked during
14002         resolve, not emit, so we have to set the flags for IsUnsfe here.
14003
14004 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14005
14006         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14007         not catch the Error_ObjectRefRequired in SimpleName (as it is
14008         possible to have a class/instance variable name that later gets
14009         deambiguated), we have to check this here.      
14010
14011 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14012
14013         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14014         make static and put into Expression.
14015
14016         (Event.Define): Register the private field of the event with the 
14017         TypeManager so that GetFieldFromEvent can get at it.
14018
14019         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14020         keep track of the private field associated with an event which
14021         has no accessors.
14022
14023         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14024         private field.
14025
14026         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14027
14028 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14029
14030         * expression.cs (Binary.EmitBranchable): this routine emits the
14031         Binary expression in a branchable context.  This basically means:
14032         we need to branch somewhere, not just get the value on the stack.
14033
14034         This works together with Statement.EmitBoolExpression.
14035
14036         * statement.cs (Statement.EmitBoolExpression): Use
14037         EmitBranchable. 
14038
14039 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14040
14041         * statement.cs (For): Reduce the number of jumps in loops.
14042
14043         (For): Implement loop inversion for the For statement.
14044
14045         (Break): We can be breaking out of a Try/Catch controlled section
14046         (foreach might have an implicit try/catch clause), so we need to
14047         use Leave instead of Br.
14048
14049         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14050         now).  If the instace expression supports IMemoryLocation, we use
14051         the AddressOf method from the IMemoryLocation to extract the
14052         address instead of emitting the instance.
14053
14054         This showed up with `This', as we were emitting the instance
14055         always (Emit) instead of the Address of This.  Particularly
14056         interesting when This is a value type, as we dont want the Emit
14057         effect (which was to load the object).
14058
14059 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14060
14061         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14062
14063         * statement.cs (Checked): Set the CheckedState during the resolve
14064         process too, as the ConvCast operations track the checked state on
14065         the resolve process, and not emit.
14066
14067         * cs-parser.jay (namespace_member_declaration): Flag that we have
14068         found a declaration when we do.  This is used to flag error 1529
14069
14070         * driver.cs: Report ok when we display the help only.
14071
14072 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14073
14074         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14075
14076 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14077
14078         * cs-tokenizer.cs (define): We also have to track locally the
14079         defines.  AllDefines is just used for the Conditional Attribute,
14080         but we also need the local defines for the current source code. 
14081
14082 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14083
14084         * statement.cs (While, For, Do): These loops can exit through a
14085         Break statement, use this information to tell whether the
14086         statement is the last piece of code.
14087
14088         (Break): Flag that we break.
14089
14090         * codegen.cs (EmitContexts): New `Breaks' state variable.
14091
14092 2002-07-03  Martin Baulig  <martin@gnome.org>
14093
14094         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14095         modifiers in method declarations in structs.  Otherwise, you won't
14096         be able to override things like Object.Equals().
14097
14098 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14099
14100         * class.cs (Method, Property, Indexer): Do not allow the public
14101         modifier to be used in explicit interface implementations.
14102
14103         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14104         override modifiers in method declarations in structs
14105
14106 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14107
14108         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14109         integer or real overflow, report an error
14110
14111 2002-07-02  Martin Baulig  <martin@gnome.org>
14112
14113         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14114         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14115         to tell the runtime about our newly created System.Object and
14116         System.ValueType types.
14117
14118 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14119
14120         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14121         struct instead of Ldarg/Starg.
14122
14123 2002-07-02  Martin Baulig  <martin@gnome.org>
14124
14125         * expression.cs (Indirection.Indirection): Call
14126         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14127
14128 2002-07-02  Martin Baulig  <martin@gnome.org>
14129
14130         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14131         ValueType, call TypeManager.TypeToCoreType() on it.
14132         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14133         the OpCodes.Newarr argument.
14134
14135 2002-07-02  Martin Baulig  <martin@gnome.org>
14136
14137         * expression.cs (Invocation.EmitCall): When compiling corlib,
14138         replace all calls to the system's System.Array type to calls to
14139         the newly created one.
14140
14141         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14142         System.Array methods.
14143         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14144         from the system's System.Array type which must be replaced.
14145
14146 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14147
14148         * typemanager.cs: load unverifiable_code_ctor so we can build
14149         corlib using the correct type. Avoid using GetTypeCode() with
14150         TypeBuilders.
14151         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14152         TypeManager.object_type to allow building corlib.
14153
14154 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14155
14156         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14157
14158 2002-07-01  Martin Baulig  <martin@gnome.org>
14159
14160         * class.cs: Make the last change actually work, we need to check
14161         whether `ifaces != null' to avoid a crash.
14162
14163 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14164
14165         * class.cs: when we build structs without fields that implement
14166         interfaces, we need to add the interfaces separately, since there is
14167         no API to both set the size and add the interfaces at type creation
14168         time.
14169
14170 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14171
14172         * expression.cs: the dimension arguments to the array constructors
14173         need to be converted if they are a long.
14174
14175 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14176
14177         * class.cs: don't emit ldarg.0 if there is no parent constructor
14178         (fixes showstopper for corlib).
14179
14180 2002-06-29  Martin Baulig  <martin@gnome.org>
14181
14182         MCS now compiles corlib on GNU/Linux :-)
14183
14184         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14185         ie. check for MethodImplOptions.InternalCall.
14186
14187         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14188         and TypeManager.attribute_type are null, so we must explicitly check
14189         whether parent is not null to find out whether it's an attribute type.
14190         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14191         and SetBuilder, not only if the property is neither abstract nor external.
14192         This is necessary to set the MethodImplOptions on the accessor methods.
14193         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14194         SetBuilder, see Property.Emit().
14195
14196         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14197         populate "System.Object", "System.ValueType" and "System.Attribute" since
14198         they've already been populated from BootCorlib_PopulateCoreTypes().
14199
14200 2002-06-29  Martin Baulig  <martin@gnome.org>
14201
14202         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14203         is the NullLiteral, we also need to make sure that target_type is not
14204         an enum type.   
14205
14206 2002-06-29  Martin Baulig  <martin@gnome.org>
14207
14208         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14209         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14210         before calling BootstrapCorlib_ResolveDelegate ().
14211
14212 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14213
14214         * statement.cs: fixed build-breaker. All tests passed ok.
14215
14216 2002-06-27  Martin Baulig  <martin@gnome.org>
14217
14218         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14219         for System.Decimal when compiling corlib.
14220
14221 2002-06-27  Martin Baulig  <martin@gnome.org>
14222
14223         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14224         switch blocks which contain nothing but a default clause.
14225
14226 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14227
14228        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14229
14230 2002-06-27  Martin Baulig  <martin@gnome.org>
14231
14232         * ecore.cs (PropertyExpr.PropertyExpr): Call
14233         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14234
14235         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14236         is already a TypeBuilder.
14237
14238 2002-06-27  Martin Baulig  <martin@gnome.org>
14239
14240         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14241         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14242         the "from an array-type to System.Array" case.  This makes it work
14243         when compiling corlib.
14244
14245 2002-06-27  Martin Baulig  <martin@gnome.org>
14246
14247         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14248         non-static PropertyExpr, set its InstanceExpression.  This makes
14249         the `ICollection.Count' property work in System/Array.cs.
14250
14251 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14252
14253         * driver.cs: Made error handling more consistent.  Errors now
14254         tracked by Report class, so many methods which used to return int
14255         now return void.  Main() now prints success/failure and 
14256         errors/warnings message.
14257
14258         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14259         the magic number return values (123 and 124).  Now, if the
14260         expected error occurs, the compiler exits with success (exit value
14261         0).  If the compilation completes without seeing that particular
14262         error, the compiler exits with failure (exit value 1).  The
14263         makefile in mcs/errors has been changed to handle the new behaviour.
14264
14265         * report.cs: Made 'expected error' number a property and renamed
14266         it from 'Probe' to 'ExpectedError'.
14267
14268         * genericparser.cs: Removed error handling support, since it is
14269         now all done by Report class.
14270
14271         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14272         class, so parse() no longer returns an int.
14273
14274         * namespace.cs: Use Report.Error instead of GenericParser.error
14275
14276 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14277
14278         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14279         TypeContainer.AddOperator): At the front of the list put the
14280         explicit implementations, so they get resolved/defined first. 
14281
14282 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14283
14284         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14285         interface type is implemented by this TypeContainer.  Used during
14286         explicit interface implementation.
14287
14288         (Property.Define, Indexer.Define, Method.Define): Validate that
14289         the given interface in the explicit implementation is one of the
14290         base classes for the containing type.
14291
14292         Also if we are explicitly implementing an interface, but there is
14293         no match in the pending implementation table, report an error.
14294
14295         (Property.Define): Only define the property if we are
14296         not explicitly implementing a property from an interface.  Use the
14297         correct name also for those properties (the same CSC uses,
14298         although that is really not needed).
14299
14300         (Property.Emit): Do not emit attributes for explicitly implemented
14301         properties, as there is no TypeBuilder.
14302
14303         (Indexer.Emit): ditto.
14304
14305         Hiding then means that we do not really *implement* a pending
14306         implementation, which makes code fail.
14307
14308 2002-06-22  Martin Baulig  <martin@gnome.org>
14309
14310         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14311         the return value of Object.GetType().  [FIXME: we need to do this whenever
14312         we get a type back from the reflection library].
14313
14314 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14315
14316         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14317
14318 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * attribute.cs: Return null if we can not look up the type.
14321
14322         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14323         the interface types found.
14324
14325         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14326         interface types found.
14327
14328         * typemanager.cs (GetInterfaces): Make this routine returns alll
14329         the interfaces and work around the lame differences between
14330         System.Type and System.Reflection.Emit.TypeBuilder in the results
14331         result for GetInterfaces.
14332
14333         (ExpandInterfaces): Given an array of interface types, expand and
14334         eliminate repeated ocurrences of an interface.  This expands in
14335         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14336         be IA, IB, IC.
14337
14338 2002-06-21  Martin Baulig  <martin@gnome.org>
14339
14340         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14341         on System.Enum.
14342
14343 2002-06-21  Martin Baulig  <martin@gnome.org>
14344
14345         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14346         and called with one of the core types, return the corresponding typebuilder for
14347         that type.
14348
14349         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14350         element type.
14351
14352 2002-06-21  Martin Baulig  <martin@gnome.org>
14353
14354         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14355         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14356         (Expression.ConvertReferenceExplicit): Likewise.
14357
14358         * expression.cs (ElementAccess.DoResolve): Likewise.
14359         (ElementAccess.DoResolveLValue): Likewise.
14360
14361 2002-06-10  Martin Baulig  <martin@gnome.org>
14362
14363         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14364         add the "value" parameter to the parameter list.
14365
14366         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14367         to our caller.
14368
14369 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14372         the argument to an int, uint, long or ulong, per the spec.  Also
14373         catch negative constants in array creation.
14374
14375 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14376
14377         * class.cs: do not allow the same interface to appear twice in
14378         the definition list.
14379
14380 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14381
14382         * ecore.cs: don't use ldlen with System.Array.
14383
14384 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14385
14386         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14387
14388 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14389
14390         * modifiers.cs: produce correct field attributes for protected
14391         internal. Easy fix so miguel can work on ther harder stuff:-)
14392
14393 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14394
14395         * pending.cs: New file.  Move the code from class.cs here.
14396         Support clearning the pending flag for all methods (when not doing
14397         explicit interface implementation).
14398
14399 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14400
14401         * rootcontext.cs: added a couple more types needed to bootstrap.
14402
14403 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14404
14405         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14406         constructor in the type, instead of any constructor in the type
14407         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14408         a bug in the Mono runtime when applying the params attribute). 
14409
14410 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14411         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14412
14413 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14414
14415         * expression.cs (Unary.ResolveOperator): Use TypeManager
14416         to resolve the type.
14417
14418 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14419
14420         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14421         attached.
14422
14423         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14424         with each member too.
14425
14426         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14427         field builders too - this takes care of the enum member case.
14428
14429 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14430
14431         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14432         address-of operator on both value types and pointers.
14433
14434 2002-06-10  Martin Baulig  <martin@gnome.org>
14435
14436         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14437         PropertyBuilder to the `property_builders' list.
14438
14439         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14440         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14441         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14442         find any indexers which are inherited from an interface.
14443
14444 2002-06-09  Martin Baulig  <martin@gnome.org>
14445
14446         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14447         the same type as the constant if necessary.  There's also a test-130.cs
14448         for this.
14449
14450         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14451
14452         * typemanager.cs (TypeManager.ChangeType): Previously known as
14453         Enum.ChangeEnumType().
14454
14455 2002-06-09  Martin Baulig  <martin@gnome.org>
14456
14457         * expression.cs (Cast.TryReduce): Added support for consts.
14458
14459 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14460
14461         * class.cs (Accessor): Hold attributes information so we can pass
14462         it along.
14463
14464         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14465         Modify to pass in attributes attached to the methods.
14466
14467         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14468
14469         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14470         to handle the Accessor kind :-)
14471
14472         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14473
14474 2002-06-08  Martin Baulig  <martin@gnome.org>
14475
14476         * expression.cs (Unary.TryReduceNegative): Added support for
14477         ULongConstants.
14478
14479 2002-06-08  Martin Baulig  <martin@gnome.org>
14480
14481         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14482         name can't be found in the `defined_names' - the caller will do a
14483         MemberLookup in this case and thus find methods in System.Enum
14484         such as Enum.IsDefined().
14485
14486 2002-06-08  Martin Baulig  <martin@gnome.org>
14487
14488         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14489         Convert.ChangeType() which works with TypeBuilder created types.
14490         (Enum.LookupEnumValue, Enum.Define): Use it here.
14491
14492         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14493         `TypeBuilder.BaseType != null' check.
14494         (TypeContainer.FindMembers): Only lookup parent members if we
14495         actually have a parent.
14496         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14497         (ConstructorInitializer.Resolve): Likewise.
14498
14499         * interface.cs (Interface.FindMembers): Added
14500         `TypeBuilder.BaseType != null' check.
14501
14502         * rootcontext.cs (RootContext.ResolveCore): Added
14503         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14504         classes_second_stage.
14505
14506         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14507         debug_type and trace_type when compiling with --nostdlib.       
14508
14509 2002-06-07  Martin Baulig  <martin@gnome.org>
14510
14511         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14512         (AddField): Set it to true when adding a non-static field.
14513         (DefineType): Use `have_nonstatic_fields' to find out whether we
14514         have non-static fields, not `Fields != null'.
14515
14516 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14517
14518         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14519         dereferencing a null on the static-field code path)
14520
14521 2002-05-30  Martin Baulig  <martin@gnome.org>
14522
14523         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14524         to take command line arguments.  Use reflection to call the new
14525         custom `Initialize' function on the symbol writer and pass it the
14526         command line arguments.
14527
14528         * driver.cs (--debug-args): New command line argument to pass command
14529         line arguments to the symbol writer.
14530
14531 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14532
14533         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14534         the target type for indexers and properties.  Thanks to Joe for
14535         catching this.
14536
14537 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14538
14539         * typemanager.cs (MethodFlags): returns the method flags
14540         (Obsolete/ShouldIgnore) that control warning emission and whether
14541         the invocation should be made, or ignored. 
14542
14543         * expression.cs (Invocation.Emit): Remove previous hack, we should
14544         not do this on matching a base type, we should do this based on an attribute
14545
14546         Only emit calls to System.Diagnostics.Debug and
14547         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14548         on the command line.
14549
14550         * rootcontext.cs: Global settings for tracing and debugging.
14551
14552         * cs-tokenizer.cs (define): New utility function to track
14553         defines.   Set the global settings for TRACE and DEBUG if found.
14554
14555 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14556
14557         * interface.cs (Populate*): Pass in the TypeContainer as well as
14558         the DeclSpace as parameters so that we can create EmitContexts and
14559         then use that to apply attributes etc.
14560
14561         (PopulateMethod, PopulateEvent, PopulateProperty)
14562         (PopulateIndexer): Apply attributes everywhere.
14563
14564         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14565         etc.
14566
14567         (ApplyAttributes): Update accordingly.
14568
14569         We now apply interface attributes for all members too.
14570
14571 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14572
14573         * class.cs (Indexer.Define); Correctly check if we are explicit
14574         implementation (instead of checking the Name for a ".", we
14575         directly look up if the InterfaceType was specified).
14576
14577         Delay the creation of the PropertyBuilder.
14578
14579         Only create the PropertyBuilder if we are not an explicit
14580         interface implementation.   This means that explicit interface
14581         implementation members do not participate in regular function
14582         lookups, and hence fixes another major ambiguity problem in
14583         overload resolution (that was the visible effect).
14584
14585         (DefineMethod): Return whether we are doing an interface
14586         implementation. 
14587
14588         * typemanager.cs: Temporary hack until we get attributes in
14589         interfaces (Ravi is working on that) and we get IndexerName
14590         support in interfaces.
14591
14592         * interface.cs: Register the indexers as properties.
14593
14594         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14595         warning, I have verified that this is a bug in the .NET runtime
14596         (JavaScript suffers of the same problem).
14597
14598         * typemanager.cs (MemberLookup): When looking up members for
14599         interfaces, the parent of an interface is the implicit
14600         System.Object (so we succeed in searches of Object methods in an
14601         interface method invocation.  Example:  IEnumerable x;  x.ToString
14602         ()) 
14603
14604 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14605
14606         * class.cs (Event): Events should also register if they do
14607         implement the methods that an interface requires.
14608
14609         * typemanager.cs (MemberLookup); use the new GetInterfaces
14610         method. 
14611
14612         (GetInterfaces): The code used to lookup interfaces for a type is
14613         used in more than one place, factor it here. 
14614
14615         * driver.cs: Track the errors at the bottom of the file, we kept
14616         on going.
14617
14618         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14619         instance if the method we are calling is static!
14620
14621 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14622
14623         * attribute.cs (ApplyAttributes): Make this function filter out
14624         the IndexerName attribute (as that attribute in reality is never
14625         applied) and return the string constant for the IndexerName
14626         attribute. 
14627
14628         * class.cs (TypeContainer.Emit): Validate that all the indexers
14629         have the same IndexerName attribute, and if so, set the
14630         DefaultName attribute on the class. 
14631
14632         * typemanager.cs: The return value might contain other stuff (not
14633         only methods).  For instance, consider a method with an "Item"
14634         property and an Item method.
14635
14636         * class.cs: If there is a problem with the parameter types,
14637         return. 
14638
14639 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14640
14641         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14642         looks at user defined conversion after making a call to 
14643         StandardConversionExists - we need this for overload resolution.
14644
14645         * expression.cs : Update accordingly the various method calls.
14646
14647         This fixes 2 bugs filed against implicit user defined conversions 
14648
14649 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14650
14651         * statement.cs: Track the result of the assignment.
14652
14653 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14654
14655         * expression.cs (MemberAccess): Improved error reporting for
14656         inaccessible members.
14657
14658 2002-05-22  Martin Baulig  <martin@gnome.org>
14659
14660         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14661         itself with debugging support.
14662
14663 2002-05-22  Martin Baulig  <martin@gnome.org>
14664
14665         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14666         Removed, this isn't needed anymore.
14667
14668 2002-05-20  Martin Baulig  <martin@gnome.org>
14669
14670         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14671         be underlying type for an enum.
14672
14673 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14674
14675         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14676         that splits out the loading of just the core types.
14677
14678         * rootcontext.cs (ResolveCore): Split the struct resolution in
14679         two, so we can load the enumeration underlying types before any
14680         enums are used.
14681
14682         * expression.cs (Is): Bandaid until we fix properly Switch (see
14683         bug #24985 for details).
14684
14685         * typemanager.cs (ImplementsInterface): The hashtable will contain
14686         a null if there are no interfaces implemented.
14687
14688 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14689
14690         * cs-parser.jay (indexer_declarator): It is fine to have array
14691         parameters
14692
14693 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14694
14695         * typemanager.cs: (RegisterBuilder): New function used to register
14696         TypeBuilders that implement interfaces.  Since
14697         TypeBuilder.GetInterfaces (as usual) does not work with lame
14698         Reflection.Emit. 
14699         (AddUserType): register interfaces.
14700
14701         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14702         dealing with TypeBuilder.  Also, arrays are showing up as
14703         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14704         methods can not be invoked on them!
14705
14706         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14707         (ImplicitReferenceConversionExists): Split out from
14708         StandardConversionExists. 
14709
14710         * expression.cs (As): We were only implementing one of the three
14711         cases for the as operator.  We now implement them all.
14712         (Is): Implement the various other cases for Is as well.
14713
14714         * typemanager.cs (CACHE): New define used to control if we want or
14715         not the FindMembers cache.  Seems to have a negative impact on
14716         performance currently
14717
14718         (MemberLookup): Nested types have full acess to
14719         enclosing type members
14720
14721         Remove code that coped with instance/static returns for events, we
14722         now catch this in RealFindMembers.
14723
14724         (RealFindMembers): only perform static lookup if the instance
14725         lookup did not return a type or an event.  
14726
14727 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14728
14729         * assign.cs (CompoundAssign): We pass more semantic information
14730         now to Compound Assignments than we did before: now we have all
14731         the information at hand, and now we resolve the target *before* we
14732         do the expression expansion, which allows the "CacheValue" method
14733         to have the effect we intended (before, a [x] += 1 would generate
14734         two differen ArrayAccess expressions from the ElementAccess,
14735         during the resolution process).
14736
14737         (CompoundAssign.DoResolve): Resolve target and original_source here.
14738
14739 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14740
14741         * expression.cs (ArrayAccess): dropped debugging information. 
14742
14743         * typemanager.cs: Small bug fix: I was always returning i_members,
14744         instead of one of i_members or s_members (depending on which had
14745         the content).
14746
14747         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14748         method is invoked before any code generation takes place, and it
14749         is a mechanism to inform that the expression will be invoked more
14750         than once, and that the method should use temporary values to
14751         avoid having side effects
14752
14753         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14754
14755         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14756         implementation.
14757
14758         * expression.cs (Indirection, ArrayAccess): Add support for
14759         CacheTemporaries in these two bad boys. 
14760
14761         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14762         ldobj or ldind_ref.  
14763         (StoreFromPtr): Handle stobj as well.
14764
14765         * expression.cs (UnaryMutator): Share more code.
14766
14767         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14768         down: I was not tracking the Filter function as well, which
14769         was affecting the results of the cache.
14770
14771 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14772
14773         * attribute.cs: Remove the hack to handle the CharSet property on
14774         StructLayouts. 
14775
14776 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14777
14778         * attribute.cs (DoResolve): More uglyness, we now only try to
14779         resolve the attribute partially, to extract the CharSet
14780         information (only if we are a StructLayout attribute).  Otherwise 
14781
14782         (GetExtraTypeInfo): Add some code to conditionally kill in the
14783         future this.   I am more and more convinced that the .NET
14784         framework has special code to handle the attribute setting on
14785         certain elements.
14786
14787         * expression.cs (IsParamsMethodApplicable): Revert my previous
14788         foreach change here, it was wrong.
14789
14790 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14791
14792         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14793         (pp_expr): do not abort on unknown input, just return.
14794         (eval): abort if there are pending chars.
14795
14796         * attribute.cs (Attribute.Resolve): Positional parameters are
14797         optional.  Deal with that case.
14798
14799         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14800         the Ansi/Unicode/Auto information for the type.
14801
14802         (TypeContainer.DefineType): instantiate the EmitContext here, as
14803         we will be using it during the type definition (to resolve
14804         attributes) and during the emit phase.
14805
14806         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14807         to pull type information out of the attributes
14808
14809         (Attribute.Resolve): track the constructor builder, and allow for
14810         multiple invocations (structs and classes will use this).
14811
14812         * ecore.cs (MemberLookupFinal): new version with all the
14813         parameters customizable.
14814
14815         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14816         constructors.  Return if the result value is null (as the error
14817         would have been flagged already by MemberLookupFinal)
14818
14819         Do not allow instances of abstract classes or interfaces to be
14820         created.
14821
14822         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14823         We have to compare the assembly property here when dealing with
14824         FamANDAssem and Assembly access modifiers, because we might be
14825         creating an assembly from *modules* (that means that we are not
14826         getting TypeBuilders for types defined in other modules that are
14827         part of this assembly).
14828
14829         (Method.Emit): If the method is marked abstract and has a body,
14830         emit an error. 
14831
14832         (TypeContainer.DefineMembers): If both the defined member and the
14833         parent name match are methods, then do not emit any warnings: let
14834         the Method.Define routine take care of flagging warnings.  But if
14835         there is a mismatch (method overrides something else, or method is
14836         overriwritten by something, then emit warning).
14837
14838         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14839         set to null, this means `do not check for the return type on the
14840         signature'. 
14841
14842         (Method.Define): set the return type for the method signature to
14843         null, so that we get methods with the same name and parameters and
14844         different return types.  This is used to flag warning 114 (you are
14845         hiding a method, and you probably want to use the new/override
14846         keywords instead).
14847
14848         * typemanager.cs (MemberLookup): Implemented proper access
14849         control, closing a long standing set of bug reports.  The problem
14850         was that the Framework only has two bits: Public and NonPublic,
14851         and NonPublic includes private and protected methods, but we need
14852         to enforce the FamANDAssem, FamOrAssem and Family. 
14853
14854 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14855
14856         * statement.cs (GotoCase): Return true: Ammounts to giving up
14857         knowledge on whether we return or not, and letting the other case
14858         be responsible for it.
14859
14860 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14861
14862         * driver.cs: Do not load directories for each file processed, only
14863         do it if there is a pattern.
14864
14865         * ecore.cs: Report readonly assigns here as well, as we might have
14866         been resolved only by MemberAccess.
14867
14868         (SimpleName.SimpleNameResolve): Also be useful for LValue
14869         resolution.   We need this to propagate assign to local readonly variables
14870
14871         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14872         do not want to reuse potential criteria memory.
14873
14874         * class.cs (MyEventBuilder): Set reflected_type;
14875
14876         * ecore.cs (Constantify): Added support for constifying bools.
14877
14878         (RootContext.LookupType): Added a cache for values looked up in
14879         the declaration space.
14880
14881         * typemanager.cs (FindMembers): Now is a front-end to
14882         RealFindMembers, and provides a two-level hashtable-based cache to
14883         the request.  
14884
14885         15% performance improvement: from 22.5 to 19.2 seconds.
14886
14887         * expression.cs (IsParamsMethodApplicable): use foreach.
14888         (Invocation.DoResolve): ditto.
14889         (New.DoResolve): ditto.
14890         (ArrayCreation.DoResolve): ditto.
14891
14892         * ecore.cs (FindMostEncompassingType): use foreach.
14893
14894         * delegate.cs (NewDelegate.DoResolve): Use foreach
14895
14896         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14897         (RemoveMethods): use foreach.
14898
14899         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14900         nested foreach statements instead of for, and also break out of
14901         the inner loop once a match is found.
14902
14903         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14904
14905 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14906
14907         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14908         we actually unwrap the expression to allow for extra information
14909         to be extracted. 
14910
14911         * expression.cs: Use Shr_Un on unsigned operations. 
14912
14913 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14914
14915         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14916         applicable operators was not being considered correctly. This closes
14917         the bug Miguel reported.
14918
14919 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14920
14921         * attribute.cs: check that the type derives from System.Attribute
14922         and report the correct error in that case (moved the duplicate code to
14923         its own method, too).
14924
14925 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14926
14927         * attribute.cs: lookup attribute type name as the spec says: first the
14928         bare attribute name and then name + "Attribute" (nant compiles with
14929         mcs after this fix).
14930
14931 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14932
14933         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14934         Because of the way we parse things, we should try to see if a
14935         UIntConstant can fit in an integer.
14936
14937 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14938
14939         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14940         when we are in an explicit context.
14941
14942         (ConvertReferenceExplicit): When converting from Iface type S to Class
14943         T make sure the rules are implemented as an OR.
14944
14945         * parameter.cs (ParameterType): Make it a property for now although the
14946         purpose really isn't anything immediate.
14947
14948         * expression.cs (Is*Applicable): Do better checking on the parameter type
14949         of a ref/out parameter. The ones from the system assemblies are already 
14950         marked with the correct type so we don't need to do any correction.
14951
14952         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14953         the object type is standard too so include that.
14954
14955 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14956
14957         * ecore.cs (StandardConversionExists): Augment with missing code:
14958         deal with IntConstant, LongConstants and Enumerations.
14959
14960         * assign.cs: Report the error, instead of failing silently
14961
14962         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14963         typecontainer that they are declared, because the
14964         typecontainer/namespace will have the list of using clauses that
14965         need to be applied.
14966
14967         Assembly Attributes were escaping the normal registration
14968         mechanism. 
14969
14970         (EmitCode): Apply attributes within an EmitContext that represents
14971         the container they were declared on.
14972
14973         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14974
14975 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14976
14977         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14978         Revamp completely - make much cleaner as we now operate only
14979         on a set of Types.
14980
14981         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14982         to implement the logic detailed in the spec more correctly.
14983
14984         (UserDefinedConversion): Update accordingly.
14985
14986 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14987
14988         * statement.cs: Return flow analysis information up.
14989
14990         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14991         and the default.
14992
14993         (token): Do not consume an extra character before calling
14994         decimal_digits.
14995
14996 2002-05-06  Piers Haken <piersh@friskit.com>
14997
14998         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14999
15000 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15001
15002         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15003         EmitContext during the instance constructor initializer
15004         resolution, to stop access to instance variables.
15005
15006         This is mandated by the spec, last paragraph of the `constructor
15007         initializers' section. 
15008
15009 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15010
15011         * cs-parser.jay, class.cs (Accessor): new class used to represent
15012         an accessor (get or set).  In the past we used `null' to represent
15013         a missing accessor.  But this is ambiguous because there was no
15014         way to tell in abstract indexers/properties if one of them was
15015         specified.
15016
15017         Now there is a way of addressing that.
15018
15019         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15020         instead of FindMembers.
15021
15022         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15023         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15024
15025         * attribute.cs: Treat indexers and properties as the same in terms
15026         of applying attributes
15027
15028         * ecore.cs (FindMostEncompassedType): Use statically initialized
15029         EmptyExpressions()s like we do elsewhere to avoid creating useless
15030         objects (and we take this out of the tight loop).
15031
15032         (GetConversionOperators): Move the code to extract the actual
15033         operators to a separate routine to clean things up.
15034
15035 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15036
15037         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15038         events are always registered FieldBuilders.
15039
15040         * class.cs (FieldBase): New class shared by Fields 
15041
15042         * delegate.cs: If we are a toplevel delegate, use our full name.
15043         If we are a nested delegate, then only use our tail name.
15044
15045 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15046
15047         * expression.cs (IsApplicable): Ensure that we add the "&" to
15048         ref/out types before comparing it with the type of the argument.
15049
15050         (IsParamsMethodApplicable): Ditto.
15051
15052         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15053         silly me ;-)
15054
15055         * delegate.cs : Handle the case when we have more than one applicable
15056         method. Flag an error only when we finish checking all.
15057
15058 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15059
15060         * expression.cs: Add support for boolean static initializers.
15061
15062 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15063
15064         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15065
15066         * parameter.cs (ComputeParameterTypes,
15067         ComputeAndDefineParameterTypes): Better error handling: now we
15068         clear the `types' cache if we fail during any of the type lookups.
15069         We also return the status code correctly to our caller
15070
15071         * delegate.cs: If we fail to define a delegate, abort the extra
15072         steps. 
15073
15074         * expression.cs (Binary.ResolveOperator): for
15075         operator==(object,object) and operator !=(object, object) we also
15076         have to verify that there is an implicit conversion from one to
15077         the other.
15078
15079         (ArrayAccess.DoResolve): Array Access can operate on
15080         non-variables. 
15081
15082 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15083
15084         * assign.cs (CompoundAssign): A new class used as a "flag" that
15085         the assignment actually is happening as part of a compound
15086         assignment operator.
15087
15088         During compound assignment, a few new rules exist to enable things
15089         like:
15090
15091         byte b |= 1 + 2
15092
15093         From the spec:
15094
15095         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15096         to the type of x) if y is implicitly convertible to the type of x,
15097         and the operator is a builtin operator and the return type of the
15098         operator is explicitly convertible to the type of x. 
15099
15100         * rootcontext.cs: Reset warning level to 2.  4 catches various
15101         "interesting" features in mcs, we must clean this up at some
15102         point, but currently am trying to kill other bugs ;-)
15103
15104         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15105         in container classes as well.  
15106
15107         * expression.cs (Binary.ResolveOperator): Handle string case
15108         before anything else (as operator overloading does emit an error
15109         before doing anything else).
15110
15111         This code could go away when we move to a table driven model, but
15112         i could not come up with a good plan last night.
15113
15114 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15115
15116         * typemanager.cs (CSharpName): reimplementation using regex.
15117         * class.cs: added null check for fields in Emit
15118         * rootcontext.cs: set warninglevel to 4
15119
15120 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15121
15122         * typemanager.cs (CSharpName): reimplemented with Lupus
15123         suggestion.
15124
15125 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15126
15127         * statement.cs (If): correclty implement Resolve, because we were
15128         not catching sem errors in there.  The same process is needed
15129         everywhere else. 
15130         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15131
15132
15133         (Statement.Warning_DeadCodeFound): Factorize code.
15134         (While): Report dead code here too.
15135
15136         (Statement): Added Resolve virtual method to allow
15137         for resolution split from the emit code.
15138
15139 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15140
15141         * statement.cs (EmitBoolExpression): No longer try to resolve the
15142         expression here.    
15143         (MakeBoolean): New utility function that resolve, implicitly
15144         converts to boolean and tags the expression. 
15145
15146
15147         (If, Do): Implement dead code elimination.
15148         (While): Implement loop inversion
15149
15150         (Do, While, For, If): Resolve the expression prior to calling our
15151         code generation.
15152
15153 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15154
15155         * class.cs:
15156           - added method Report28 (warning: program has more than one entry point)
15157           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15158           - modified method Method.Define, the part at the end of the method
15159
15160         * rootcontext.cs: added static public Location EntryPointLocation;
15161           
15162         * ../errors/cs0028.cs : Add test case for the above warning.              
15163
15164         * typemanager.cs:
15165           - modified method CSharpName to allow arrays of primitive type to
15166             be printed nicely (e.g. instead of System.Int32[][] it now prints
15167             int[][])
15168           - added method CSharpSignature: returns the signature of a method
15169             in string format to be used in reporting errors, warnings, etc.
15170
15171         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15172         with String.Empty.
15173
15174 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15175
15176         * delegate.cs (Define): Fix extremely silly bug where I was
15177         setting the type of the 'object' parameter of the BeginInvoke
15178         method to System.IAsyncResult instead of System.Object ;-)
15179
15180 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15181
15182         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15183         here. 
15184
15185         (Constructor.Emit): return if we fail to initialize the
15186         constructor.  Another door closed!  
15187
15188         * expression.cs (New.DoResolve): Improve error message (from -6 to
15189         1501).  Use DeclaredOnly lookup to find the exact constructor.
15190
15191         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15192         loop.  This is useful.
15193
15194         * cs-parser.jay: Adjust the default parameters so that destructors
15195         have the proper signature.
15196
15197 2002-04-26  Martin Baulig  <martin@gnome.org>
15198
15199         * driver.cs (LoadAssembly): If `assembly' contains any characters
15200         which are only valid in path names and not in assembly names
15201         (currently slash, backslash and point), use Assembly.LoadFrom ()
15202         instead of Assembly.Load () on the `assembly' (before iteration
15203         over the link_paths).
15204
15205 2002-04-26  Martin Baulig  <martin@gnome.org>
15206
15207         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15208
15209 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15210
15211         * class.cs (Property): use the new typemanager.MemberLookup
15212
15213         (TypeContainer.MemberLookup): Implement using the
15214         TypeManager.MemberLookup now. 
15215
15216         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15217         and return MemberInfos, so that these can be used without an
15218         EmitContext (what we had before).
15219
15220 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15221
15222         * expression.cs: Fix the case where the argument to params if the
15223         type of the params.  I omitted handling this before.   Fixed
15224
15225 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15226
15227         * driver.cs: Call BootCorlib_PopulateCoreType
15228
15229         * class.cs (Property.CheckBase): Check for properties only, not
15230         for all members. 
15231
15232         * interface.cs: Temporary hack: try/catch around the
15233         CustomAttributeBuilder, because I am getting an exception that I
15234         do not understand.
15235
15236         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15237         types whose definitions are required to be there (attributes are
15238         defined before standard types).
15239
15240         Compute definitions as we boot the various types, as they are used
15241         immediately (value_type class will need object_type, but if we do
15242         not initialize object_type, we will pass a null, which will let
15243         the runtime pick the System.Object from the existing corlib, which
15244         is not what we want).
15245
15246 2002-04-22  Patrik Torstensson <totte@labs2.com>
15247
15248         * cs-tokenizer.cs: fixed a number of trim() issues.
15249
15250 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15251
15252         * expression.cs (Argument.Type): Ensure that we return the correct
15253         type when we have out or ref parameters [in which case we 
15254         append a "&"].
15255
15256 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15257
15258         * class.cs (Property, Indexer): Allow extern modifier in there. 
15259
15260         * typemanager.cs (InitBaseTypes): Initializes object_type and
15261         value_type, since those will be used early on during the bootstrap
15262         process to compile corlib.
15263
15264         (InitCoreTypes): Move code from here to InitBaseTypes.
15265
15266 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15267
15268         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15269         single-dimension arrays as using the ldlen opcode.  
15270
15271         Daniel Lewis discovered this optimization.  
15272
15273         * typemanager.cs: Add signature for System.Array::get_Length
15274
15275 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15276
15277         * statement.cs: report the error when the foreach does not apply to an
15278         array nor a collection.
15279
15280 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15281
15282         * expression.cs: Add implicit conversions to the operator ~.
15283
15284         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15285
15286         * typemanager.cs: Locate the decimal constructor.
15287
15288 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15289
15290         * attribute.cs: use the new property of TypeOf.
15291         * expression.cs: added 'get' property around typearg.
15292
15293         These changes fix a build breaker reported by NickD. Is this the
15294         correct way to fix?  If not, please, revert my changes and make it
15295         work :-).
15296
15297 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15298
15299         * attribute.cs: Add support for typeof in attribute invocations.
15300         I am not sure that this is right though.
15301
15302 2002-04-14  Duncan Mak  <duncan@ximian.com>
15303
15304         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15305         Binary.Operator.Division case.
15306
15307 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15308
15309         * class.cs (DefineType): Ensure that we do a proper check on
15310         attribute types and also register it with the TypeManager.
15311
15312         (TypeContainer.Targets): The default for attribute types is
15313         AttributeTargets.All.
15314
15315         * attribute.cs (ApplyAttributes): Registering the attribute type
15316         is done elsewhere, not when we discover we have a Usage attribute.
15317
15318 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15319
15320         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15321         and get rid of is_delegate parameter.
15322
15323         * everywhere : update.
15324
15325 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15326
15327         * cs-parser.jay (compilation_unit): Revamp completely to use
15328         some new ideas that I got from Rhys' grammar to solve the problems
15329         with assembly level attributes.
15330
15331         (outer_declaration): New grammar production.
15332
15333         (attribute_sections): Add.
15334
15335         (opt_attributes): Base on attribute_sections
15336
15337         (namespace_declaration): Allow opt_attributes to tackle the case
15338         when we have assembly level attributes - we are clever in this
15339         regard now ;-)
15340
15341         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15342         attributes in the non-global context.
15343
15344         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15345         instead of SetGlobalAttributes.
15346
15347         * class.cs, rootcontext.cs : Ensure we define and generate 
15348         attribute types before anything else.
15349
15350         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15351         and flag the new error -20 for the case when the attribute type
15352         does not have valid targets specified. csc does not catch this.
15353
15354         * ../errors/errors.txt : update for error # -20
15355
15356 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15357
15358         * support.cs (InternalParameters.ParameterModifier): Do some null
15359         checking and return sane values.
15360
15361         * class.cs (Method.Define): If we are a PInvoke method, ensure
15362         that we are static and extern. Report error # 601
15363
15364         * ../errors/cs0601.cs : Add test case for the above error.
15365
15366 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15367
15368         * rootcontext.cs (attribute_types): We need to keep type of
15369         all attribute types separately and emit code for them first.
15370
15371         (RegisterAttribute) : Implement.
15372
15373         * class.cs (DefineType): Check if the current Type is a custom
15374         attribute type and register it accordingly.
15375
15376         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15377         adding the first attribute twice and rename to
15378
15379         (SetGlobalAttributes): this.
15380
15381         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15382         lookups.
15383
15384         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15385         if we are processing global arguments. Hmm, I am unsure of this.
15386
15387 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15388
15389         * expression.cs: added static array of strings to avoid calling
15390         Enum.ToString () for Operator in Binary. Significant recover of
15391         performance.
15392
15393 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15394
15395         * class.cs (FindMembers): Allow the Builders of the various
15396         members to be null.  If they are skip them.  This only happens
15397         during the PInvoke declaration.
15398
15399 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15400
15401         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15402         failure, so we do not keep going afterwards.
15403
15404         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15405         wanted to pass `false' as the `is_delegate' argument.  If this is
15406         the case, why not use delegate_type == null to mean `is_delegate =
15407         false' and anything else as is_delegate = true.
15408
15409 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15410
15411         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15412         code for the section, not the beginning of the tests.
15413
15414 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15415
15416         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15417
15418         * expression.cs (Binary): same.  Warn about errors where we have
15419         Enum/Enum in operator + as well.
15420
15421 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15422
15423         * statement.cs:
15424                 - added support for switch(bool)
15425                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15426                 - add TableSwitchEmit() to handle table-based switch statements
15427
15428 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15429
15430         * expression.cs (Invocation.OverloadResolve): Factor out code which
15431         does parameter compatibility checking with arguments so that we can 
15432         re-use the code even from Delegate.VerifyApplicability
15433
15434         (VerifyArgumentsCompat): Move above code here.
15435
15436         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15437         and instead make a call to the above method.
15438
15439 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15440
15441         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15442         We use it to keep track of classes which are attribute types.
15443
15444 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * delegate.cs (Delegate.Define): Correctly define the types in the
15447         presence of fixed and array parameters.
15448
15449         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15450         doing FindMembers.
15451
15452         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15453         include NonPublic after the first iteration.
15454
15455         * class.cs (Indexer.CheckBase): Only check if both parents are
15456         non-null. 
15457
15458         * cs-parser.jay (accessor_body): If empty, set to null.
15459
15460         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15461         same code path here to resolve constants names that we did have in
15462         MemberAccess.DoResolve.  There is too much code duplicated here.
15463
15464 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15465
15466         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15467
15468         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15469         to MakeUnionSet.
15470
15471         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15472         tokens, numbers and strings.
15473
15474         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15475         parenthesis.
15476
15477         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15478         asyncronous parameters and the regular parameters.  
15479
15480         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15481         specify the target directory.
15482
15483         * expression.cs: (This.DoResolve): Simplify
15484         (As.Emit): Optimize, do not generate IsInst if the expression is
15485         always of the given type.
15486
15487         (Is.DoResolve): Bug fix, we were reporting both always/never for
15488         the is expression.
15489
15490         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15491         creating too many unnecessary arrays.
15492
15493 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15494
15495         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15496         fields instead of rolling our own initializer.   Takes care of all
15497         implicit conversions, and drops unnecessary static checks/argument.
15498
15499 2002-03-31  Dick Porter  <dick@ximian.com>
15500
15501         * driver.cs: use the GetDirectories() return values properly, and
15502         use "/" as path separator.
15503
15504 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15505
15506         * expression.cs (Unary): Optimize - - expr into expr.
15507         (Binary): Optimize a + (-b) into a -b.
15508
15509         * codegen.cs (CodeGen): Made all methods static.
15510
15511 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15512
15513         * rootcontext.cs: 
15514
15515         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15516         TypeBuilder property.
15517
15518         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15519         instead. 
15520
15521         * tree.cs: Removed the various RecordXXXX, and replaced with a
15522         single RecordDecl.  Removed all the accessor methods, and just
15523         left a single access point Type 
15524
15525         * enum.cs: Rename DefineEnum to DefineType.
15526
15527         * decl.cs: New abstract method `DefineType' used to unify the
15528         Defines for Enumerations, Interfaces, TypeContainers and
15529         Delegates.
15530
15531         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15532         LookupBaseClasses method that used to live in class.cs and
15533         interface.cs here, and renamed to FindType.
15534
15535         * delegate.cs: Implement DefineType.  Take advantage of the
15536         refactored pattern for locating the parent builder without taking
15537         the parent_builder argument (which we know does not work if we are
15538         nested, and triggering a toplevel definition).
15539
15540 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15543         accessibility of a member has changed during override and report
15544         an error if so.
15545
15546         * class.cs (Method.Define, Property.Define): Only complain on
15547         overrides if the method is private, any other accessibility is
15548         fine (and since we just checked the permission is the same, we are
15549         good to go).
15550
15551         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15552         and elif are processed always.  The other pre-processing
15553         directives are only processed if we are "taking" the path
15554
15555 2002-03-29  Martin Baulig  <martin@gnome.org>
15556
15557         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15558         current location is not Null.
15559
15560         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15561         a separate method so we can profile it.
15562
15563         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15564         `span.Seconds' are just seconds, but no minutes or hours.
15565         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15566
15567 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15568
15569         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15570         Remove the gratuitous set of Final:
15571
15572                                 // If an interface implementation, then we can set Final.
15573                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15574                                     implementing.DeclaringType.IsInterface)
15575                                         flags |= MethodAttributes.Final;
15576
15577         I do not know what I was smoking when I used that.
15578
15579
15580         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15581         step into fixing the name resolution issues for delegates and
15582         unifying the toplevel name resolution.
15583
15584 2002-03-28  Martin Baulig  <martin@gnome.org>
15585
15586         * class.cs (Method.Emit): If we have a symbol writer, call its
15587         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15588         tell it about the current method.
15589
15590         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15591         writer that we're going to emit the first byte of IL code for a new
15592         statement (a new source line).
15593         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15594         EmitContext.Mark() before emitting any code.
15595
15596         * location.cs (SymbolDocument): Return null when we're Null.
15597
15598         * statement.cs (Statement): Moved the `Location loc' variable here.
15599         (Statement.EmitBoolExpression): If we have a symbol writer, call
15600         ec.Mark() before emitting any code to tell it that we're at the
15601         beginning of a new statement.
15602         (StatementExpression): Added `Location' argument to the constructor.
15603         (Block): Added public readonly variable `StartLocation' and public
15604         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15605         (Block): Added constructor which takes a start and end location.
15606         (Block.SetEndLocation): New method. This sets the end location.
15607         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15608         local variables we create.
15609         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15610         each statement and do also mark the begin and end of the block.
15611
15612         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15613         tell it the current lexer.Location, use Location.Null for the end of the
15614         block.
15615         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15616         current block, set its end location using SetEndLocation().
15617         (statement_expression): StatementExpression constructor now takes the
15618         lexer.Location as additional argument.
15619         (for_statement, declare_local_variables): Likewise.
15620         (declare_local_variables): When creating a new implicit block, use the
15621         new Block constructor and pass it the lexer.Location.
15622
15623 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15624
15625         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15626         members also on the parent interfaces recursively.
15627
15628 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15629
15630         * report.cs: Use new formats, since Gonzalo finished the missing
15631         bits. 
15632
15633         * expression.cs (Binary.ResolveOperator): added missing operator|
15634         operator& and operator^ for bool/bool.
15635
15636         * cs-parser.jay: CheckDef now takes a Location argument that is
15637         used to report errors more precisly (instead of reporting the end
15638         of a definition, we try to track something which is a lot closer
15639         to the source of the problem).
15640
15641         * cs-tokenizer.cs: Track global token use, so we can properly flag
15642         the use of #define/#undef after the first token has been seen.
15643
15644         Also, rename the reportXXXX to Error_DescriptiveName
15645
15646         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15647         TypeContainer, so that Enum and Interface can use this too.
15648
15649         * class.cs (TypeContainer.LookupInterfaceOrClass,
15650         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15651         `builder' argument.  Typically this was used to pass the parent
15652         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15653         the definition).  
15654
15655         The problem is that a nested class could trigger the definition of
15656         a toplevel class, and the builder would be obviously wrong in that
15657         case. 
15658
15659         So we drop this argument, and we compute dynamically the
15660         TypeBuilder/ModuleBuilder (the correct information was available
15661         to us anyways from DeclSpace.Parent)
15662
15663         * interface.cs (Interface.DefineInterface): Drop builder
15664         parameter cleanup like class.cs
15665
15666         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15667         like class.cs
15668
15669         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15670         values. 
15671
15672         (Try.Emit): Propagate the returns value from the statement.
15673
15674         (Return.Emit): Even if we are leavning 
15675
15676         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15677
15678         * modifiers.cs: Fix the computation of MethodAttributes flags.
15679
15680 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15681
15682         * driver.cs: allow compilation of files that start with '/'.
15683         Add a default case when checking the argument of --target.
15684
15685 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15686
15687         * interface.cs: Implement the same search algorithm for types in
15688         the interface code.
15689
15690         * delegate.cs: Do not allow multiple definition.
15691
15692         * Recovered ChangeLog that got accidentally amputated
15693
15694         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15695
15696         * rootcontext.cs: Load manually enum to allow core classes to
15697         contain enumerations.
15698
15699         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15700         Update to new static methods in TypeManager.
15701
15702         * typemanager.cs (GetMethod, GetConstructor): Use our
15703         implementation of FindMembers to find the members, since during
15704         corlib compilation, the types are TypeBuilders and GetMethod and
15705         GetConstructor do not work.
15706
15707         Make all methods in TypeManager static.
15708
15709         (InitCodeHelpers): Split the functionality from
15710         the InitCodeTypes function.
15711
15712         * driver.cs: Call InitCodeHelpers after we have populated the
15713         types. 
15714
15715         * cs-parser.jay (delegate_declaration): we did not used to compute
15716         the delegate name correctly for void delegates.
15717
15718 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * rootcontext.cs (RootContext): Init the interface_resolve_order
15721         and type_container_resolve_order always.
15722
15723         (ResolveCore, BootstrapCorlib_ResolveClass,
15724         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15725         compiler when compiling with --nostdlib
15726
15727         * class.cs (TypeContainer.DefineType): Check that our parent is
15728         not null.  This test is most important when we are bootstraping
15729         the core types.
15730
15731         * codegen.cs: Split out the symbol writing code.
15732
15733 2002-03-25  Martin Baulig  <martin@gnome.org>
15734
15735         * driver.cs (-g): Made -g an alias for --debug.
15736
15737 2002-03-24  Martin Baulig  <martin@gnome.org>
15738
15739         * codegen.cs (SymbolWriter): New public variable. Returns the
15740         current symbol writer.
15741         (CodeGen): Added `bool want_debugging_support' argument to the
15742          constructor. If true, tell the ModuleBuild that we want debugging
15743         support and ask it for the ISymbolWriter.
15744         (Save): If we have a symbol writer, call it's Close() method after
15745         saving the assembly.
15746
15747         * driver.c (--debug): New command line argument to create a
15748         debugger information file.
15749
15750         * location.cs (SymbolDocument): New public property. Returns an
15751         ISymbolDocumentWriter object for the current source file or null
15752         if we don't have a symbol writer.
15753
15754 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15755
15756         * driver.cs (LoadAssembly): Correctly return when all the paths
15757         have been tried and not before.
15758
15759         * statement.cs (Switch.Emit): return the actual coverage for this
15760         statement (returns/not-returns)
15761
15762         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15763         switch of the statement if we are the last switch section.  That
15764         kills two problems: try/catch problems (we used to emit an empty
15765         nop at the end) and switch statements where all branches would
15766         return. 
15767
15768 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15769
15770         * driver.cs: Add default assemblies (the equivalent to the
15771         Microsoft CSC.RSP file)
15772
15773         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15774         also update tokens_seen and set it to false.
15775
15776         * driver.cs: Implement --recurse for Mike.
15777
15778         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15779         correctly splitting out the paths.
15780
15781 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15782
15783         * interface.cs (Interface.PopulateProperty): Instead of using
15784         `parent' as the declaration space for the set parameters, use
15785         `this' 
15786
15787         * support.cs (InternalParameters): InternalParameters constructor
15788         takes a DeclSpace instead of a TypeContainer.
15789
15790         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15791         types are being initialized, load the address of it before calling
15792         the function.  
15793
15794         (New): Provide a mechanism to disable the generation of local
15795         value type temporaries when the caller will be providing us with
15796         an address to store it.
15797
15798         (ArrayCreation.EmitDynamicInitializers): Use it.
15799
15800 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15801
15802         * expression.cs (Invocation.EmitArguments): Only probe for array
15803         property if there is more than one argument.  Sorry about that.
15804
15805         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15806         empty param arrays.
15807
15808         * class.cs (Method.LabelParameters): Fix incorrect code path that
15809         prevented the `ParamArrayAttribute' from being applied to the
15810         params attribute.
15811
15812 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15813
15814         * support.cs (ReflectionParameters): Correctly compute whether the
15815         last argument is a params array.  Fixes the problem with
15816         string.Split ('a')
15817
15818         * typemanager.cs: Make the assemblies array always be non-null
15819         (empty, but non-null)
15820
15821         * tree.cs (RecordDecl): New function that abstracts the recording
15822         of names.  This reports error 101, and provides a pointer to the
15823         previous declaration.  Fixes a crash in the compiler.
15824
15825         * cs-parser.jay (constructor_declaration): Update to new grammar,
15826         and provide a constructor_body that can be empty.
15827
15828 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15829
15830         * driver.cs: Add support for --resources.
15831
15832         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15833         Make all types for the various array helper methods be integer.
15834
15835         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15836         CheckState to ConvCast.
15837
15838         (ConvCast): Now it takes a `checked' state argument, to avoid
15839         depending on the emit context for the conversion, and just using
15840         the resolve time setting.
15841
15842         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15843         instead of Invocation.EmitArguments.  We do not emit the original
15844         arguments, instead we emit those which have been converted to
15845         unsigned int expressions.
15846
15847         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15848
15849         * codegen.cs: ditto.
15850
15851         * expression.cs (LocalVariableReference): Drop the use of the
15852         Store function that depended on the variable index.
15853
15854         * statement.cs (VariableInfo): Drop the `Idx' property from this
15855         class, as this is not taking into account the indexes for
15856         temporaries tat we generate during the execution, getting the
15857         indexes wrong.
15858
15859         * class.cs: First emit class initializers, then call the parent
15860         constructor. 
15861
15862         * expression.cs (Binary): Fix opcode emision.
15863         (UnaryMutator.EmitCode): Support checked code generation
15864
15865         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15866         matches for events for both the Static and Instance scans,
15867         pointing to the same element.   Fix that.
15868
15869 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15870
15871         * rootcontext.cs (ResolveTree): Always set the
15872         interface_resolve_order, because nested interfaces will be calling
15873         into us.
15874
15875         * class.cs (GetInterfaceOrClass): Track the same resolution
15876         process used by TypeManager.LookupType.  This fixes the nested
15877         type lookups in class declarations (separate path from
15878         LookupType). 
15879
15880         (TypeContainer.DefineType): Also define nested interfaces.
15881         (TypeContainer.RegisterOrder): New public function used to
15882         register the order in which child interfaces need to be closed.
15883
15884         Nested interfaces need to be closed after their parents have been
15885         created. 
15886
15887         * interface.cs (InterfaceAttr): Put all the logic for computing
15888         the interface attribute here. 
15889
15890         (DefineInterface): Register our interface order with the
15891         RootContext or with the TypeContainer depending on the case.
15892
15893 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * cs-parser.jay: rework foreach statement to work with the new
15896         changes to the policy on SimpleNames.
15897
15898         * report.cs: support Stacktrace on warnings as well.
15899
15900         * makefile: drop --unsafe and /unsafe from the compile.
15901
15902 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15903
15904         * ecore.cs (StandardConversionExists): Modify to take an Expression
15905         as the first parameter. Ensure we do null -> reference type conversion
15906         checking.
15907
15908         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15909         temporary Expression objects.
15910
15911 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15912
15913         * interface.cs: workaround bug in method overloading resolution
15914         (there is already a bugzilla bug for it).
15915
15916 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15917
15918         We could also solve this problem by having a separate path for
15919         performing type lookups, instead of DoResolve, we could have a
15920         ResolveType entry point, and only participating pieces of the
15921         production (simplename, deref, array) would implement this. 
15922
15923         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15924         signal SimpleName to only resolve type names and not attempt to
15925         resolve anything else.
15926
15927         * expression.cs (Cast): Set the flag.
15928
15929         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15930
15931         * class.cs: Only report 108 if there is no `new' modifier.
15932
15933         * cs-parser.jay: rework foreach statement to work with the new
15934         changes to the policy on SimpleNames.
15935
15936         * report.cs: support Stacktrace on warnings as well.
15937
15938         * makefile: drop --unsafe and /unsafe from the compile.
15939
15940 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15943         lookups here, instead of doing that at parse time.  This means
15944         that our grammar will not introduce `LocalVariableReferences' as
15945         expressions at this point.  That solves the problem of code like
15946         this:
15947
15948         class X {
15949            static void Main ()
15950            { int X = 1;
15951             { X x = null }}}
15952
15953         This is only half the fix.  The full fix requires parameters to
15954         also be handled in this way.
15955
15956         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15957         makes the use more obvious of the DeclSpace.  The
15958         ec.TypeContainer.TypeBuilder is now only used to pull the
15959         TypeBuilder for it.
15960
15961         My theory is that I can get rid of the TypeBuilder completely from
15962         the EmitContext, and have typecasts where it is used (from
15963         DeclSpace to where it matters).  
15964
15965         The only pending problem is that the code that implements Aliases
15966         is on TypeContainer, and probably should go in DeclSpace.
15967
15968         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15969         lookups here, instead of doing that at parse time.  This means
15970         that our grammar will not introduce `LocalVariableReferences' as
15971         expressions at this point.  That solves the problem of code like
15972         this:
15973
15974         class X {
15975            static void Main ()
15976            { int X = 1;
15977             { X x = null }}}
15978
15979         This is only half the fix.  The full fix requires parameters to
15980         also be handled in this way.
15981
15982         * class.cs (Property.DefineMethod): When implementing an interface
15983         method, set newslot, when implementing an abstract method, do not
15984         set the flag (before we tried never setting it, or always setting
15985         it, which is the difference).
15986         (Indexer.DefineMethod): same.
15987         (Method.DefineMethod): same.
15988
15989         * ecore.cs: Only set the status used flag if we get back a Field.
15990
15991         * attribute.cs: Temporary hack, so Paolo can keep working.
15992
15993 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15994
15995         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15996         the unmanaged type in the case we have a MarshalAs attribute.
15997
15998         (Resolve): Handle the case when we are parsing the special MarshalAs
15999         attribute [we need to store the unmanaged type to use later]
16000
16001         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16002         MarshalAs Attribute.
16003
16004         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16005         on parameters and accordingly set the marshalling info.
16006
16007 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16008
16009         * class.cs: Optimizing slightly by removing redundant code after
16010         we switched to the `NoTypes' return value.
16011         (Property.DefineMethod): use NoTypes here too.
16012
16013         This fixes the bug I introduced in my last batch of changes.
16014
16015 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16016
16017         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16018
16019         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16020         Enums since those are types too. 
16021
16022         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16023
16024         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16025         thanks to a call during the lookup process.
16026
16027 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16028
16029         * statement.cs (Foreach): Lots of work to accomodate a particular
16030         kind of foreach statement that I had not kept in mind.  It is
16031         possible to have foreachs on classes that provide a GetEnumerator
16032         method that return objects that implement the "pattern" for using
16033         a foreach, there is no need to support GetEnumerator
16034         specifically. 
16035
16036         This is needed to compile nant.
16037
16038         * decl.cs: Only report 114 if the member is not `Finalize' and if
16039         the warning level is at least 2.
16040
16041         * class.cs: Moved the compare function from Method to
16042         MethodSignature. 
16043
16044         (MethodSignature.InheritableMemberSignatureCompare): Add new
16045         filter function that is used to extract inheritable methods from a
16046         class. 
16047
16048         (Method.Define): Use the new `inheritable_method_signature_filter'
16049         delegate
16050
16051         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16052         command. 
16053
16054 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16055
16056         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16057
16058         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16059
16060         * expression.cs: Pass location information to
16061         ConvertImplicitStandard. 
16062
16063         * class.cs: Added debugging code to track return values from
16064         interfaces. 
16065
16066 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * expression.cs (Is.DoResolve): If either side of the `is' is an
16069         interface, do not flag the warning.
16070
16071         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16072         for interfaces
16073
16074         * report.cs: Allow for --fatal to be used with --probe.
16075
16076         * typemanager.cs (NoTypes): Move the definition for the empty Type
16077         array here. 
16078
16079         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16080         properties. 
16081         (TypeContainer.DefineProxy): New function used to proxy to parent
16082         implementations when implementing interfaces.
16083         (TypeContainer.ParentImplements): used to lookup if our parent
16084         implements a public function that is required by an interface.
16085         (TypeContainer.VerifyPendingMethods): Hook this up.
16086
16087         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16088         `modules' and `assemblies' arraylists into arrays.  We only grow
16089         these are the very early start up of the program, so this improves
16090         the speedof LookupType (nicely measured).
16091
16092         * expression.cs (MakeByteBlob): Replaced unsafe code with
16093         BitConverter, as suggested by Paolo.
16094
16095         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16096         folding of string concatenation, but if either side is a string,
16097         and the other is not, then return null, and let the runtime use
16098         the concatenation on the string plus the object (using
16099         `Object.ToString'). 
16100
16101 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16102
16103         Constant Folding has been implemented now.
16104
16105         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16106         the error instead on types that are not supported in one's
16107         complement. 
16108
16109         * constant.cs (Constant and all children): New set of functions to
16110         perform implict and explicit conversions.
16111
16112         * ecore.cs (EnumConstant): Implement the new functions to perform
16113         conversion by proxying to the child expression.
16114
16115         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16116         own separate setting that can not be turned off from the command
16117         line using --unchecked or --checked and is only controlled using
16118         the checked/unchecked statements and expressions.  This setting is
16119         used by the constant folder to flag errors.
16120
16121         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16122         ConstantCheckState as well.   
16123
16124         During Resolve, they also have to flag the state, because the
16125         constant folder runs completely in the Resolve phase.
16126
16127         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16128         well.
16129
16130 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16131
16132         * cfold.cs: New file, this file contains the constant folder.
16133
16134         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16135         argument to track whether we are using the resulting address to
16136         load or store a value and provide better error messages. 
16137
16138         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16139         new AddressOf arguments.
16140
16141         * statement.cs (Foreach.EmitCollectionForeach): Update
16142
16143         * expression.cs (Argument.Emit): Call AddressOf with proper
16144         arguments to track usage.
16145
16146         (New.DoEmit): Call AddressOf with new arguments.
16147
16148         (Unary.Emit): Adjust AddressOf call.
16149
16150 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16151
16152         * cs-parser.jay (member_access): Change the case for pre-defined types
16153         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16154         this suggestion.
16155
16156         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16157         a method body.
16158
16159         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16160         essentially like methods and apply attributes like MethodImplOptions to them too.
16161
16162         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16163         not being null.
16164
16165         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16166         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16167         is the DeclSpace.
16168
16169         * Update code everywhere accordingly.
16170
16171         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16172
16173         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16174
16175 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16176
16177         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16178         try performing lookups against those instead of jumping straight into using
16179         the 'using' clauses.
16180
16181         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16182
16183         (LookupType): Perform lookups in implicit parents too.
16184
16185         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16186         sequence as RootContext.LookupType. 
16187
16188         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16189         the various cases of namespace lookups into this method.
16190
16191 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16192
16193         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16194         in positional arguments)
16195
16196         * class.cs (Operator): Update the AllowedModifiers to contain
16197         extern. 
16198
16199         * cs-parser.jay: Update operator declaration to allow for the
16200         operator body to be empty.
16201
16202         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16203         values. 
16204
16205 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16206
16207         * class.cs (Method.Emit): Label parameters.
16208
16209         * driver.cs: Return 1 or 0 as the program exit code.
16210
16211 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16212
16213         * expression.cs: Special case the `null' object when trying to
16214         auto-compute the type, as anything can be explicitly converted to
16215         that. 
16216
16217         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16218         spotting this Paolo.
16219
16220         (Expression.ImplicitNumericConversion): Perform comparissions of
16221         the type using the underlying type in the case of an enumeration
16222         rather than using the enumeration type for the compare.
16223
16224         Cope with the underlying == type case, which is not possible to
16225         catch before. 
16226
16227         (Expression.ConvertNumericExplicit): Perform comparissions of
16228         the type using the underlying type in the case of an enumeration
16229         rather than using the enumeration type for the compare.
16230
16231         * driver.cs: If the user does not supply an extension, assume .exe
16232
16233         * cs-parser.jay (if_statement): Rewrote so that we can track the
16234         location for the if statement.
16235
16236         * expression.cs (Binary.ConstantFold): Only concat strings when
16237         the operation is "+", not everything ;-)
16238
16239         * statement.cs (Statement.EmitBoolExpression): Take a location
16240         argument. 
16241         (If, While, Do): Track location.
16242
16243         * expression.cs (Binary.ResolveOperator): In the object + string
16244         case, I was missing a call to ConvertImplicit
16245
16246 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16247
16248         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16249         Location arguments. Ensure we use RootContext.LookupType to do our work
16250         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16251
16252         * interface.cs (PopulateMethod): Handle the type of the parameter being
16253         null gracefully.
16254
16255         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16256         have a params method with no fixed arguments and a call is made with no
16257         arguments.
16258
16259 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16260
16261         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16262         the verbatim-string-literal
16263
16264         * support.cs (InternalParameters.ParameterModifier): handle null
16265         fixed parameters.
16266         (InternalParameters.ParameterType): ditto.
16267
16268         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16269         duplicating the name of the variable parameter.
16270         (GetParameterByName): Fix bug where we were not looking up array
16271         paramters if they were the only present (thanks Paolo!).
16272         (GetParameterInfo): We only have an empty set of types if both
16273         fixed and array are set to null.
16274         (GetParameterInfo-idx): Handle FixedParameter == null
16275
16276         * cs-parser.jay: Handle the case where there is no catch
16277         statements (missing null test).
16278
16279 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16280
16281         * driver.cs (MainDriver): Be conservative on our command line
16282         handling.
16283
16284         Catch DirectoryNotFoundException when calling GetFiles.
16285
16286         (SplitPathAndPattern): Used to split the input specification into
16287         a path and a pattern that we can feed to Directory.GetFiles.
16288
16289 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16290
16291         * statement.cs (Fixed): Implement the last case of the Fixed
16292         statement (string handling).
16293
16294         * expression.cs (StringPtr): New class used to return a char * to
16295         a string;  Used by the Fixed statement.
16296
16297         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16298
16299         * expression.cs (Binary.ResolveOperator): Remove redundant
16300         MemberLookup pn parent type.
16301         Optimize union call, we do not need a union if the types are the same.
16302         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16303         type.
16304
16305         Specialize the use of MemberLookup everywhere, instead of using
16306         the default settings. 
16307
16308         (StackAlloc): Implement stackalloc keyword.
16309
16310         * cs-parser.jay: Add rule to parse stackalloc.
16311
16312         * driver.cs: Handle /h, /help, /?
16313
16314         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16315         before we supported unsafe code.
16316
16317         * makefile: add --unsafe to the self compilation of mcs.
16318
16319 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16320
16321         * expression.cs (PointerArithmetic): New class that is used to
16322         perform pointer arithmetic.
16323         (Binary.Resolve): Handle pointer arithmetic
16324         Handle pointer comparission.
16325         (ArrayPtr): Utility expression class that is used to take the
16326         address of an array.
16327
16328         (ElementAccess): Implement array access for pointers
16329
16330         * statement.cs (Fixed): Implement fixed statement for arrays, we
16331         are missing one more case before we are done.
16332
16333         * expression.cs (Indirection): Implement EmitAssign and set the
16334         ExprClass to Variable.  This allows pointer dereferences to be
16335         treated as variables, and to have values assigned to them.
16336
16337         * ecore.cs (Expression.StoreFromPtr): New utility function to
16338         store values dereferencing.
16339
16340 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16341
16342         * expression.cs (Binary.ResolveOperator): Ensure that we are
16343         not trying to operate on a void type - this fixes the reported
16344         bug.
16345
16346         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16347         the parent implementation is sealed.
16348
16349         * ../errors/cs0239.cs : Add.
16350
16351         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16352
16353         * typemanager.cs (unverifiable_code_type): Corresponds to 
16354         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16355         which have unsafe code in them.
16356
16357         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16358         unsafe context.
16359
16360 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16361
16362         * cs-tokenizer.cs: Add support for @"litreal strings"
16363
16364         Make tokenizer accept pre-processor directives
16365         on any column (remove the old C-like limitation). 
16366
16367         * rootcontext.cs (EmitCode): Emit any global attributes.
16368         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16369
16370         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16371
16372         * cs-parser.jay: Add support for global attributes.  
16373
16374 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16375
16376         * expression.cs (Indirection): New helper class.  Unary will
16377         create Indirection classes to be able to implement the
16378         IMemoryLocation interface on it.
16379
16380 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16381
16382         * cs-parser.jay (fixed_statement): reference the right statement.
16383
16384         * statement.cs (Fixed.Emit): Finish implementing the fixed
16385         statement for the &x case.
16386
16387 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16388
16389         * class.cs (Property.Define, Method.Define): Remove newslot when
16390         `implementing'.  
16391
16392         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16393         wrong.  NewSlot should only be used if the `new' keyword is present.
16394
16395         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16396         locating our system dir.  Sorry about this.
16397
16398 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16399
16400         * driver.cs (GetSystemDir): Compute correctly the location of our
16401         system assemblies.  I was using the compiler directory instead of
16402         the library directory.
16403
16404 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16405
16406         * expression.cs (BetterFunction): Put back in what Miguel commented out
16407         since it is the correct fix. The problem is elsewhere ;-)
16408
16409         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16410         parameters of the parms method are themselves compatible or not !
16411
16412         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16413         to check that a class implements an interface before saying that an implicit
16414         conversion was allowed. Use ImplementsInterface to do the checking.
16415
16416 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16417
16418         * class.cs (Method.Define): Track whether we are an explicit
16419         implementation or not.  And only call DefineMethodOverride if we
16420         are an explicit implementation.
16421
16422         (Property.DefineMethod): Ditto.
16423
16424 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16425
16426         * expression.cs (BetterFunction): Catch hideous bug which was
16427          preventing us from detecting ambiguous calls due to implicit casts i.e
16428         cs0121.
16429
16430 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16431
16432         * support.cs (Pair): Remove un-needed method.  I figured why I was
16433         getting the error in cs-parser.jay, the variable in a foreach loop
16434         is readonly, and the compiler does not really treat this as a variable.
16435
16436         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16437         instead of EQUALS in grammar.  
16438
16439         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16440
16441         * expression.cs (Unary.DoResolve): Check whether the argument is
16442         managed or not.
16443
16444 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16445
16446         * support.cs: Api for Pair to set a value.  Despite the fact that
16447         the variables are public the MS C# compiler refuses to compile
16448         code that accesses the field if the variable is part of a foreach
16449         statement. 
16450
16451         * statement.cs (Fixed): Begin implementation of the fixed
16452         statement.
16453
16454         (Block.AddVariable): Return the VariableInfo on success and null
16455         on failure instead of true/false. 
16456
16457         * cs-parser.jay (foreach): Catch errors on variables already
16458         defined (we were ignoring this value before) and properly unwind
16459         the block hierarchy
16460
16461         (fixed_statement): grammar for the fixed statement.
16462
16463 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16464
16465         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16466         pointer types to be incretemented.
16467
16468         (SizeOf): Implement.
16469
16470         * cs-parser.jay (pointer_member_access): Implement
16471         expr->IDENTIFIER production.
16472
16473         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16474         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16475         on safe contexts.
16476
16477         (Unary): Implement indirection.
16478
16479         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16480         use in non-unsafe context).
16481
16482         (SimpleName.DoResolve): Check for pointers in field access on safe
16483         contexts. 
16484
16485         (Expression.LoadFromPtr): Factor the load-indirect code in this
16486         function.  This was duplicated in UnboxCast and ParameterReference
16487
16488 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16489
16490         * expression.cs (ComposedCast): report an error if a pointer cast
16491         is used in a safe region.
16492
16493         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16494         pointer type casts in unsafe context.
16495
16496         * codegen.cs (EmitContext): Set up IsUnsafe.
16497
16498         * cs-parser.jay (non_expression_type): Add productions for pointer
16499         casts. 
16500
16501         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16502         code.  We should not use force into static mode if the method is
16503         not virtual.  Fixes bug in MIS
16504
16505         * statement.cs (Do.Emit, While.Emit, For.Emit,
16506         Statement.EmitBoolExpression): Add support to Do and While to
16507         propagate infinite loop as `I do return' semantics.
16508
16509         Improve the For case to also test for boolean constants.
16510
16511         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16512         to the list of attributes we can add.
16513
16514         Remove `EmitContext' argument.
16515
16516         * class.cs (Method.Define): Apply parameter attributes.
16517         (Constructor.Define): Apply parameter attributes.
16518         (MethodCore.LabelParameters): Move here the core of labeling
16519         parameters. 
16520
16521         * support.cs (ReflectionParameters.ParameterModifier,
16522         InternalParameters.ParameterModifier): Use IsByRef on the type and
16523         only return the OUT bit for these parameters instead of in/out/ref
16524         flags.
16525
16526         This is because I miss-understood things.  The ParameterInfo.IsIn
16527         and IsOut represent whether the parameter has the [In] and [Out]
16528         attributes set.  
16529
16530 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16531
16532         * ecore.cs (FieldExpr.Emit): Release temporaries.
16533
16534         * assign.cs (LocalTemporary.Release): new function.
16535
16536         * codegen.cs (EmitContext.GetTemporaryStorage,
16537         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16538         temporary storage.  Now we can "put back" localbuilders when we
16539         are done with them
16540
16541 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16542
16543         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16544         need to make a copy of the variable to generate verifiable code.
16545
16546 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16547
16548         * driver.cs: Compute dynamically the system directory.
16549
16550         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16551         Slower, but more generally useful.  Used by the abstract
16552         registering implementation. 
16553
16554         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16555         the rules for the special rule on Type/instances.  First check if
16556         we have the same name, and if so, try that special static path
16557         rather than the instance path.
16558
16559 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16560
16561         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16562         for, while and if.
16563
16564         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16565         Enum, ValueType, Delegate or Array for non-corlib compiles.
16566
16567         * cs-tokenizer.cs: Catch long identifiers (645)
16568
16569         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16570         piece of code.
16571
16572         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16573         fix, we were returning too early, so we were not registering
16574         pending methods from abstract classes.
16575
16576         Do not register pending methods if the class is abstract.
16577
16578         * expression.cs (Conditional.DoResolve): Report circular implicit
16579         conversions when we neecd to compute it for conditional
16580         expressions. 
16581
16582         (Is.DoResolve): If the expression is always of the provided type,
16583         flag warning 183.  If the expression can not ever be of the
16584         provided type flag warning 184.
16585
16586         * class.cs: Catch 169 as well.
16587
16588         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16589         read. 
16590
16591 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16592
16593         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16594
16595 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16596
16597         * interface.cs: (PopulateMethod): Check for pointers being defined
16598         only if the unsafe context is active.
16599         (PopulateProperty): ditto.
16600         (PopulateIndexer): ditto.
16601
16602         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16603         specified.  If pointers are present, make sure that they are
16604         present in an unsafe context.
16605         (Constructor, Constructor.Define): ditto.
16606         (Field, Field.Define): ditto.
16607         (Property, Property.Define): ditto.
16608         (Event, Event.Define): ditto.
16609
16610         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16611         hashtable if there are classes or structs defined.
16612
16613         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16614         code, as the constant resolution moved.
16615
16616         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16617         the metadata, so we can flag error 133. 
16618
16619         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16620         pointer is being declared in an unsafe context.
16621
16622 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16623
16624         * modifiers.cs (Modifiers.Check): Require a Location argument.
16625         Report error 227 for Unsafe use.
16626
16627         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16628
16629         * statement.cs (For.Emit): If the test is null, then report that
16630         we do `return', as we wont reach anything afterwards.
16631
16632         (Switch.SwitchGoverningType): Track the expression that matched
16633         the conversion.
16634
16635         * driver.cs: Allow negative numbers as an error code to flag.
16636
16637         * cs-parser.jay: Handle 1551.
16638
16639         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16640
16641 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16642
16643         * cs-parser.jay: Report 1518 (type declaration can only contain
16644         class, struct, interface, enum or delegate)
16645
16646         (switch_label): Report 1523 (keywords `case' or `default' must
16647         preced code)
16648
16649         (opt_switch_sections): Report 1522 (empty switch)
16650
16651         * driver.cs: Report 1515 (response file specified multiple times)
16652         Report 1516 (Source file specified multiple times).
16653
16654         * expression.cs (Argument.Resolve): Signal 1510
16655
16656         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16657         access not allowed in static code)
16658
16659 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16660
16661         * typemanager.cs (IsPointerType): Utility method which we are going
16662         to need a lot.
16663
16664         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16665         the object type, so we take care of that.
16666
16667         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16668
16669         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16670         added to non-params parameters :-)
16671
16672         * typemanager.cs (CSharpName): Include 'void' type too. 
16673
16674         (void_ptr_type): Include in the set of core types.
16675
16676         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16677         duplicating code.
16678
16679         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16680         an unsafe context.
16681
16682         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16683         completely forgotten about it.
16684
16685 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16686
16687         * cs-parser.jay (pointer_type): Add. This begins our implementation
16688         of parsing rules for unsafe code.
16689
16690         (unsafe_statement): Implement.
16691
16692         (embedded_statement): Modify to include the above.
16693
16694         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16695
16696         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16697         if the current context is an unsafe one.
16698
16699         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16700         are handled differently, we need separate rules for them.
16701
16702         (local_variable_declaration): Update to use local_variable_pointer_type
16703         to allow variable declarations of unmanaged pointer types.
16704
16705         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16706         in unsafe contexts.
16707
16708         * ../errors/cs0214.cs : Add.
16709
16710 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16711
16712         * makefile: remove 'response' file when cleaning.
16713
16714 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16715
16716         * cs-parser.jay: Report 1524.
16717
16718 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16719
16720         * typemanager.cs (RegisterMethod): drop checking if we have
16721         registered this from here
16722
16723 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16724
16725         * class.cs (Method.EmitDestructor): Implement calling our base
16726         destructor. 
16727
16728         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16729         value of InFinally.
16730
16731         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16732         this routine and will wrap the call in a try/catch block.  Deal
16733         with the case.
16734
16735 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * ecore.cs (Expression.MemberLookup): instead of taking a
16738         parameter `same_type' that was used to tell whether we could
16739         access private members we compute our containing type from the
16740         EmitContext.
16741
16742         (FieldExpr): Added partial support for volatile fields.  This does
16743         not work for volatile fields exposed from assemblies, as I can not
16744         figure out how to extract the modreq from it.
16745
16746         Updated all the source files to use this.
16747
16748         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16749         because it is referenced by MemberLookup very often. 
16750
16751 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16752
16753         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16754         TypeBuilder.GetCustomAttributes to retrieve what we need.
16755
16756         Get rid of redundant default_member_attr_type as this is the same as
16757         default_member_type which already exists.
16758
16759         * interface.cs, attribute.cs : Update accordingly.
16760
16761 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16762
16763         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16764         work for TYpeBuilders though.  Ravi, can you please fix this?
16765
16766         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16767
16768         * expression.cs (Argument.Emit): Handle the case of ref objects
16769         being passed to ref functions;  
16770
16771         (ParameterReference.EmitLoad): Loads the content of the pointer
16772         without dereferencing.
16773
16774 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16775
16776         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16777
16778 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16779
16780         * class.cs (Indexer.DefineMethod): Incorporate the interface
16781         type in the name of the method if we are doing explicit interface
16782         implementation.
16783
16784         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16785
16786         (BetterConversion): Fix extremely trivial bug where we were referring to
16787         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16788         again !
16789
16790         * ../errors/bug16.cs : Add although we have fixed it.
16791
16792 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16793
16794         * expression.cs (BaseIndexer): Begin implementation.
16795
16796         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16797
16798         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16799         production directly to remove a shift/reduce, and implement
16800         explicit interface implementation.
16801
16802         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16803         after a floating point suffix.
16804
16805         * expression.cs (DoNumericPromotions): Improved the conversion for
16806         uint/uint.  If we have a constant, we avoid doing a typecast to a
16807         larger type.
16808
16809         * class.cs (Indexer): Implement explicit interface implementation
16810         for indexers.
16811
16812 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16813
16814         * class.cs: make the default instance constructor public and hidebysig.
16815
16816 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16817
16818         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16819         so we can call it from elsewhere.
16820
16821         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16822         we emit it internally if the class has a defined indexer; otherwise the user
16823         emits it by decorating the class definition with the DefaultMemberAttribute.
16824
16825         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16826         attribute is not used on a type which defines an indexer.
16827
16828         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16829         character when we skip whitespace.
16830
16831         * ../errors/cs0646.cs : Add.
16832
16833 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16834
16835         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16836         again. 
16837
16838         * makefile: Add practical target `mcs3.exe' which builds the third
16839         generation compiler. 
16840
16841         * expression.cs (New): Fix structures constructor calling.
16842
16843         * class.cs (Property, Method, Indexer): Emit Final flag on the
16844         method if we are an interface implementation and we are not
16845         abstract. 
16846
16847         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16848         whether this property is referencing a `base' method.
16849
16850         * expression.cs (Invocation.EmitCall): take an extra argument:
16851         is_base, this is used to determine whether the `call' or
16852         `callvirt' opcode should be used.
16853
16854
16855         * delegate.cs: update EmitCall.
16856
16857         * class.cs (Method.Define): Set NewSlot for the cases where we are
16858         not implementing an interface method.
16859
16860         (Property.Define): ditto.
16861
16862 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16863
16864         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16865         'r'.  Allows mcs to parse itself fully.
16866
16867 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16868
16869         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16870         of the number of initializers that require the InitializeArray method.
16871
16872         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16873         update the above field where necessary.
16874
16875         (MakeByteBlob): Update accordingly.
16876
16877         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16878         greater than 2.
16879
16880         (EmitDynamicInitializers): Update in accordance with the new optimization.
16881
16882         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16883         same OpCode applies.
16884
16885         * cs-parser.jay : Fix some glaring errors I introduced.
16886
16887 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16888
16889         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16890         so that we can check for name clashes there too.
16891
16892         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16893         for interface indexers.
16894
16895         * interfaces.cs (Define): Emit the default member attribute.
16896
16897         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16898         variable was being referred to while setting the value ;-)
16899
16900 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16903         byte-by-byte information when we know the data is zero.
16904
16905         Make the block always a multiple of 4, because
16906         DefineInitializedData has a bug.
16907
16908         * assign.cs: Fix, we should assign from the temporary, not from
16909         the source. 
16910
16911         * expression.cs (MakeByteBlob): Fix my incorrect code.
16912
16913 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16914
16915         * typemanager.cs (EnumToUnderlying): This function is used to get
16916         the underlying type from an enumeration, because it does not
16917         always work. 
16918
16919         * constant.cs: Use the I4_S form for values between -128 and 127.
16920
16921         * statement.cs (Block.LookupLabel): Looks up a label.
16922         (Block): Drop support for labeled blocks.
16923
16924         (LabeledStatement): New kind of statement that represents a label
16925         only.
16926
16927         (Goto): Finally implement this bad boy.
16928
16929         * cs-parser.jay: Update to reflect new mechanism to implement
16930         labels.
16931
16932 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16933
16934         * codegen.cs (EmitContext.This): a codegen property that keeps the
16935         a single instance of this instead of creating many different this
16936         instances. 
16937
16938         * delegate.cs (Delegate.DoResolve): Update to use the property;
16939
16940         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16941
16942         * expression.cs (BaseAccess.DoResolve): Ditto.
16943
16944 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16945
16946         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16947         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16948
16949         (InitCoreTypes): Update accordingly.
16950
16951         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16952         so we can quickly store the state.
16953
16954         (ApplyAttributes): Set the correct implementation flags
16955         for InternalCall methods.
16956
16957 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16958
16959         * expression.cs (EmitCall): if a method is not virtual, then do
16960         not use callvirt on it.
16961
16962         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16963         user defined stuff) requires the use of stobj, which takes an
16964         address on the stack instead of an array and an index.  So emit
16965         the Ldelema operation for it.
16966
16967         (EmitStoreOpcode): Use stobj for valuetypes.
16968
16969         (UnaryMutator.EmitCode): Use the right 1 value depending on
16970         whether we are dealing with int64/uint64, float or doubles.
16971
16972         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16973         constructors that I implemented last night.
16974
16975         (Constructor.IsDefault): Fix to work properly for static
16976         constructors.
16977
16978         * cs-parser.jay (CheckDef): report method signature errors.
16979         Update error number 103 to be 132.
16980
16981         * decl.cs: New AdditionResult enumeration value: MethodExists.
16982         Although we do this check for methods later on in the semantic
16983         analysis, catching repeated default constructors is so easy that
16984         we catch these here. 
16985
16986         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16987         promotions code.
16988
16989         (ParameterReference.EmitAssign, Emit): handle
16990         bools as bytes.
16991
16992         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16993         (ArrayAccess.EmitStoreOpcode): ditto.
16994
16995         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16996
16997         * expression.cs (MakeByteBlob): Complete all the missing types
16998         (uint, short, ushort, byte, sbyte)
16999
17000         * class.cs: Only init instance field initializers on instance
17001         constructors. 
17002
17003         Rename `constructors' to instance_constructors. 
17004
17005         (TypeContainer.AddConstructor): Only add constructors to the list
17006         if it is not static.
17007
17008         Make sure that we handle default_static_constructor independently
17009         everywhere where we handle instance_constructors
17010
17011 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17012
17013         * class.cs: Do not lookup or create a base initializer for a
17014         static constructor.
17015
17016         (ConstructorInitializer.Resolve): use the proper type to lookup
17017         for constructors.
17018
17019         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17020
17021         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17022         in DeclSpace. 
17023
17024         * decl.cs: CloseType is now an virtual method, the default
17025         implementation just closes this type.
17026
17027 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17028
17029         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17030         to PreserveSig by default. Also emit HideBySig on such methods.
17031
17032         Basically, set the defaults to standard values.
17033
17034         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17035         argument, if candidate is better, it can't be worse than the best !
17036
17037         (Invocation): Re-write bits to differentiate between methods being
17038         applicable in their expanded form and their normal form - for params
17039         methods of course.
17040
17041         Get rid of use_standard everywhere as only standard conversions are allowed
17042         in overload resolution. 
17043
17044         More spec conformance.
17045
17046 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17047
17048         * driver.cs: Add --timestamp, to see where the compiler spends
17049         most of its time.
17050
17051         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17052         `this' in static code.
17053
17054         (SimpleName.DoResolve): Implement in terms of a helper function
17055         that allows static-references to be passed upstream to
17056         MemberAccess.
17057
17058         (Expression.ResolveWithSimpleName): Resolve specially simple
17059         names when called by MemberAccess to implement the special
17060         semantics. 
17061
17062         (Expression.ImplicitReferenceConversion): Handle conversions from
17063         Null to reference types before others, as Null's type is
17064         System.Object. 
17065
17066         * expression.cs (Invocation.EmitCall): Handle the special case of
17067         calling methods declared on a reference type from a ValueType
17068         (Base classes System.Object and System.Enum)
17069
17070         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17071         the left hand side is a TypeExpr, not on every enumeration. 
17072
17073         (Binary.Resolve): If types are reference types, then do a cast to
17074         object on operators != and == of both arguments.
17075
17076         * typemanager.cs (FindMembers): Extract instance and static
17077         members if requested.
17078
17079         * interface.cs (PopulateProperty): Use void_type instead of null
17080         as the return type for the setter method.
17081
17082         (PopulateIndexer): ditto.
17083
17084 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17085
17086         * support.cs (ReflectionParameters): Fix minor bug where we
17087         were examining the wrong parameter for the ParamArray attribute.
17088
17089         Cope with requests for the type of the parameter at position
17090         greater than the params parameter's. We now return the element
17091         type of the params array as that makes more sense.
17092
17093         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17094         accordingly as we no longer have to extract the element type
17095         ourselves.
17096
17097         (Invocation.OverloadResolve): Update.
17098
17099 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17100
17101         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17102         against IEnumerator, test whether the return value is a descendant
17103         of the IEnumerator interface.
17104
17105         * class.cs (Indexer.Define): Use an auxiliary method to implement
17106         the other bits of the method definition.  Begin support for
17107         explicit interface implementation.
17108
17109         (Property.DefineMethod): Use TypeManager.void_type instead of null
17110         for an empty return value.
17111
17112 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17113
17114         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17115         dealing with a FieldExpr which is composed of a FieldBuilder, in
17116         the code path we did extract the constant, but we should have
17117         obtained the underlying value to be able to cast it (otherwise we
17118         end up in an infinite loop, this is what Ravi was running into).
17119
17120         (ArrayCreation.UpdateIndices): Arrays might be empty.
17121
17122         (MemberAccess.ResolveMemberAccess): Add support for section
17123         14.5.4.1 that deals with the special case of E.I when E is a type
17124         and something else, that I can be a reference to a static member.
17125
17126         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17127         handle a particular array type to create byte blobs, it is just
17128         something we dont generate byteblobs for.
17129
17130         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17131         arguments. 
17132
17133         * location.cs (Push): remove the key from the hashtable that we
17134         are about to add.   This happens for empty files.
17135
17136         * driver.cs: Dispose files after we have parsed them.
17137
17138         (tokenize): new function that only runs the tokenizer on its
17139         input, for speed testing.
17140
17141 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17142
17143         * class.cs (Event.Define): Define the private field only if there
17144         are no accessors defined.
17145
17146         * expression.cs (ResolveMemberAccess): If there is no associated
17147         field with the event, that means we have an event defined with its
17148         own accessors and we should flag error cs0070 since transforming
17149         ourselves into a field is not valid in that case.
17150
17151         * ecore.cs (SimpleName.DoResolve): Same as above.
17152
17153         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17154         and charset to sane values.
17155
17156 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17157
17158         * assign.cs (DoResolve): Perform check on events only if they 
17159         are being accessed outside the declaring type.
17160
17161         * cs-parser.jay (event_declarations): Update rules to correctly
17162         set the type of the implicit parameter etc.
17163
17164         (add_accessor, remove_accessor): Set current local parameters.
17165
17166         * expression.cs (Binary): For delegate addition and subtraction,
17167         cast the return value from the method into the appropriate delegate
17168         type.
17169
17170 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17171
17172         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17173         of these as the workaround is unnecessary.
17174
17175         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17176         delegate data - none of that is needed at all.
17177
17178         Re-write bits to extract the instance expression and the delegate method
17179         correctly.
17180
17181         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17182         on delegates too.
17183
17184         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17185         of attaching attributes instead of duplicating code everywhere.
17186
17187         * everywhere : Update code to do attribute emission using the above method.
17188
17189 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17190
17191         * expression.cs (IsParamsMethodApplicable): if there are not
17192         parameters, return immediately.
17193
17194         * ecore.cs: The 0 literal can be implicity converted to an enum
17195         type. 
17196
17197         (SimpleName.DoResolve): First lookup the type, then lookup the
17198         members. 
17199
17200         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17201         want to get its address.  If the InstanceExpression is not
17202         addressable, store the result in a temporary variable, then get
17203         the address of it.
17204
17205         * codegen.cs: Only display 219 errors on warning level or above. 
17206
17207         * expression.cs (ArrayAccess): Make it implement the
17208         IMemoryLocation interface.
17209
17210         (Binary.DoResolve): handle the operator == (object a, object b)
17211         and operator != (object a, object b) without incurring into a
17212         BoxedCast (because 5 != o should never be performed).
17213
17214         Handle binary enumerator operators.
17215
17216         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17217         value type, otherwise use Ldelem_ref.
17218
17219         Use precomputed names;
17220
17221         (AddressOf): Implement address of
17222
17223         * cs-parser.jay (labeled_statement): Fix recursive block
17224         addition by reworking the production.
17225
17226         * expression.cs (New.DoEmit): New has a special case:
17227                 
17228                  If we are dealing with a ValueType, we have a few
17229                  situations to deal with:
17230                 
17231                     * The target of New is a ValueType variable, that is
17232                       easy, we just pass this as the variable reference
17233                 
17234                     * The target of New is being passed as an argument,
17235                       to a boxing operation or a function that takes a
17236                       ValueType.
17237                 
17238                       In this case, we need to create a temporary variable
17239                       that is the argument of New.
17240
17241
17242 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17243
17244         * rootcontext.cs (LookupType): Check that current_type is not null before
17245         going about looking at nested types.
17246
17247         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17248         not implement the IAssignMethod interface any more.
17249
17250         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17251         where we tranform them into FieldExprs if they are being resolved from within
17252         the declaring type.
17253
17254         * ecore.cs (SimpleName.DoResolve): Do the same here.
17255
17256         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17257
17258         * ../errors/bug10.cs : Add.
17259
17260         * ../errors/cs0070.cs : Add.
17261
17262         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17263
17264         * assign.cs : Get rid of EventIsLocal everywhere.
17265
17266 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17267
17268         * ecore.cs (ConvertIntLiteral): finished the implementation.
17269
17270         * statement.cs (SwitchLabel): Convert the value we are using as a
17271         key before looking up the table.
17272
17273 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17274
17275         * codegen.cs (EmitTopBlock): Require a Location argument now.
17276
17277         * cs-parser.jay (constructor_declarator): We need to setup
17278         current_local_parameters before we parse the
17279         opt_constructor_initializer, to allow the variables to be bound
17280         to the constructor arguments.
17281
17282         * rootcontext.cs (LookupType): First lookup nested classes in our
17283         class and our parents before we go looking outside our class.
17284
17285         * expression.cs (ConstantFold): Extract/debox the values at the
17286         beginnning. 
17287
17288         * rootcontext.cs (EmitCode): Resolve the constants first before we
17289         resolve the types.  This is not really needed, but it helps debugging.
17290
17291         * statement.cs: report location.
17292
17293         * cs-parser.jay: pass location to throw statement.
17294
17295         * driver.cs: Small bug fix.
17296
17297         * report.cs: Updated format to be 4-zero filled digits.
17298
17299 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17300
17301         * expression.cs (CheckIndices): Fix minor bug where the wrong
17302         variable was being referred to ;-)
17303
17304         (DoEmit): Do not call EmitStaticInitializers when the 
17305         underlying type is System.Object.
17306
17307 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17308
17309         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17310         and do the usual workaround for SRE.
17311
17312         * class.cs (MyEventBuilder.EventType): New member to get at the type
17313         of the event, quickly.
17314
17315         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17316
17317         * assign.cs (Assign.DoResolve): Handle the case when the target
17318         is an EventExpr and perform the necessary checks.
17319
17320         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17321         interface.
17322
17323         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17324
17325         (EventExpr): Set the type in the constructor itself since we 
17326         are meant to be born fully resolved.
17327
17328         (EventExpr.Define): Revert code I wrote earlier.
17329                 
17330         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17331         instance expression is null. The instance expression is a This in that case
17332         or a null, depending on whether it is a static method or not.
17333
17334         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17335         refers to more than one method.
17336
17337         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17338         and accordingly flag errors.
17339
17340 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17341
17342         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17343
17344 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17345
17346         * location.cs (ToString): Provide useful rutine.
17347
17348 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17351         objects, return the actual integral boxed.
17352
17353         * statement.cs (SwitchLabel): define an ILLabel for each
17354         SwitchLabel. 
17355
17356         (Switch.CheckSwitch): If the value is a Literal, extract
17357         the underlying literal.
17358
17359         Also in the unused hashtable we had, add the SwitchLabel so we can
17360         quickly look this value up.
17361
17362         * constant.cs: Implement a bunch of new constants.  Rewrite
17363         Literal based on this.  Made changes everywhere to adapt to this.
17364
17365         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17366         dereferencing array only once, and also copes with enumrations.
17367
17368         bytes are two bytes wide, not one.
17369
17370         (Cast): Perform constant conversions.
17371
17372         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17373         wrappers to the literals here.
17374
17375         * expression.cs (DoNumericPromotions): long literals can converted
17376         to ulong implicity (this is taken care of elsewhere, but I was
17377         missing this spot).
17378
17379         * ecore.cs (Expression.Literalize): Make the return type Literal,
17380         to improve type checking.
17381
17382         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17383
17384 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17385
17386         * literal.cs: Revert code from ravi that checked the bounds.  The
17387         bounds are sane by the definition of the type itself. 
17388
17389         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17390         need to actually look up in our parent hierarchy for interfaces
17391         implemented. 
17392
17393         * const.cs: Use the underlying type for enumerations
17394
17395         * delegate.cs: Compute the basename for the delegate creation,
17396         that should fix the delegate test case, and restore the correct
17397         Type Lookup semantics in rootcontext
17398
17399         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17400         referencing a nested type with the Reflection API is using the "+"
17401         sign. 
17402
17403         * cs-parser.jay: Do not require EOF token at the end.
17404
17405 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17406
17407         * rootcontext.cs (LookupType): Concatenate type names with
17408         a '.' instead of a '+' The test suite passes again.
17409
17410         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17411         field of the enumeration.
17412
17413         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17414         the case when the member is an EventExpr.
17415
17416         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17417         static has an associated instance expression.
17418
17419         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17420
17421         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17422
17423         * class.cs (Event.Define): Register event and perform appropriate checks
17424         for error #111.
17425
17426         We define the Add and Remove methods even if the use provides none because
17427         in that case, we provide default implementations ourselves.
17428
17429         Define a private field of the type of the event. This is done by the CSC compiler
17430         and we should be doing it too ;-)
17431
17432         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17433         More methods we use in code we generate.
17434
17435         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17436         is important.
17437
17438         (InitCoreTypes): Update accordingly for the above.
17439
17440         * class.cs (Event.Emit): Generate code for default accessors that we provide
17441
17442         (EmitDefaultMethod): Do the job in the above.
17443
17444         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17445         appropriate place.
17446
17447 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17448
17449         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17450         builders even if we were missing one.
17451
17452         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17453         pass the Basename as our class name instead of the Name.  The
17454         basename will be correctly composed for us.
17455
17456         * parameter.cs (Paramters): Now takes a Location argument.
17457
17458         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17459         make all the code call directly LookupType in RootContext and take
17460         this chance to pass the Location information everywhere.
17461
17462         * Everywhere: pass Location information.
17463
17464 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17465
17466         * class.cs (Constructor.Define): Updated way of detecting the
17467         length of the parameters.
17468
17469         (TypeContainer.DefineType): Use basename as the type name for
17470         nested types.
17471
17472         (TypeContainer.Define): Do not recursively define types here, as
17473         definition is taken care in order by the RootContext.
17474
17475         * tree.cs: Keep track of namespaces in a per-file basis.
17476
17477         * parameter.cs (Parameter.ComputeSignature): Update to use
17478         DeclSpace. 
17479
17480         (Parameters.GetSignature): ditto.
17481
17482         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17483         instead of a TypeContainer.
17484
17485         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17486         resolve names.  Because we need to be resolve in our context, not
17487         our parents.
17488
17489         * driver.cs: Implement response files.
17490
17491         * class.cs (TypeContainer.DefineType): If we are defined, do not
17492         redefine ourselves.
17493
17494         (Event.Emit): Emit the code for add/remove handlers.
17495         (Event.Define): Save the MethodBuilders for add/remove.
17496
17497         * typemanager.cs: Use pair here too.
17498
17499         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17500         DictionaryEntry requires the first argument to be non-null.  
17501
17502         (enum_declaration): Compute full name for registering the
17503         enumeration.
17504
17505         (delegate_declaration): Instead of using
17506         formal_parameter_list, use opt_formal_parameter_list as the list
17507         can be empty.
17508
17509         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17510         (EventParsing): New property that controls whether `add' and
17511         `remove' are returned as tokens or identifiers (for events);
17512
17513 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17514
17515         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17516         use MyEventBuilder only and let it wrap the real builder for us.
17517
17518         (MyEventBuilder): Revamp constructor etc.
17519
17520         Implement all operations that we perform on EventBuilder in precisely the same
17521         way here too.
17522
17523         (FindMembers): Update to use the EventBuilder member.
17524
17525         (Event.Emit): Update accordingly.
17526
17527 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17528
17529         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17530         by calling the appropriate methods.
17531
17532         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17533         useful.
17534
17535         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17536
17537 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17538
17539         * delegate.cs (Delegate.Populate): Check that the return type
17540         and various parameters types are indeed accessible.
17541
17542         * class.cs (Constructor.Define): Same here.
17543
17544         (Field.Define): Ditto.
17545
17546         (Event.Define): Ditto.
17547
17548         (Operator.Define): Check that the underlying Method defined itself
17549         correctly - so it's MethodBuilder should not be null.
17550
17551         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17552         expression happens to be null.
17553
17554         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17555         members but as of now we don't seem to be able to do anything really useful with it.
17556
17557         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17558         not the EventBuilder.
17559
17560 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * cs-tokenizer.cs: Add support for defines.
17563         Add support for #if, #elif, #else, #endif
17564
17565         (eval_var): evaluates a variable.
17566         (eval): stubbed for evaluating functions.
17567
17568         * cs-parser.jay: Pass the defines information
17569
17570         * driver.cs: Add --define command line option.
17571
17572         * decl.cs: Move MemberCore here.
17573
17574         Make it the base class for DeclSpace.  This allows us to catch and
17575         report 108 and 109 for everything now.
17576
17577         * class.cs (TypeContainer.Define): Extract all the members
17578         before populating and emit the warning 108 (new keyword required
17579         to override) instead of having each member implement this.
17580
17581         (MemberCore.Define): New abstract method, we will be using this in
17582         the warning reporting engine in Populate.
17583
17584         (Operator.Define): Adjust to new MemberCore protocol. 
17585
17586         * const.cs (Const): This does not derive from Expression, it is a
17587         temporary object we use to create fields, it is a MemberCore. 
17588
17589         * class.cs (Method.Define): Allow the entry point to be in a
17590         specific class.
17591
17592         * driver.cs: Rewrite the argument handler to clean it up a bit.
17593
17594         * rootcontext.cs: Made it just an auxiliary namespace feature by
17595         making everything static.
17596
17597         * driver.cs: Adapt code to use RootContext type name instead of
17598         instance variable.
17599
17600         * delegate.cs: Remove RootContext argument.
17601
17602         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17603         argument. 
17604
17605         * class.cs (Event.Define): The lookup can fail.
17606
17607         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17608
17609         * expression.cs: Resolve the this instance before invoking the code.
17610
17611 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17612
17613         * cs-parser.jay: Add a production in element_access that allows
17614         the thing to become a "type" reference.  This way we can parse
17615         things like "(string [])" as a type.
17616
17617         Note that this still does not handle the more complex rules of
17618         casts. 
17619
17620
17621         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17622
17623         * ecore.cs: (CopyNewMethods): new utility function used to
17624         assemble the list of methods from running FindMembers.
17625
17626         (MemberLookup): Rework FindMembers so that 
17627
17628 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17629
17630         * class.cs (TypeContainer): Remove Delegates who fail to be
17631         defined.
17632
17633         * delegate.cs (Populate): Verify that we dont get null return
17634         values.   TODO: Check for AsAccessible.
17635
17636         * cs-parser.jay: Use basename to emit error 574 (destructor should
17637         have the same name as container class), not the full name.
17638
17639         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17640         possible representation.  
17641
17642         Also implements integer type suffixes U and L.
17643
17644 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17645
17646         * expression.cs (ArrayCreation.DoResolve): We need to do the
17647         argument resolution *always*.
17648
17649         * decl.cs: Make this hold the namespace.  Hold the root context as
17650         well.
17651         (LookupType): Move here.
17652
17653         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17654
17655         * location.cs (Row, Name): Fixed the code, it was always returning
17656         references to the first file.
17657
17658         * interface.cs: Register properties defined through interfaces.
17659
17660         * driver.cs: Add support for globbing on the command line
17661
17662         * class.cs (Field): Make it derive from MemberCore as well.
17663         (Event): ditto.
17664
17665 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17666
17667         * class.cs (Event::Define): Check that the type of the event is a delegate
17668         type else flag error #66.
17669
17670         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17671         same.
17672
17673         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17674         values of EntryPoint, CharSet etc etc.
17675
17676         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17677
17678         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17679         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17680         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17681         which needs this to do its work.
17682
17683         * ../errors/cs0066.cs : Add.
17684
17685 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17686
17687         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17688         helper functions.
17689
17690         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17691         clears out the parameters field.
17692         (MemberSignatureCompare): Cleanup
17693
17694         (MemberCore): New base class used to share code between MethodCore
17695         and Property.
17696
17697         (RegisterRequiredImplementations) BindingFlags.Public requires
17698         either BindingFlags.Instace or Static.  Use instance here.
17699
17700         (Property): Refactored code to cope better with the full spec.
17701
17702         * parameter.cs (GetParameterInfo): Return an empty array instead
17703         of null on error.
17704
17705         * class.cs (Property): Abstract or extern properties have no bodies.
17706
17707         * parameter.cs (GetParameterInfo): return a zero-sized array.
17708
17709         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17710         method modifier validation to the typecontainer so we can reuse
17711         this on properties.
17712
17713         (MethodCore.ParameterTypes): return an empty sized array of types.
17714
17715         (Property.Define): Test property modifier validity.
17716
17717         Add tests for sealed/override too.
17718
17719         (Method.Emit): abstract or extern methods have no bodies.
17720
17721 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17722
17723         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17724         thing.
17725
17726         (Method::Define, ::Emit): Modify accordingly.
17727
17728         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17729
17730         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17731
17732         * makefile: Pass in /unsafe.
17733
17734 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17735
17736         * class.cs (MakeKey): Kill routine.
17737
17738         * class.cs (TypeContainer.Define): Correctly define explicit
17739         method implementations (they require the full interface name plus
17740         the method name).
17741
17742         * typemanager.cs: Deply the PtrHashtable here and stop using the
17743         lame keys.  Things work so much better.
17744
17745         This of course broke everyone who depended on `RegisterMethod' to
17746         do the `test for existance' test.  This has to be done elsewhere.
17747
17748         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17749         the object stupid Equals method (because, that like fails all over
17750         the place).  We still do not use it.
17751
17752         * class.cs (TypeContainer.SetRequiredInterface,
17753         TypeContainer.RequireMethods): Killed these two routines and moved
17754         all the functionality to RegisterRequiredImplementations.
17755
17756         (TypeContainer.RegisterRequiredImplementations): This routine now
17757         registers all the implementations required in an array for the
17758         interfaces and abstract methods.  We use an array of structures
17759         which can be computed ahead of time to reduce memory usage and we
17760         also assume that lookups are cheap as most classes will not
17761         implement too many interfaces.
17762
17763         We also avoid creating too many MethodSignatures.
17764
17765         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17766         clear the "pending" bit if we find that there are problems with
17767         the declaration.
17768
17769         (TypeContainer.VerifyPendingMethods): Update to report errors of
17770         methods that look like implementations but are not.
17771
17772         (TypeContainer.Define): Add support for explicit interface method
17773         implementation. 
17774
17775 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17776
17777         * typemanager.cs: Keep track of the parameters here instead of
17778         being a feature of the TypeContainer.
17779
17780         * class.cs: Drop the registration of parameters here, as
17781         InterfaceMethods are also interface declarations.
17782
17783         * delegate.cs: Register methods with the TypeManager not only with
17784         the TypeContainer.  This code was buggy.
17785
17786         * interface.cs: Full registation here.
17787
17788 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17789
17790         * expression.cs: Remove reducer for binary expressions, it can not
17791         be done this way.
17792
17793         * const.cs: Put here the code that used to go into constant.cs
17794
17795         * constant.cs: Put here the code for constants, this is a new base
17796         class for Literals.
17797
17798         * literal.cs: Make Literal derive from Constant.
17799
17800 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * statement.cs (Return.Emit): Report error 157 if the user
17803         attempts to return from a finally block.
17804
17805         (Return.Emit): Instead of emitting a return, jump to the end of
17806         the function.
17807
17808         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17809         LocalBuilder to store the result of the function.  ReturnLabel is
17810         the target where we jump.
17811
17812
17813 2001-12-09  Radek Doulik  <rodo@ximian.com>
17814
17815         * cs-parser.jay: remember alias in current namespace
17816
17817         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17818         namespaces
17819
17820         * class.cs (LookupAlias): lookup alias in my_namespace
17821
17822         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17823         aliases hashtable
17824         (LookupAlias): lookup alias in this and if needed in parent
17825         namespaces
17826
17827 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17828
17829         * support.cs: 
17830
17831         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17832         making things static.  I need this to avoid passing the
17833         TypeContainer when calling ParameterType.
17834
17835         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17836         that did string manipulation to compute the type and then call
17837         GetType.  Use Parameter.ParameterType instead.
17838
17839         * cs-tokenizer.cs: Consume the suffix for floating values.
17840
17841         * expression.cs (ParameterReference): figure out whether this is a
17842         reference parameter or not.  Kill an extra variable by computing
17843         the arg_idx during emission.
17844
17845         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17846         function that returns whether a parameter is an out/ref value or not.
17847
17848         (Parameter.ParameterType): The type of the parameter (base,
17849         without ref/out applied).
17850
17851         (Parameter.Resolve): Perform resolution here.
17852         (Parameter.ExternalType): The full type (with ref/out applied).
17853
17854         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17855         support for expressions on the using statement.
17856
17857 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17858
17859         * statement.cs (Using.EmitLocalVariableDecls): Split the
17860         localvariable handling of the using statement.
17861
17862         (Block.EmitMeta): Keep track of variable count across blocks.  We
17863         were reusing slots on separate branches of blocks.
17864
17865         (Try.Emit): Emit the general code block, we were not emitting it. 
17866
17867         Check the type of the declaration to be an IDisposable or
17868         something that can be implicity converted to it. 
17869
17870         Emit conversions if required.
17871
17872         * ecore.cs (EmptyExpression): New utility class.
17873         (Expression.ImplicitConversionExists): New utility function.
17874
17875 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17876
17877         * statement.cs (Using): Implement.
17878
17879         * expression.cs (LocalVariableReference): Support read only variables.
17880
17881         * statement.cs: Remove the explicit emit for the Leave opcode.
17882         (VariableInfo): Add a readonly field.
17883
17884 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17885
17886         * ecore.cs (ConvCast): new class used to encapsulate the various
17887         explicit integer conversions that works in both checked and
17888         unchecked contexts.
17889
17890         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17891         properly generate the overflow opcodes.
17892
17893 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17894
17895         * statement.cs: The correct type for the EmptyExpression is the
17896         element_type, not the variable type.  Ravi pointed this out.
17897
17898 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17899
17900         * class.cs (Method::Define): Handle PInvoke methods specially
17901         by using DefinePInvokeMethod instead of the usual one.
17902
17903         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17904         above to do the task of extracting information and defining the method.
17905
17906 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17907
17908         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17909         of the condition for string type.
17910
17911         (Emit): Move that here. 
17912
17913         (ArrayCreation::CheckIndices): Keep string literals in their expression
17914         form.
17915
17916         (EmitDynamicInitializers): Handle strings appropriately.
17917
17918 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17919
17920         * codegen.cs (EmitContext): Replace multiple variables with a
17921         single pointer to the current Switch statement.
17922
17923         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17924         EmitContext.
17925
17926 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17927
17928         * statement.cs 
17929
17930         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17931         default'.
17932
17933         (Foreach.Emit): Foreach on arrays was not setting
17934         up the loop variables (for break/continue).
17935
17936         (GotoCase): Semi-implented.
17937
17938 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17939
17940         * attribute.cs (CheckAttribute): Handle system attributes by using
17941         Attribute.GetAttributes to examine information we need.
17942
17943         (GetValidPlaces): Same here.
17944
17945         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17946
17947         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17948
17949         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17950
17951         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17952
17953         (Method::Emit): Handle the case when we are a PInvoke method.
17954
17955 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17956
17957         * expression.cs: Use ResolveWithSimpleName on compound names.
17958
17959 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17960
17961         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17962         before trying to reduce it.
17963
17964         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17965
17966         * constant.cs (LookupConstantValue): Implement.
17967
17968         (EmitConstant): Use the above in emitting the constant.
17969
17970         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17971         that are user-defined by doing a LookupConstantValue on them.
17972
17973         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17974         too, like above.
17975
17976 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17977
17978         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17979
17980         (BaseAccess.DoResolve): Implement.
17981
17982         (MemberAccess.DoResolve): Split this routine into a
17983         ResolveMemberAccess routine that can be used independently
17984
17985 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17986
17987         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17988         As that share bits of the implementation.  Is returns a boolean,
17989         while As returns the Type that is being probed.
17990
17991 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17992
17993         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17994         instead of a Literal - much easier.
17995
17996         (EnumInTransit): Remove - utterly useless :-)
17997
17998         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17999
18000         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18001
18002         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18003         chain when we have no associated expression.
18004
18005 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18006
18007         * constant.cs (Define): Use Location while reporting the errror.
18008
18009         Also emit a warning when 'new' is used and there is no inherited
18010         member to hide.
18011
18012         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18013         populated.
18014
18015         (LookupEnumValue): Implement to lookup an enum member's value and define it
18016         if necessary.
18017
18018         (Populate): Re-write accordingly to use the above routine.
18019
18020 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18021
18022         * expression.cs (This): Fix prototype for DoResolveLValue to
18023         override the base class DoResolveLValue.
18024
18025         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18026         declarations) 
18027
18028         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18029         (we need to load the address of the field here).  This fixes
18030         test-22. 
18031
18032         (FieldExpr.DoResolveLValue): Call the DoResolve
18033         function to initialize the Instance expression.
18034
18035         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18036         correctly the GetEnumerator operation on a value type.
18037
18038         * cs-parser.jay: Add more simple parsing error catches.
18039
18040         * statement.cs (Switch): Add support for string switches.
18041         Handle null specially.
18042
18043         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18044
18045 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18046
18047         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18048
18049         (declare_local_constant): New helper function.
18050
18051         * statement.cs (AddConstant): Keep a separate record of constants
18052
18053         (IsConstant): Implement to determine if a variable is a constant.
18054
18055         (GetConstantExpression): Implement.
18056
18057         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18058
18059         * statement.cs (IsVariableDefined): Re-write.
18060
18061 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18062
18063         * class.cs (TypeContainer::FindMembers): Look for constants
18064         in the case when we are looking for MemberTypes.Field
18065
18066         * expression.cs (MemberAccess::DoResolve): Check that in the
18067         case we are a FieldExpr and a Literal, we are not being accessed
18068         by an instance reference.
18069
18070         * cs-parser.jay (local_constant_declaration): Implement.
18071
18072         (declaration_statement): Implement for constant declarations.
18073
18074 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18075
18076         * statement.cs (Switch): Catch double defaults.
18077
18078         (Switch): More work on the switch() statement
18079         implementation.  It works for integral values now, need to finish
18080         string support.
18081
18082
18083 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18084
18085         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18086         integer literals into other integer literals.  To be used by
18087         switch. 
18088
18089 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18090
18091         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18092         some memory.
18093
18094         (EmitDynamicInitializers): Cope with the above since we extract data
18095         directly from ArrayData now.
18096
18097         (ExpectInitializers): Keep track of whether initializers are mandatory
18098         or not.
18099
18100         (Bounds): Make it a hashtable to prevent the same dimension being 
18101         recorded for every element in that dimension.
18102
18103         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18104         from being found.
18105
18106         Also fix bug which was causing the indices to be emitted in the reverse
18107         order.
18108
18109 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18110
18111         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18112         unfinished.  They do not work, because the underlying code is
18113         sloppy.
18114
18115 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18116
18117         * cs-parser.jay: Remove bogus fixme.
18118
18119         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18120         on Switch statement.
18121
18122 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18123
18124         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18125         the same. 
18126
18127         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18128         parameter. Apparently, any expression is allowed. 
18129
18130         (ValidateInitializers): Update accordingly.
18131
18132         (CheckIndices): Fix some tricky bugs thanks to recursion.
18133
18134         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18135         I was being completely brain-dead.
18136
18137         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18138         and re-write acordingly.
18139
18140         (DelegateInvocation): Re-write accordingly.
18141
18142         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18143
18144         (MakeByteBlob): Handle types more correctly.
18145
18146         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18147         initialization from expressions but it is incomplete because I am a complete
18148         Dodo :-|
18149
18150 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18151
18152         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18153         on If.  Basically, we have to return `true' (ie, we do return to
18154         our caller) only if both branches of the if return.
18155
18156         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18157         short-circuit operators, handle them as short circuit operators. 
18158
18159         (Cast.DoResolve): Resolve type.
18160         (Cast.Cast): Take an expression as the target type.
18161
18162         * cs-parser.jay (cast_expression): Remove old hack that only
18163         allowed a limited set of types to be handled.  Now we take a
18164         unary_expression and we resolve to a type during semantic
18165         analysis.
18166
18167         Use the grammar productions from Rhys to handle casts (this is
18168         not complete like Rhys syntax yet, we fail to handle that corner
18169         case that C# has regarding (-x), but we will get there.
18170
18171 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18172
18173         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18174         field which is an array type.
18175
18176         * cs-parser.jay (declare_local_variables): Support array initialization too.
18177
18178         * typemanager.cs (MakeKey): Implement.
18179
18180         (everywhere): Use the above appropriately.
18181
18182         * cs-parser.jay (for_statement): Update for array initialization while
18183         declaring variables.
18184
18185         * ecore.cs : The error message was correct, it's the variable's names that
18186         were misleading ;-) Make the code more readable.
18187
18188         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18189         the correct type etc.
18190
18191         (ConvertExplicit): Handle Enum types by examining the underlying type.
18192
18193 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18194
18195         * parameter.cs (GetCallingConvention): Always return
18196         CallingConventions.Standard for now.
18197
18198 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18199
18200         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18201         and `r' after calling DoNumericPromotions.
18202
18203         * ecore.cs: Fix error message (the types were in the wrong order).
18204
18205         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18206         BindingFlags.Instance as well 
18207
18208         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18209         implicit int literal conversion in an empty cast so that we
18210         propagate the right type upstream.
18211
18212         (UnboxCast): new class used to unbox value types.
18213         (Expression.ConvertExplicit): Add explicit type conversions done
18214         by unboxing.
18215
18216         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18217         the target type before applying the implicit LongLiterals to ULong
18218         literal cast.
18219
18220 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18221
18222         * cs-parser.jay (for_statement): Reworked the way For works: now
18223         we declare manually any variables that are introduced in
18224         for_initializer to solve the problem of having out-of-band code
18225         emition (that is what got for broken).
18226
18227         (declaration_statement): Perform the actual variable declaration
18228         that used to be done in local_variable_declaration here.
18229
18230         (local_variable_declaration): Do not declare anything, just pass
18231         the information on a DictionaryEntry
18232
18233 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18234
18235         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18236         re-write of the logic to now make it recursive.
18237
18238         (UpdateIndices): Re-write accordingly.
18239
18240         Store element data in a separate ArrayData list in the above methods.
18241
18242         (MakeByteBlob): Implement to dump the array data into a byte array.
18243
18244 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18245
18246         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18247         into CheckIndices.
18248
18249         * constant.cs (Define): Implement.
18250
18251         (EmitConstant): Re-write fully.
18252
18253         Pass in location info.
18254
18255         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18256         respectively.
18257
18258         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18259         DictionaryEntry since we need location info too.
18260
18261         (constant_declaration): Update accordingly.
18262
18263         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18264         code into another method : UpdateIndices.
18265
18266 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18267
18268         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18269         some type checking etc.
18270
18271 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18272
18273         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18274         bits to provide dimension info if the user skips doing that.
18275
18276         Update second constructor to store the rank correctly.
18277
18278 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18279
18280         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18281         and try to implement.
18282
18283         * ../errors/cs0150.cs : Add.
18284
18285         * ../errors/cs0178.cs : Add.
18286
18287 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * statement.cs: Implement foreach on multi-dimensional arrays. 
18290
18291         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18292         name of the params argument.
18293
18294         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18295         initializing the array.
18296
18297         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18298         we can use this elsewhere.
18299
18300         * statement.cs: Finish implementation of foreach for single
18301         dimension arrays.
18302
18303         * cs-parser.jay: Use an out-of-band stack to pass information
18304         around, I wonder why I need this.
18305
18306         foreach_block: Make the new foreach_block the current_block.
18307
18308         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18309         function used to return a static Parameters structure.  Used for
18310         empty parameters, as those are created very frequently.
18311
18312         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18313
18314 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18315
18316         * interface.cs : Default modifier is private, not public. The
18317         make verify test passes again.
18318
18319 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18320
18321         * support.cs (ReflectionParameters): Fix logic to determine
18322         whether the last parameter is a params one. Test 9 passes again.
18323
18324         * delegate.cs (Populate): Register the builders we define with
18325         RegisterParameterForBuilder. Test 19 passes again.
18326
18327         * cs-parser.jay (property_declaration): Reference $6 instead
18328         of $$ to get at the location.
18329
18330         (indexer_declaration): Similar stuff.
18331
18332         (attribute): Ditto.
18333
18334         * class.cs (Property): Register parameters for the Get and Set methods
18335         if they exist. Test 23 passes again.
18336
18337         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18338         call to EmitArguments as we are sure there aren't any params arguments. 
18339         Test 32 passes again.
18340
18341         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18342         IndexOutOfRangeException. 
18343
18344         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18345         Test 33 now passes again.
18346
18347 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18348
18349         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18350         broke a bunch of things.  Will have to come up with a better way
18351         of tracking locations.
18352
18353         * statement.cs: Implemented foreach for single dimension arrays.
18354
18355 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18358         an error.  This removes the lookup from the critical path.
18359
18360         * cs-parser.jay: Removed use of temporary_loc, which is completely
18361         broken. 
18362
18363 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18364
18365         * support.cs (ReflectionParameters.ParameterModifier): Report
18366         whether the argument is a PARAMS argument or not.
18367
18368         * class.cs: Set the attribute `ParamArrayAttribute' on the
18369         parameter argument.
18370
18371         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18372         and cons_param_array_attribute (ConstructorInfo for
18373         ParamArrayAttribute)., 
18374
18375         * codegen.cs: Emit the return using the `Return' statement, that
18376         way we can report the error correctly for missing return values. 
18377
18378         * class.cs (Method.Emit): Clean up.
18379
18380         * expression.cs (Argument.Resolve): Take another argument: the
18381         location where this argument is used.  Notice that this is not
18382         part of the "Argument" class as to reduce the size of the
18383         structure (we know the approximate location anyways).
18384
18385         Test if the argument is a variable-reference, if not, then
18386         complain with a 206.
18387
18388         (Argument.Emit): Emit addresses of variables.
18389
18390         (Argument.FullDesc): Simplify.
18391
18392         (Invocation.DoResolve): Update for Argument.Resolve.
18393
18394         (ElementAccess.DoResolve): ditto.
18395
18396         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18397         method should be virtual, as this method is always virtual.
18398
18399         (NewDelegate.DoResolve): Update for Argument.Resolve.
18400
18401         * class.cs (ConstructorInitializer.DoResolve): ditto.
18402
18403         * attribute.cs (Attribute.Resolve): ditto.
18404
18405 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18406
18407         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18408
18409         * expression.cs (ParameterReference): Drop IStackStorage and implement
18410         IAssignMethod instead. 
18411
18412         (LocalVariableReference): ditto.
18413
18414         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18415         IAssignMethod instead. 
18416
18417 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18418
18419         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18420         enumerations that are used in heavily used structures derive from
18421         byte in a laughable and pathetic attempt to reduce memory usage.
18422         This is the kind of pre-optimzations that you should not do at
18423         home without adult supervision.
18424
18425         * expression.cs (UnaryMutator): New class, used to handle ++ and
18426         -- separatedly from the other unary operators.  Cleans up the
18427         code, and kills the ExpressionStatement dependency in Unary.
18428
18429         (Unary): Removed `method' and `Arguments' from this class, making
18430         it smaller, and moving it all to SimpleCall, so I can reuse this
18431         code in other locations and avoid creating a lot of transient data
18432         strucutres when not required.
18433
18434         * cs-parser.jay: Adjust for new changes.
18435
18436 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18437
18438         * enum.cs (Enum.Populate): If there is a failure during
18439         definition, return
18440
18441         * cs-parser.jay (opt_enum_base): we used to catch type errors
18442         here, but this is really incorrect.  The type error should be
18443         catched during semantic analysis.
18444
18445 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18446
18447         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18448         current_local_parameters as expected since I, in my stupidity, had forgotten
18449         to do this :-)
18450
18451         * attribute.cs (GetValidPlaces): Fix stupid bug.
18452
18453         * class.cs (Method::Emit): Perform check on applicability of attributes.
18454
18455         (Constructor::Emit): Ditto.
18456
18457         (Field::Emit): Ditto.
18458
18459         (Field.Location): Store location information.
18460
18461         (Property, Event, Indexer, Operator): Ditto.
18462
18463         * cs-parser.jay (field_declaration): Pass in location for each field.
18464
18465         * ../errors/cs0592.cs : Add.
18466
18467 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18468
18469         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18470
18471         (InitCoreTypes): Update accordingly.
18472
18473         (RegisterAttrType, LookupAttr): Implement.
18474
18475         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18476         info about the same.
18477
18478         (Resolve): Update to populate the above as necessary.
18479
18480         (Error592): Helper.
18481
18482         (GetValidPlaces): Helper to the above.
18483
18484         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18485
18486         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18487
18488 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18489
18490         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18491
18492         * ../errors/cs0617.cs : Add.
18493
18494 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18495
18496         * enum.cs (Emit): Rename to Populate to be more consistent with what
18497         we expect it to do and when exactly it is called.
18498
18499         * class.cs, rootcontext.cs : Update accordingly.
18500
18501         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18502         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18503
18504         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18505
18506         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18507         of a fieldinfo using the above, when dealing with a FieldBuilder.
18508
18509 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18510
18511         * ../errors/cs0031.cs : Add.
18512
18513         * ../errors/cs1008.cs : Add.
18514
18515         * ../errrors/cs0543.cs : Add.
18516
18517         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18518         enum type.
18519
18520         (FindMembers): Implement.
18521
18522         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18523         enums and delegates too.
18524
18525         (enum_types): Rename to builder_to_enum.
18526
18527         (delegate_types): Rename to builder_to_delegate.
18528
18529         * delegate.cs (FindMembers): Implement.
18530
18531 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18532
18533         * typemanager.cs (IsEnumType): Implement.
18534
18535         * enum.cs (Emit): Re-write parts to account for the underlying type
18536         better and perform checking etc.
18537
18538         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18539         of the underlying type.
18540
18541         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18542         value
18543
18544         * enum.cs (error31): Helper to report error #31.
18545
18546         * cs-parser.jay (enum_declaration): Store location of each member too.
18547
18548         * enum.cs (member_to_location): New hashtable. 
18549
18550         (AddEnumMember): Update location hashtable.
18551
18552         (Emit): Use the location of each member while reporting errors.
18553
18554 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18555
18556         * cs-parser.jay: A for_initializer if is a
18557         local_variable_declaration really ammount to have an implicit
18558         block with the variable declaration and no initializer for for.
18559
18560         * statement.cs (For.Emit): Cope with null initializers.
18561
18562         This fixes the infinite loop on for initializers.
18563
18564 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18565
18566         * enum.cs: More cleanup.
18567
18568         * ecore.cs: Remove dead code.
18569
18570         * class.cs (Property.Emit): More simplification.
18571         (Event.Emit): ditto.
18572
18573         Reworked to have less levels of indentation.
18574
18575 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18576
18577         * class.cs (Property): Emit attributes.
18578
18579         (Field): Ditto.
18580
18581         (Event): Ditto.
18582
18583         (Indexer): Ditto.
18584
18585         (Operator): Ditto.
18586
18587         * enum.cs (Emit): Ditto.
18588
18589         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18590         Enums too.
18591
18592         * class.cs (Field, Event, etc.): Move attribute generation into the
18593         Emit method everywhere.
18594
18595         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18596         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18597         as we had no way of defining nested enums !
18598
18599         * rootcontext.cs : Adjust code accordingly.
18600
18601         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18602
18603 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18604
18605         * expression.cs (EvalConstantExpression): Move into ecore.cs
18606
18607         * enum.cs (Enum): Rename some members and make them public and readonly
18608         according to our convention.
18609
18610         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18611         nothing else.
18612
18613         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18614
18615         (Enum::Emit): Write a simple version for now which doesn't try to compute
18616         expressions. I shall modify this to be more robust in just a while.
18617
18618         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18619
18620         (TypeContainer::CloseType): Create the Enum types too.
18621
18622         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18623
18624         * expression.cs (EvalConstantExpression): Get rid of completely.
18625
18626         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18627         user-defined values and other cases.
18628
18629         (IsValidEnumLiteral): Helper function.
18630
18631         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18632         out there in the case we had a literal FieldExpr.
18633
18634         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18635
18636         (Literalize): Revamp a bit to take two arguments.
18637
18638         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18639
18640 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18641
18642         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18643
18644         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18645
18646         (Resolve): Use the above to ensure we have proper initializers.
18647
18648 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18649
18650         * expression.cs (Expression::EvalConstantExpression): New method to 
18651         evaluate constant expressions.
18652
18653         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18654
18655 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18656
18657         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18658         in an array.
18659
18660         (Binary.ResolveOperator): Handle operator != (object a, object b)
18661         and operator == (object a, object b);
18662
18663         (Binary.DoNumericPromotions): Indicate whether the numeric
18664         promotion was possible.
18665
18666         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18667         Implement.  
18668
18669         Made the ArrayAccess implement interface IAssignMethod instead of
18670         IStackStore as the order in which arguments are passed reflects
18671         this.
18672
18673         * assign.cs: Instead of using expr.ExprClass to select the way of
18674         assinging, probe for the IStackStore/IAssignMethod interfaces.
18675
18676         * typemanager.cs: Load InitializeArray definition.
18677
18678         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18679         static data that can be used to initialize arrays. 
18680
18681 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18682
18683         * expression.cs: Handle operator== and operator!= for booleans.
18684
18685         (Conditioal.Reduce): Implement reducer for the ?: operator.
18686
18687         (Conditional.Resolve): Implement dead code elimination.
18688
18689         (Binary.Resolve): Catch string literals and return a new
18690         concatenated string.
18691
18692         (Unary.Reduce): Implement reduction of unary expressions.
18693
18694         * ecore.cs: Split out the expression core handling here.
18695
18696         (Expression.Reduce): New method used to perform constant folding
18697         and CSE.  This is needed to support constant-expressions. 
18698
18699         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18700         targets, and optimize for !x.
18701
18702 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18703
18704         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18705         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18706         set custom atttributes.
18707
18708         * literal.cs (Literal::GetValue): New abstract method to return the actual
18709         value of the literal, cast as an object.
18710
18711         (*Literal): Implement GetValue method.
18712
18713         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18714         expressions to the arraylist but objects of type Argument.
18715
18716         * class.cs (TypeContainer::Emit): Emit our attributes too.
18717
18718         (Method::Emit, Constructor::Emit): Ditto.
18719
18720         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18721         to be ignoring earlier.
18722
18723 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18724
18725         * attribute.cs (AttributeSection::Define): Implement to do the business
18726         of constructing a CustomAttributeBuilder.
18727
18728         (Attribute): New trivial class. Increases readability of code.  
18729
18730         * cs-parser.jay : Update accordingly.
18731
18732         (positional_argument_list, named_argument_list, named_argument): New rules
18733
18734         (attribute_arguments): Use the above so that we are more correct.
18735
18736 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18737
18738         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18739         to perform all checks for a method with a params parameter.
18740
18741         (Invocation::OverloadResolve): Update to use the above method and therefore
18742         cope correctly with params method invocations.
18743
18744         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18745         params too.
18746
18747         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18748         constructors in our parent too because we can't afford to miss out on 
18749         protected ones ;-)
18750
18751         * attribute.cs (AttributeSection): New name for the class Attribute
18752
18753         Other trivial changes to improve readability.
18754
18755         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18756         use the new class names.
18757
18758 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18759
18760         * class.cs (Method::Define): Complete definition for params types too
18761
18762         (Indexer::Define): Ditto.
18763
18764         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18765         Cope everywhere with a request for info about the array parameter.
18766
18767 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18768
18769         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18770
18771         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18772         local_variable_type to extract the string corresponding to the type.
18773
18774         (local_variable_type): Fixup the action to use the new helper method.
18775
18776         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18777         go.
18778
18779         * expression.cs : Clean out code which uses the above.
18780
18781 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18782
18783         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18784         and bale out if necessary by returning a false.
18785
18786         (RegisterProperty): Ditto.
18787
18788         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18789         and print out appropriate error messages.
18790
18791         * interface.cs (everywhere): Ditto.
18792
18793         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18794         location to constructor.
18795
18796         * class.cs (Property, Event, Indexer): Update accordingly.
18797
18798         * ../errors/cs111.cs : Added.
18799
18800         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18801         of a method, as laid down by the spec.
18802
18803         (Invocation::OverloadResolve): Use the above method.
18804
18805 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18806
18807         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18808         now take a TypeContainer and a Parameters object.
18809
18810         (ParameterData): Modify return type of ParameterModifier method to be 
18811         Parameter.Modifier and not a string.
18812
18813         (ReflectionParameters, InternalParameters): Update accordingly.
18814
18815         * expression.cs (Argument::GetParameterModifier): Same here.
18816
18817         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18818         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18819         symbol in it at all so maybe this is only for now.
18820
18821 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18822
18823         * support.cs (InternalParameters): Constructor now takes an extra argument 
18824         which is the actual Parameters class.
18825
18826         (ParameterDesc): Update to provide info on ref/out modifiers.
18827
18828         * class.cs (everywhere): Update call to InternalParameters to pass in
18829         the second argument too.
18830
18831         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18832         to return the modifier info [ref/out etc]
18833
18834         (InternalParameters, ReflectionParameters): Implement the above.
18835
18836         * expression.cs (Argument::ParameterModifier): Similar function to return
18837         info about the argument's modifiers.
18838
18839         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18840         too.
18841
18842         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18843         a new SetFormalParameters object which we pass to InternalParameters.
18844
18845 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18846
18847         * expression.cs (NewArray): Merge into the ArrayCreation class.
18848
18849 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18850
18851         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18852         NewUserdefinedArray into one as there wasn't much of a use in having
18853         two separate ones.
18854
18855         * expression.cs (Argument): Change field's name to ArgType from Type.
18856
18857         (Type): New readonly property which returns the proper type, taking into 
18858         account ref/out modifiers.
18859
18860         (everywhere): Adjust code accordingly for the above.
18861
18862         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18863         whether we are emitting for a ref or out parameter.
18864
18865         * expression.cs (Argument::Emit): Use the above field to set the state.
18866
18867         (LocalVariableReference::Emit): Update to honour the flag and emit the
18868         right stuff.
18869
18870         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18871
18872         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18873
18874         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18875
18876         (ReflectionParameters, InternalParameters): Implement the above method.
18877
18878         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18879         reporting errors.
18880
18881         (Invocation::FullMethodDesc): Ditto. 
18882
18883 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18884
18885         * cs-parser.jay: Add extra production for the second form of array
18886         creation. 
18887
18888         * expression.cs (ArrayCreation): Update to reflect the above
18889         change. 
18890
18891         * Small changes to prepare for Array initialization.
18892
18893 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18894
18895         * typemanager.cs (ImplementsInterface): interface might be null;
18896         Deal with this problem;
18897
18898         Also, we do store negative hits on the cache (null values), so use
18899         this instead of calling t.GetInterfaces on the type everytime.
18900
18901 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18902
18903         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18904
18905         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18906         split functionality out into different classes.
18907
18908         (New::FormArrayType): Move into NewBuiltinArray.
18909
18910         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18911         quite useless.
18912
18913         (NewBuiltinArray): New class to handle creation of built-in arrays.
18914
18915         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18916         account creation of one-dimensional arrays.
18917
18918         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18919
18920         (NewUserdefinedArray::DoResolve): Implement.
18921
18922         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18923
18924         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18925         we maintain inside the TypeManager. This is necessary to perform lookups on the
18926         module builder.
18927
18928         (LookupType): Update to perform GetType on the module builders too.     
18929
18930         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18931
18932         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18933
18934 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18935
18936         * expression.cs (New::DoResolve): Implement guts of array creation.
18937
18938         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18939
18940 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18941
18942         * expression.cs: Fix bug I introduced lsat night that broke
18943         Delegates. 
18944
18945         (Expression.Resolve): Report a 246 error (can not resolve name)
18946         if we find a SimpleName in the stream.
18947
18948         (Expression.ResolveLValue): Ditto.
18949
18950         (Expression.ResolveWithSimpleName): This function is a variant of
18951         ResolveName, this one allows SimpleNames to be returned without a
18952         warning.  The only consumer of SimpleNames is MemberAccess
18953
18954 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18955
18956         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18957         might arrive here.  I have my doubts that this is correct.
18958
18959         * statement.cs (Lock): Implement lock statement.
18960
18961         * cs-parser.jay: Small fixes to support `lock' and `using'
18962
18963         * cs-tokenizer.cs: Remove extra space
18964
18965         * driver.cs: New flag --checked, allows to turn on integer math
18966         checking. 
18967
18968         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18969         Threading.Monitor.Exit 
18970
18971 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18972
18973         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18974         Expression Class to be IndexerAccess.
18975
18976         Notice that Indexer::DoResolve sets the eclass to Value.
18977
18978 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18979
18980         * class.cs (TypeContainer::Emit): Emit code for indexers.
18981
18982         * assign.cs (IAssignMethod): New interface implemented by Indexers
18983         and Properties for handling assignment.
18984
18985         (Assign::Emit): Simplify and reuse code. 
18986
18987         * expression.cs (IndexerAccess, PropertyExpr): Implement
18988         IAssignMethod, clean up old code. 
18989
18990 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18991
18992         * typemanager.cs (ImplementsInterface): New method to determine if a type
18993         implements a given interface. Provides a nice cache too.
18994
18995         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18996         method.
18997
18998         (ConvertReferenceExplicit): Ditto.
18999
19000         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19001         various methods, with correct names etc.
19002
19003         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19004         Operator.UnaryNegation.
19005
19006         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19007         we have a unary plus or minus operator.
19008
19009         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19010         UnaryMinus.
19011
19012         * everywhere : update accordingly.
19013
19014         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19015         respectively.
19016
19017         * class.cs (Method::Define): For the case where we are implementing a method
19018         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19019         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19020
19021 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19022
19023         * interface.cs (FindMembers): Implement to work around S.R.E
19024         lameness.
19025
19026         * typemanager.cs (IsInterfaceType): Implement.
19027
19028         (FindMembers): Update to handle interface types too.
19029
19030         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19031         use IsAssignableFrom as that is not correct - it doesn't work.
19032
19033         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19034         and accordingly override EmitStatement.
19035
19036         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19037         using the correct logic :-)
19038
19039 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19040
19041         * ../errors/cs-11.cs : Add to demonstrate error -11 
19042
19043 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19044
19045         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19046         then pass this as a hint to ResolveLValue.
19047
19048         * expression.cs (FieldExpr): Add Location information
19049
19050         (FieldExpr::LValueResolve): Report assignment to readonly
19051         variable. 
19052
19053         (Expression::ExprClassFromMemberInfo): Pass location information.
19054
19055         (Expression::ResolveLValue): Add new method that resolves an
19056         LValue. 
19057
19058         (Expression::DoResolveLValue): Default invocation calls
19059         DoResolve. 
19060
19061         (Indexers): New class used to keep track of indexers in a given
19062         Type. 
19063
19064         (IStackStore): Renamed from LValue, as it did not really describe
19065         what this did.  Also ResolveLValue is gone from this interface and
19066         now is part of Expression.
19067
19068         (ElementAccess): Depending on the element access type
19069
19070         * typemanager.cs: Add `indexer_name_type' as a Core type
19071         (System.Runtime.CompilerServices.IndexerNameAttribute)
19072
19073         * statement.cs (Goto): Take a location.
19074
19075 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19076
19077         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19078         if two delegates are compatible.
19079
19080         (NewDelegate::DoResolve): Update to take care of the case when
19081         we instantiate a delegate from another delegate.
19082
19083         * typemanager.cs (FindMembers): Don't even try to look up members
19084         of Delegate types for now.
19085
19086 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19087
19088         * delegate.cs (NewDelegate): New class to take care of delegate
19089         instantiation.
19090
19091         * expression.cs (New): Split the delegate related code out into 
19092         the NewDelegate class.
19093
19094         * delegate.cs (DelegateInvocation): New class to handle delegate 
19095         invocation.
19096
19097         * expression.cs (Invocation): Split out delegate related code into
19098         the DelegateInvocation class.
19099
19100 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19101
19102         * expression.cs (New::DoResolve): Implement delegate creation fully
19103         and according to the spec.
19104
19105         (New::DoEmit): Update to handle delegates differently.
19106
19107         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19108         because of which we were printing out arguments in reverse order !
19109
19110         * delegate.cs (VerifyMethod): Implement to check if the given method
19111         matches the delegate.
19112
19113         (FullDelegateDesc): Implement.
19114
19115         (VerifyApplicability): Implement.
19116
19117         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19118         delegate invocations too.
19119
19120         (Invocation::Emit): Ditto.
19121
19122         * ../errors/cs1593.cs : Added.
19123
19124         * ../errors/cs1594.cs : Added.
19125
19126         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19127
19128 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19129
19130         * typemanager.cs (intptr_type): Core type for System.IntPtr
19131
19132         (InitCoreTypes): Update for the same.
19133
19134         (iasyncresult_type, asynccallback_type): Ditto.
19135
19136         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19137         correct.
19138
19139         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19140         too.
19141
19142         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19143         the builders for the 4 members of a delegate type :-)
19144
19145         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19146         type.
19147
19148         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19149
19150         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19151
19152 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19153
19154         * statement.cs (Break::Emit): Implement.   
19155         (Continue::Emit): Implement.
19156
19157         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19158         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19159         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19160         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19161         end loop
19162
19163         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19164         properties that track the label for the current loop (begin of the
19165         loop and end of the loop).
19166
19167 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19168
19169         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19170         use of emitting anything at all.
19171
19172         * class.cs, rootcontext.cs : Get rid of calls to the same.
19173
19174         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19175
19176         (Populate): Define the constructor correctly and set the implementation
19177         attributes.
19178
19179         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19180         have been defined.
19181
19182         (AddDelegateType): Implement.
19183
19184         (IsDelegateType): Implement helper method.
19185
19186         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19187
19188         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19189         and accordingly handle it.
19190
19191         * delegate.cs (Populate): Take TypeContainer argument.
19192         Implement bits to define the Invoke method. However, I still haven't figured out
19193         how to take care of the native int bit :-(
19194
19195         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19196         Qualify the name of the delegate, not its return type !
19197
19198         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19199         conversion.
19200
19201         (StandardConversionExists): Checking for array types turns out to be recursive.
19202
19203         (ConvertReferenceExplicit): Implement array conversion.
19204
19205         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19206
19207 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19208
19209         * cs-parser.jay (delegate_declaration): Store the fully qualified
19210         name as it is a type declaration.
19211
19212         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19213         readonly.
19214
19215         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19216         as TypeContainer::DefineType.
19217
19218         (Populate): Method in which all the definition of the various methods (Invoke)
19219         etc is done.
19220
19221         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19222         see.
19223
19224         (CloseDelegate): Finally creates the delegate.
19225
19226         * class.cs (TypeContainer::DefineType): Update to define delegates.
19227         (Populate, Emit and CloseType): Do the same thing here too.
19228
19229         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19230         delegates in all these operations.
19231
19232 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19233
19234         * expression.cs: LocalTemporary: a new expression used to
19235         reference a temporary that has been created.
19236
19237         * assign.cs: Handle PropertyAccess back here, so that we can
19238         provide the proper semantic access to properties.
19239
19240         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19241         a few more explicit conversions. 
19242
19243         * modifiers.cs: `NEW' modifier maps to HideBySig.
19244
19245         * expression.cs (PropertyExpr): Make this into an
19246         ExpressionStatement, and support the EmitStatement code path. 
19247
19248         Perform get/set error checking, clean up the interface.
19249
19250         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19251         them into toplevel access objects.
19252
19253 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19254
19255         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19256         SRE.
19257
19258         * typemanager.cs: Keep track here of our PropertyBuilders again to
19259         work around lameness in SRE.
19260
19261 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19262
19263         * expression.cs (LValue::LValueResolve): New method in the
19264         interface, used to perform a second resolution pass for LValues. 
19265
19266         (This::DoResolve): Catch the use of this in static methods.
19267
19268         (This::LValueResolve): Implement.
19269
19270         (This::Store): Remove warning, assigning to `this' in structures
19271         is 
19272
19273         (Invocation::Emit): Deal with invocation of
19274         methods on value types.  We need to pass the address to structure
19275         methods rather than the object itself.  (The equivalent code to
19276         emit "this" for structures leaves the entire structure on the
19277         stack instead of a pointer to it). 
19278
19279         (ParameterReference::DoResolve): Compute the real index for the
19280         argument based on whether the method takes or not a `this' pointer
19281         (ie, the method is static).
19282
19283         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19284         value types returned from functions when we need to invoke a
19285         method on the sturcture.
19286
19287
19288 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19289
19290         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19291         defining the type in the Modulebuilder or Typebuilder. This is to take
19292         care of nested types which need to be defined on the TypeBuilder using
19293         DefineNestedMethod.
19294
19295         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19296         methods in RootContext, only ported to be part of TypeContainer.
19297
19298         (TypeContainer::GetInterfaceOrClass): Ditto.
19299
19300         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19301
19302         * interface.cs (Interface::DefineInterface): New method. Does exactly
19303         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19304         too.
19305
19306         (Interface::GetInterfaces): Move from RootContext here and port.
19307
19308         (Interface::GetInterfaceByName): Same here.
19309
19310         * rootcontext.cs (ResolveTree): Re-write.
19311
19312         (PopulateTypes): Re-write.
19313
19314         * class.cs (TypeContainer::Populate): Populate nested types too.
19315         (TypeContainer::Emit): Emit nested members too.
19316
19317         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19318         instead just use the name argument passed in as it is already fully
19319         qualified.
19320
19321         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19322         to TypeContainer mapping to see if a type is user-defined.
19323
19324         * class.cs (TypeContainer::CloseType): Implement. 
19325
19326         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19327         the default constructor.
19328
19329         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19330         twice.
19331
19332         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19333
19334         * interface.cs (CloseType): Create the type here.
19335
19336         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19337         the hierarchy.
19338
19339         Remove all the methods which are now in TypeContainer.
19340
19341 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19342
19343         * delegate.cs (Define): Re-write bits to define the delegate
19344         correctly.
19345
19346 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19347
19348         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19349
19350         * expression.cs (ImplicitReferenceConversion): handle null as well
19351         as a source to convert to any reference type.
19352
19353         * statement.cs (Return): Perform any implicit conversions to
19354         expected return type.  
19355
19356         Validate use of return statement.  
19357
19358         * codegen.cs (EmitContext): Pass the expected return type here.
19359
19360         * class.cs (Method, Constructor, Property): Pass expected return
19361         type to EmitContext.
19362
19363 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19364
19365         * expression.cs: Make DoResolve take an EmitContext instead of a
19366         TypeContainer.
19367
19368         Replaced `l' and `location' for `loc', for consistency.
19369
19370         (Error, Warning): Remove unneeded Tc argument.
19371
19372         * assign.cs, literal.cs, constant.cs: Update to new calling
19373         convention. 
19374
19375         * codegen.cs: EmitContext now contains a flag indicating whether
19376         code is being generated in a static method or not.
19377
19378         * cs-parser.jay: DecomposeQI, new function that replaces the old
19379         QualifiedIdentifier.  Now we always decompose the assembled
19380         strings from qualified_identifier productions into a group of
19381         memberaccesses.
19382
19383 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19384
19385         * rootcontext.cs: Deal with field-less struct types correctly now
19386         by passing the size option to Define Type.
19387
19388         * class.cs: Removed hack that created one static field. 
19389
19390 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19391
19392         * statement.cs: Moved most of the code generation here. 
19393
19394 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19395
19396         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19397         seem very right.
19398
19399         (ElementAccess): Remove useless bits for now - keep checks as the spec
19400         says.
19401
19402 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19403
19404         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19405         and start performing checks according to the spec.
19406
19407 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19408
19409         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19410         rank_specifiers instead.
19411
19412         (rank_specifiers): Change the order in which the rank specifiers are stored
19413
19414         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19415
19416         * expression.cs (ElementAccess): Implement the LValue interface too.
19417
19418 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19419
19420         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19421         except that user defined conversions are not included.
19422
19423         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19424         perform the conversion of the return type, if necessary.
19425
19426         (New::DoResolve): Check whether we are creating an array or an object
19427         and accordingly do the needful.
19428
19429         (New::Emit): Same here.
19430
19431         (New::DoResolve): Implement guts of array creation.
19432
19433         (New::FormLookupType): Helper function.
19434
19435 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19436
19437         * codegen.cs: Removed most of the code generation here, and move the
19438         corresponding code generation bits to the statement classes. 
19439
19440         Added support for try/catch/finalize and throw.
19441
19442         * cs-parser.jay: Added support for try/catch/finalize.
19443
19444         * class.cs: Catch static methods having the flags override,
19445         virtual or abstract.
19446
19447         * expression.cs (UserCast): This user cast was not really doing
19448         what it was supposed to do.  Which is to be born in fully resolved
19449         state.  Parts of the resolution were being performed at Emit time! 
19450
19451         Fixed this code.
19452
19453 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19454
19455         * expression.cs: Implicity convert the result from UserCast.
19456
19457 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19458
19459         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19460         prevented it from working correctly. 
19461
19462         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19463         merely ConvertImplicit.
19464
19465 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19466
19467         * typemanager.cs: Make the LookupTypeContainer function static,
19468         and not per-instance.  
19469
19470         * class.cs: Make static FindMembers (the one that takes a Type
19471         argument). 
19472
19473         * codegen.cs: Add EmitForeach here.
19474
19475         * cs-parser.jay: Make foreach a toplevel object instead of the
19476         inline expansion, as we need to perform semantic analysis on it. 
19477
19478 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19479
19480         * expression.cs (Expression::ImplicitUserConversion): Rename to
19481         UserDefinedConversion.
19482
19483         (Expression::UserDefinedConversion): Take an extra argument specifying 
19484         whether we look for explicit user conversions too.
19485
19486         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19487
19488         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19489
19490         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19491         with the appropriate arguments.
19492
19493         * cs-parser.jay (cast_expression): Record location too.
19494
19495         * expression.cs (Cast): Record location info.
19496
19497         (Expression::ConvertExplicit): Take location argument.
19498
19499         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19500         to determine if we are doing explicit conversions.
19501
19502         (UserCast::Emit): Update accordingly.
19503
19504         (Expression::ConvertExplicit): Report an error if everything fails.
19505
19506         * ../errors/cs0030.cs : Add.
19507
19508 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19509
19510         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19511         virtual and newslot bits. 
19512
19513         * class.cs (TypeContainer::RegisterRequiredImplementations):
19514         Record methods we need.
19515
19516         (TypeContainer::MakeKey): Helper function to make keys for
19517         MethodBases, since the Methodbase key is useless.
19518
19519         (TypeContainer::Populate): Call RegisterRequiredImplementations
19520         before defining the methods.   
19521
19522         Create a mapping for method_builders_to_methods ahead of time
19523         instead of inside a tight loop.
19524
19525         (::RequireMethods):  Accept an object as the data to set into the
19526         hashtable so we can report interface vs abstract method mismatch.
19527
19528 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19529
19530         * report.cs: Make all of it static.
19531
19532         * rootcontext.cs: Drop object_type and value_type computations, as
19533         we have those in the TypeManager anyways.
19534
19535         Drop report instance variable too, now it is a global.
19536
19537         * driver.cs: Use try/catch on command line handling.
19538
19539         Add --probe option to debug the error reporting system with a test
19540         suite. 
19541
19542         * report.cs: Add support for exiting program when a probe
19543         condition is reached.
19544
19545 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19546
19547         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19548         we do a forcible conversion regardless of type, to check if 
19549         ForceConversion returns a null.
19550
19551         (Binary::error19): Use location to report error.
19552
19553         (Unary::error23): Use location here too.
19554
19555         * ../errors/cs0019.cs : Check in.
19556
19557         * ../errors/cs0023.cs : Check in.
19558
19559         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19560         case of a non-null MethodInfo object with a length of 0 !
19561
19562         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19563         an applicable member - according to the spec :-)
19564         Also fix logic to find members in base types.
19565
19566         (Unary::ResolveOperator): Same here.
19567
19568         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19569         as I was getting thoroughly confused between this and error19 :-)
19570
19571         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19572         (::FindMostEncompassedType): Implement.
19573         (::FindMostEncompassingType): Implement.
19574         (::StandardConversionExists): Implement.
19575
19576         (UserImplicitCast): Re-vamp. We now need info about most specific
19577         source and target types so that we can do the necessary conversions.
19578
19579         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19580         mathematical union with no duplicates.
19581
19582 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19583
19584         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19585         in order from base classes to child classes, so that we can in
19586         child classes look up in our parent for method names and
19587         attributes (required for handling abstract, virtual, new, override
19588         constructs: we need to instrospect our base class, and if we dont
19589         populate the classes in order, the introspection might be
19590         incorrect.  For example, a method could query its parent before
19591         the parent has any methods and would determine that the parent has
19592         no abstract methods (while it could have had them)).
19593
19594         (RootContext::CreateType): Record the order in which we define the
19595         classes.
19596
19597 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19598
19599         * class.cs (TypeContainer::Populate): Also method definitions can
19600         fail now, keep track of this.
19601
19602         (TypeContainer::FindMembers): Implement support for
19603         DeclaredOnly/noDeclaredOnly flag.
19604
19605         (Constructor::Emit) Return the ConstructorBuilder.
19606
19607         (Method::Emit) Return the MethodBuilder. 
19608         Check for abstract or virtual methods to be public.
19609
19610         * rootcontext.cs (RootContext::CreateType): Register all the
19611         abstract methods required for the class to be complete and the
19612         interface methods that must be implemented. 
19613
19614         * cs-parser.jay: Report error 501 (method requires body if it is
19615         not marked abstract or extern).
19616
19617         * expression.cs (TypeOf::Emit): Implement.
19618
19619         * typemanager.cs: runtime_handle_type, new global type.
19620
19621         * class.cs (Property::Emit): Generate code for properties.
19622
19623 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19624
19625         * expression.cs (Unary::ResolveOperator): Find operators on base type
19626         too - we now conform exactly to the spec.
19627
19628         (Binary::ResolveOperator): Same here.
19629
19630         * class.cs (Operator::Define): Fix minor quirk in the tests.
19631
19632         * ../errors/cs0215.cs : Added.
19633
19634         * ../errors/cs0556.cs : Added.
19635
19636         * ../errors/cs0555.cs : Added.
19637
19638 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19639
19640         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19641         single integer which is really efficient
19642
19643 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19644
19645         *  expression.cs (Expression::ImplicitUserConversion): Use location
19646         even in the case when we are examining True operators.
19647  
19648         * class.cs (Operator::Define): Perform extensive checks to conform
19649         with the rules for operator overloading in the spec.
19650
19651         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19652         some of the other conversions mentioned in the spec.
19653
19654         * typemanager.cs (array_type): New static member for the System.Array built-in
19655         type.
19656
19657         (cloneable_interface): For System.ICloneable interface.
19658
19659         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19660         we start resolving the tree and populating types.
19661
19662         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19663  
19664 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19665
19666         * expression.cs (Expression::ExprClassFromMemberInfo,
19667         Expression::Literalize): Create literal expressions from
19668         FieldInfos which are literals.
19669
19670         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19671         type casts, because they were wrong.  The test suite in tests
19672         caught these ones.
19673
19674         (ImplicitNumericConversion): ushort to ulong requires a widening
19675         cast. 
19676
19677         Int32 constant to long requires widening cast as well.
19678
19679         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19680         for integers because the type on the stack is not i4.
19681
19682 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19683
19684         * expression.cs (report118): require location argument. 
19685
19686         * parameter.cs: Do not dereference potential null value.
19687
19688         * class.cs: Catch methods that lack the `new' keyword when
19689         overriding a name.  Report warnings when `new' is used without
19690         anything being there to override.
19691
19692         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19693
19694         * class.cs: Only add constructor to hashtable if it is non-null
19695         (as now constructors can fail on define).
19696
19697         (TypeManager, Class, Struct): Take location arguments.
19698
19699         Catch field instance initialization in structs as errors.
19700
19701         accepting_filter: a new filter for FindMembers that is static so
19702         that we dont create an instance per invocation.
19703
19704         (Constructor::Define): Catch errors where a struct constructor is
19705         parameterless 
19706
19707         * cs-parser.jay: Pass location information for various new
19708         constructs. 
19709
19710         * delegate.cs (Delegate): take a location argument.
19711
19712         * driver.cs: Do not call EmitCode if there were problesm in the
19713         Definition of the types, as many Builders wont be there. 
19714
19715         * decl.cs (Decl::Decl): Require a location argument.
19716
19717         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19718         into integers, and find the most appropiate integer for it.
19719
19720         * literal.cs: Implement ULongLiteral.
19721
19722         * rootcontext.cs: Provide better information about the location of
19723         failure when CreateType fails.
19724
19725 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19726
19727         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19728         as well.
19729
19730         * expression.cs (Binary::CheckShiftArguments): Add missing type
19731         computation.
19732         (Binary::ResolveOperator): Add type to the logical and and logical
19733         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19734         before.
19735
19736         (Binary::DoNumericPromotions): In the case where either argument
19737         is ulong (and most signed types combined with ulong cause an
19738         error) perform implicit integer constant conversions as well.
19739
19740 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19741
19742         * expression.cs (UserImplicitCast): Method should always be
19743         non-null. 
19744         (Invocation::BetterConversion): Simplified test for IntLiteral.
19745
19746         (Expression::ImplicitNumericConversion): Split this routine out.
19747         Put the code that performs implicit constant integer conversions
19748         here. 
19749
19750         (Expression::Resolve): Become a wrapper around DoResolve so we can
19751         check eclass and type being set after resolve.
19752
19753         (Invocation::Badness): Remove this dead function
19754
19755         (Binary::ResolveOperator): Do not compute the expensive argumnets
19756         unless we have a union for it.
19757
19758         (Probe::Emit): Is needs to do an isinst and then
19759         compare against null.
19760
19761         (::CanConvert): Added Location argument.  If the Location argument
19762         is null (Location.Null), then we do not report errors.  This is
19763         used by the `probe' mechanism of the Explicit conversion.  We do
19764         not want to generate an error for something that the user
19765         explicitly requested to be casted.  But the pipeline for an
19766         explicit cast first tests for potential implicit casts.
19767
19768         So for now, if the Location is null, it means `Probe only' to
19769         avoid adding another argument.   Might have to revise this
19770         strategy later.
19771
19772         (ClassCast): New class used to type cast objects into arbitrary
19773         classes (used in Explicit Reference Conversions).
19774
19775         Implement `as' as well.
19776
19777         Reverted all the patches from Ravi below: they were broken:
19778
19779                 * The use of `level' as a mechanism to stop recursive
19780                   invocations is wrong.  That was there just to catch the
19781                   bug with a strack trace but not as a way of addressing
19782                   the problem.
19783
19784                   To fix the problem we have to *understand* what is going
19785                   on and the interactions and come up with a plan, not
19786                   just get things going.
19787
19788                 * The use of the type conversion cache that I proposed
19789                   last night had an open topic: How does this work across
19790                   protection domains.  A user defined conversion might not
19791                   be public in the location where we are applying the
19792                   conversion, a different conversion might be selected
19793                   (ie, private A->B (better) but public B->A (worse),
19794                   inside A, A->B applies, but outside it, B->A will
19795                   apply).
19796
19797                 * On top of that (ie, even if the above is solved),
19798                   conversions in a cache need to be abstract.  Ie, `To
19799                   convert from an Int to a Short use an OpcodeCast', not
19800                   `To convert from an Int to a Short use the OpcodeCast on
19801                   the variable 5' (which is what this patch was doing).
19802
19803 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19804
19805         * expression.cs (Invocation::ConversionExists): Re-write to use
19806         the conversion cache
19807
19808         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19809         cache all conversions done, not just user-defined ones.
19810
19811         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19812         to determine if a conversion exists instead of acutually trying to 
19813         perform the conversion. It's faster too.
19814
19815         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19816         and only then attempt the implicit conversion.
19817
19818 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19819
19820         * expression.cs (ConvertImplicit): Use a cache for conversions
19821         already found. Check level of recursion and bail out if necessary.
19822
19823 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19824
19825         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19826         Export standard methods that we expect for string operations.
19827
19828         * statement.cs (Block::UsageWarning): Track usage of variables and
19829         report the errors for not used variables.
19830
19831         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19832         operator. 
19833
19834 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19835
19836         * codegen.cs: remove unnneded code 
19837
19838         * expression.cs: Removed BuiltinTypeAccess class
19839
19840         Fix the order in which implicit conversions are
19841         done.  
19842
19843         The previous fixed dropped support for boxed conversions (adding a
19844         test to the test suite now)
19845
19846         (UserImplicitCast::CanConvert): Remove test for source being null,
19847         that code is broken.  We should not feed a null to begin with, if
19848         we do, then we should track the bug where the problem originates
19849         and not try to cover it up here.
19850
19851         Return a resolved expression of type UserImplicitCast on success
19852         rather than true/false.  Ravi: this is what I was talking about,
19853         the pattern is to use a static method as a "constructor" for
19854         objects. 
19855
19856         Also, do not create arguments until the very last minute,
19857         otherwise we always create the arguments even for lookups that
19858         will never be performed. 
19859
19860         (UserImplicitCast::Resolve): Eliminate, objects of type
19861         UserImplicitCast are born in a fully resolved state. 
19862
19863         * typemanager.cs (InitCoreTypes): Init also value_type
19864         (System.ValueType). 
19865
19866         * expression.cs (Cast::Resolve): First resolve the child expression.
19867
19868         (LValue): Add new method AddressOf to be used by
19869         the `&' operator.  
19870
19871         Change the argument of Store to take an EmitContext instead of an
19872         ILGenerator, because things like FieldExpr need to be able to call
19873         their children expression to generate the instance code. 
19874
19875         (Expression::Error, Expression::Warning): Sugar functions for
19876         reporting errors.
19877
19878         (Expression::MemberLookup): Accept a TypeContainer instead of a
19879         Report as the first argument.
19880
19881         (Expression::ResolvePrimary): Killed.  I still want to improve
19882         this as currently the code is just not right.
19883
19884         (Expression::ResolveMemberAccess): Simplify, but it is still
19885         wrong. 
19886
19887         (Unary::Resolve): Catch errors in AddressOf operators.
19888
19889         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19890         index to a byte for the short-version, or the compiler will choose
19891         the wrong Emit call, which generates the wrong data.
19892
19893         (ParameterReference::Emit, ::Store): same.
19894
19895         (FieldExpr::AddressOf): Implement.
19896
19897         * typemanager.cs: TypeManager: made public variable instead of
19898         property.
19899
19900         * driver.cs: document --fatal.
19901
19902         * report.cs (ErrorMessage, WarningMessage): new names for the old
19903         Error and Warning classes.
19904
19905         * cs-parser.jay (member_access): Turn built-in access to types
19906         into a normal simplename
19907
19908 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19909
19910         * expression.cs (Invocation::BetterConversion): Fix to cope
19911         with q being null, since this was introducing a bug.
19912
19913         * expression.cs (ConvertImplicit): Do built-in conversions first.
19914
19915 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19916
19917         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19918
19919 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19920
19921         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19922         I had introduced long ago (what's new ?).
19923
19924         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19925         the work of all the checking. 
19926         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19927         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19928
19929         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19930         that is the right way. 
19931
19932         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19933         overloading resolution. Use everywhere instead of cutting and pasting code.
19934
19935         (Binary::ResolveOperator): Use MakeUnionSet.
19936
19937         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19938         we have to convert to bool types. Not complete yet.
19939
19940 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19941
19942         * typemanager.cs (TypeManager::CSharpName): support ushort.
19943
19944         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19945         to provide an expression that performsn an implicit constant int
19946         conversion (section 6.1.6).
19947         (Expression::ConvertImplicitRequired): Reworked to include
19948         implicit constant expression conversions.
19949
19950         (Expression::ConvertNumericExplicit): Finished.
19951
19952         (Invocation::Emit): If InstanceExpression is null, then it means
19953         that we perform a call on this.
19954
19955 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19956
19957         * expression.cs (Unary::Emit): Remove some dead code.
19958         (Probe): Implement Resolve and Emit for `is'.
19959         (Expression::ConvertImplicitRequired): Attempt to do constant
19960         expression conversions here.  Maybe should be moved to
19961         ConvertImplicit, but I am not sure.
19962         (Expression::ImplicitLongConstantConversionPossible,
19963         Expression::ImplicitIntConstantConversionPossible): New functions
19964         that tell whether is it possible to apply an implicit constant
19965         expression conversion.
19966
19967         (ConvertNumericExplicit): Started work on explicit numeric
19968         conversions.
19969
19970         * cs-parser.jay: Update operator constants.
19971
19972         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19973         (Parameters::GetSignature): Hook up VerifyArgs here.
19974         (Parameters::VerifyArgs): Verifies that no two arguments have the
19975         same name. 
19976
19977         * class.cs (Operator): Update the operator names to reflect the
19978         ones that the spec expects (as we are just stringizing the
19979         operator names).
19980
19981         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19982         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19983         previous usage did only work for our methods.
19984         (Expression::ConvertImplicit): Handle decimal implicit numeric
19985         conversions as well.
19986         (Expression::InternalTypeConstructor): Used to invoke constructors
19987         on internal types for default promotions.
19988
19989         (Unary::Emit): Implement special handling for the pre/post
19990         increment/decrement for overloaded operators, as they need to have
19991         the same semantics as the other operators.
19992
19993         (Binary::ResolveOperator): ditto.
19994         (Invocation::ConversionExists): ditto.
19995         (UserImplicitCast::Resolve): ditto.
19996
19997 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19998
19999         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20000         operator, return after emitting body. Regression tests pass again !
20001
20002         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20003         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20004         (Invocation::OverloadResolve): Ditto.
20005         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20006
20007         * everywhere : update calls to the above methods accordingly.
20008
20009 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20010
20011         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20012
20013         * expression.cs (ExpressionStatement): New base class used for
20014         expressions that can appear in statements, so that we can provide
20015         an alternate path to generate expression that do not leave a value
20016         on the stack.
20017
20018         (Expression::Emit, and all the derivatives): We no longer return
20019         whether a value is left on the stack or not.  Every expression
20020         after being emitted leaves a single value on the stack.
20021
20022         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20023         facilties of ExpressionStatement if possible.
20024
20025         * cs-parser.jay: Update statement_expression.
20026
20027 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20028
20029         * driver.cs: Change the wording of message
20030
20031 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20032
20033         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20034         the type of the expression to the return type of the method if
20035         we have an overloaded operator match ! The regression tests pass again !
20036         (Unary::ResolveOperator): Ditto.
20037
20038         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20039         to find "op_Implicit", not "implicit" ;-)
20040         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20041         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20042
20043         * everywhere : Correct calls to the above accordingly.
20044
20045         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20046         (ConvertImplicit): Do user-defined conversion if it exists.
20047
20048 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20049
20050         * assign.cs: track location.
20051         (Resolve): Use implicit conversions on assignment.
20052
20053         * literal.cs: Oops.  Not good, Emit of short access values should
20054         pass (Bytes) or the wrong argument will be selected.
20055
20056         * expression.cs (Unary::Emit): Emit code for -expr.
20057
20058         (Unary::ResolveOperator): Handle `Substract' for non-constants
20059         (substract from zero from the non-constants).
20060         Deal with Doubles as well. 
20061
20062         (Expression::ConvertImplicitRequired): New routine that reports an
20063         error if no implicit conversion exists. 
20064
20065         (Invocation::OverloadResolve): Store the converted implicit
20066         expressions if we make them
20067
20068 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20069
20070         * class.cs (ConstructorInitializer): Take a Location argument.
20071         (ConstructorBaseInitializer): Same here.
20072         (ConstructorThisInitializer): Same here.
20073
20074         * cs-parser.jay : Update all calls accordingly.
20075
20076         * expression.cs (Unary, Binary, New): Take location argument.
20077         Update accordingly everywhere.
20078
20079         * cs-parser.jay : Update all calls to the above to take a location
20080         argument.
20081
20082         * class.cs : Ditto.
20083
20084 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20085
20086         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20087         (Invocation::BetterConversion): Same here
20088         (Invocation::ConversionExists): Ditto.
20089
20090         (Invocation::ConversionExists): Implement.
20091
20092 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20093
20094         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20095         Also take an additional TypeContainer argument.
20096
20097         * All over : Pass in TypeContainer as argument to OverloadResolve.
20098
20099         * typemanager.cs (CSharpName): Update to check for the string type and return
20100         that too.
20101
20102         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20103         a given method.
20104
20105 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20106
20107         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20108         (Invocation::BetterFunction): Implement.
20109         (Invocation::BetterConversion): Implement.
20110         (Invocation::ConversionExists): Skeleton, no implementation yet.
20111
20112         Okay, things work fine !
20113
20114 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20115
20116         * typemanager.cs: declare and load enum_type, delegate_type and
20117         void_type. 
20118
20119         * expression.cs (Expression::Emit): Now emit returns a value that
20120         tells whether a value is left on the stack or not.  This strategy
20121         might be reveted tomorrow with a mechanism that would address
20122         multiple assignments.
20123         (Expression::report118): Utility routine to report mismatches on
20124         the ExprClass.
20125
20126         (Unary::Report23): Report impossible type/operator combination
20127         utility function.
20128
20129         (Unary::IsIncrementableNumber): Whether the type can be
20130         incremented or decremented with add.
20131         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20132         complemented. 
20133         (Unary::ResolveOperator): Implement ++, !, ~,
20134
20135         (Invocation::Emit): Deal with new Emit convetion.
20136
20137         * All Expression derivatives: Updated their Emit method to return
20138         whether they leave values on the stack or not.
20139
20140         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20141         stack for expressions that are statements. 
20142
20143 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20144
20145         * expression.cs (LValue): New interface.  Must be implemented by
20146         LValue objects.
20147         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20148         LValue interface.
20149
20150         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20151         interface for generating code, simplifies the code.
20152
20153 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20154
20155         * expression.cs (everywhere): Comment out return statements in ::Resolve
20156         methods to avoid the warnings.
20157
20158 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20159
20160         * driver.cs (parse): Report error 2001 if we can not open the
20161         source file.
20162
20163         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20164         not resolve it.
20165
20166         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20167         object. 
20168
20169         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20170         otherwise nested blocks end up with the same index.
20171
20172         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20173
20174         * expression.cs:  Instead of having FIXMEs in the Resolve
20175         functions, throw exceptions so it is obvious that we are facing a
20176         bug. 
20177
20178         * cs-parser.jay (invocation_expression): Pass Location information.
20179
20180         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20181         Use a basename for those routines because .NET does not like paths
20182         on them. 
20183
20184         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20185         already defined.
20186
20187 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20188
20189         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20190         are loading the correct data types (throws an exception if not).
20191         (TypeManager::InitCoreTypes): Use CoreLookupType
20192
20193         * expression.cs (Unary::ResolveOperator): return the child
20194         expression for expressions which are just +expr.
20195         (Unary::ResolveOperator): Return negative literals for -LITERAL
20196         expressions (otherwise they are Unary {Literal}).
20197         (Invocation::Badness): Take into account `Implicit constant
20198         expression conversions'.
20199
20200         * literal.cs (LongLiteral): Implement long literal class.
20201         (IntLiteral): export the `Value' of the intliteral. 
20202
20203 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20204
20205         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20206
20207         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20208         instead of 'Operator'
20209
20210         * expression.cs (Binary::ResolveOperator): Update accordingly.
20211         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20212         and 'Minus'
20213
20214         * cs-parser.jay (unary_expression): Update to use the new names.
20215
20216         * gen-treedump.cs (GetUnary): Same here.
20217
20218         * expression.cs (Unary::Resolve): Implement.
20219         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20220         operators are found instead of making noise ;-)
20221         (Unary::ResolveOperator): New method to do precisely the same thing which
20222         Binary::ResolveOperator does for Binary expressions.
20223         (Unary.method, .Arguments): Add.
20224         (Unary::OperName): Implement.   
20225         (Unary::ForceConversion): Copy and Paste !
20226
20227         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20228         a unary operator.
20229
20230         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20231         for the inbuilt operators. Only overloading works for now ;-)
20232
20233 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20234
20235         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20236         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20237
20238         * expression.cs (This::Emit): Implement. 
20239         (This::Resolve): Implement.
20240         (TypeOf:Resolve): Implement.
20241         (Expression::ResolveSimpleName): Add an implicit this to instance
20242         field references. 
20243         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20244         Bind instance variable to Field expressions.
20245         (FieldExpr::Instance): New field used to track the expression that
20246         represents the object instance.
20247         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20248         binding 
20249         (FieldExpr::Emit): Implement.
20250
20251         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20252         the last instruction contains a return opcode to avoid generating
20253         the last `ret' instruction (this generates correct code, and it is
20254         nice to pass the peverify output).
20255
20256         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20257         initializer for static and instance variables.
20258         (Constructor::Emit): Allow initializer to be null in the case of
20259         static constructors.  Only emit initializer for instance
20260         constructors. 
20261
20262         (TypeContainer::FindMembers): Return a null array if there are no
20263         matches.
20264
20265         Also fix the code for the MemberTypes.Method branch, as it was not
20266         scanning that for operators (or tried to access null variables before).
20267
20268         * assign.cs (Assign::Emit): Handle instance and static fields. 
20269
20270         * TODO: Updated.
20271
20272         * driver.cs: Stop compilation if there are parse errors.
20273
20274         * cs-parser.jay (constructor_declaration): Provide default base
20275         initializer for non-static constructors.
20276         (constructor_declarator): Do not provide a default base
20277         initializers if none was specified.
20278         Catch the fact that constructors should not have parameters.
20279
20280         * class.cs: Do not emit parent class initializers for static
20281         constructors, that should be flagged as an error.
20282
20283 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20284
20285         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20286         Move back code into TypeContainer::Populate.
20287
20288 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20289
20290         * class.cs (TypeContainer::AddConstructor): Fix the check to
20291         compare against Name, not Basename. 
20292         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20293
20294         * cs-parser.jay : Update accordingly.
20295
20296         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20297         for methods, don't forget to look into the operators too.
20298         (RegisterMethodBuilder): Helper method to take care of this for
20299         methods, constructors and operators.
20300         (Operator::Define): Completely revamp.
20301         (Operator.OperatorMethod, MethodName): New fields.
20302         (TypeContainer::Populate): Move the registering of builders into
20303         RegisterMethodBuilder.
20304         (Operator::Emit): Re-write.
20305
20306         * expression.cs (Binary::Emit): Comment out code path to emit method
20307         invocation stuff for the case when we have a user defined operator. I am
20308         just not able to get it right !
20309
20310 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20311
20312         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20313         argument. 
20314
20315         (Expression::MemberLookup): Provide a version that allows to
20316         specify the MemberTypes and BindingFlags. 
20317
20318         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20319         so it was not fetching variable information from outer blocks.
20320
20321         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20322         Beforefieldinit as it was buggy.
20323
20324         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20325         that Ravi put here.  
20326
20327         * class.cs (Constructor::Emit): Only emit if block is not null.
20328         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20329         deal with this by semantically definining it as if the user had
20330         done it.
20331
20332         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20333         constructors as we now "emit" them at a higher level.
20334
20335         (TypeContainer::DefineDefaultConstructor): Used to define the
20336         default constructors if none was provided.
20337
20338         (ConstructorInitializer): Add methods Resolve and Emit. 
20339
20340         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20341
20342 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20343
20344         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20345         the default constructor builder with our hashtable for methodbuilders
20346         to methodcores.
20347
20348         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20349         and argument_count is 0 in which case we have a match.
20350         (Binary::ResolveOperator): More null checking and miscellaneous coding
20351         style cleanup.
20352
20353 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20354
20355         * rootcontext.cs (IsNameSpace): Compare against null.
20356
20357         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20358
20359         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20360         and Unary::Operator.
20361
20362         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20363         accordingly.
20364
20365         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20366         we have overloaded operators.
20367         (Binary::ResolveOperator): Implement the part which does the operator overload
20368         resolution.
20369
20370         * class.cs (Operator::Emit): Implement.
20371         (TypeContainer::Emit): Emit the operators we have too.
20372
20373         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20374         the case when we have a user-defined operator.
20375
20376 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20377
20378         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20379
20380 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20381
20382         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20383         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20384         (Constructor::Emit): Implement.
20385         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20386         if we have no work to do. 
20387         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20388         Emit method.
20389
20390         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20391         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20392
20393         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20394         of parent.parent.
20395
20396 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20397
20398         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20399         in the source.
20400         (Tree::RecordNamespace): Method to do what the name says ;-)
20401         (Tree::Namespaces): Property to get at the namespaces hashtable.
20402
20403         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20404         keep track.
20405
20406         * rootcontext.cs (IsNamespace): Fixed it :-)
20407
20408 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20409
20410         * class.cs (TypeContainer::FindMembers): Add support for
20411         constructors. 
20412         (MethodCore): New class that encapsulates both the shared aspects
20413         of a Constructor and a Method.  
20414         (Method, Constructor): Factored pieces into MethodCore.
20415
20416         * driver.cs: Added --fatal which makes errors throw exceptions.
20417         Load System assembly as well as part of the standard library.
20418
20419         * report.cs: Allow throwing exceptions on errors for debugging.
20420
20421         * modifiers.cs: Do not use `parent', instead use the real type
20422         container to evaluate permission settings.
20423
20424         * class.cs: Put Ravi's patch back in.  He is right, and we will
20425         have to cope with the
20426
20427 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20428
20429         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20430         FamORAssem, not FamANDAssem.
20431
20432 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20433
20434         * driver.cs: Added --parse option that only parses its input files
20435         and terminates.
20436
20437         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20438         incorrect.  IsTopLevel is not used to tell whether an object is
20439         root_types or not (that can be achieved by testing this ==
20440         root_types).  But to see if this is a top-level *class* (not
20441         necessarly our "toplevel" container). 
20442
20443 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20444
20445         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20446         parent instead of a direct call to GetType.
20447
20448 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20449
20450         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20451         Modifiers.TypeAttr. This should just be a call to that method.
20452
20453         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20454         object so that we can determine if we are top-level or not.
20455
20456         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20457         TypeContainer too.
20458
20459         * enum.cs (Enum::Define): Ditto.
20460
20461         * modifiers.cs (FieldAttr): Re-write.
20462
20463         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20464         (TypeContainer::HaveStaticConstructor): New property to provide access
20465         to precisely that info.
20466
20467         * modifiers.cs (MethodAttr): Re-write.
20468         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20469
20470         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20471         of top-level types as claimed.
20472
20473 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20474
20475         * expression.cs (MemberLookup): Fruitless attempt to lookup
20476         constructors.  Maybe I need to emit default constructors?  That
20477         might be it (currently .NET emits this for me automatically).
20478         (Invocation::OverloadResolve): Cope with Arguments == null.
20479         (Invocation::EmitArguments): new function, shared by the new
20480         constructor and us.
20481         (Invocation::Emit): Handle static and instance methods.  Emit
20482         proper call instruction for virtual or non-virtual invocations.
20483         (New::Emit): Implement.
20484         (New::Resolve): Implement.
20485         (MemberAccess:Resolve): Implement.
20486         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20487         to track instances.
20488         (FieldExpr::Resolve): Set type.
20489
20490         * support.cs: Handle empty arguments.
20491                 
20492         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20493         SimpleLookup): Auxiliary routines to help parse a qualifier
20494         identifier.  
20495
20496         Update qualifier_identifier rule.
20497
20498         * codegen.cs: Removed debugging messages.
20499
20500         * class.cs: Make this a global thing, this acts just as a "key" to
20501         objects that we might have around.
20502
20503         (Populate): Only initialize method_builders_to_methods once.
20504
20505         * expression.cs (PropertyExpr): Initialize type from the
20506         PropertyType. 
20507
20508         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20509         Resolve pattern.  Attempt to implicitly convert value to boolean.
20510         Emit code.
20511
20512         * expression.cs: Set the type for the int32/int32 argument case.
20513         (Binary::ResolveOperator): Set the return type to boolean for
20514         comparission operators
20515
20516         * typemanager.cs: Remove debugging print code.
20517
20518         (Invocation::Resolve): resolve type.
20519
20520         * class.cs: Allocate a MemberInfo of the correct size, as the code
20521         elsewhere depends on the test to reflect the correct contents.
20522
20523         (Method::) Keep track of parameters, due to System.Reflection holes
20524
20525         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20526         mapping here.
20527
20528         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20529         of the exact size and return that.
20530
20531         (Class::LookupMethodByBuilder): New function that maps
20532         MethodBuilders to its methods.  Required to locate the information
20533         on methods because System.Reflection bit us again.
20534
20535         * support.cs: New file, contains an interface ParameterData and
20536         two implementations: ReflectionParameters and InternalParameters
20537         used to access Parameter information.  We will need to grow this
20538         as required.
20539
20540         * expression.cs (Invocation::GetParameterData): implement a cache
20541         and a wrapper around the ParameterData creation for methods. 
20542         (Invocation::OverloadResolve): Use new code.
20543
20544 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20545
20546         * class.cs (TypeContainer::EmitField): Remove and move into 
20547         (Field::Define): here and modify accordingly.
20548         (Field.FieldBuilder): New member.
20549         (TypeContainer::Populate): Update accordingly.
20550         (TypeContainer::FindMembers): Implement.
20551
20552 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20553
20554         * statement.cs: (VariableInfo::VariableType): New field to be
20555         initialized with the full type once it is resolved. 
20556
20557 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20558
20559         * parameter.cs (GetParameterInfo): Use a type cache to compute
20560         things only once, and to reuse this information
20561
20562         * expression.cs (LocalVariableReference::Emit): Implement.
20563         (OpcodeCast::Emit): fix.
20564
20565         (ParameterReference::Resolve): Implement.
20566         (ParameterReference::Emit): Implement.
20567
20568         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20569         that are expressions need to stay as Expressions.
20570
20571         * typemanager.cs (CSharpName): Returns the C# name of a type if
20572         possible. 
20573
20574         * expression.cs (Expression::ConvertImplicit): New function that
20575         implements implicit type conversions.
20576
20577         (Expression::ImplicitReferenceConversion): Implements implicit
20578         reference conversions.
20579
20580         (EmptyCast): New type for transparent casts.
20581
20582         (OpcodeCast): New type for casts of types that are performed with
20583         a sequence of bytecodes.
20584
20585         (BoxedCast): New type used for casting value types into reference
20586         types.  Emits a box opcode.
20587
20588         (Binary::DoNumericPromotions): Implements numeric promotions of
20589         and computation of the Binary::Type.
20590
20591         (Binary::EmitBranchable): Optimization.
20592
20593         (Binary::Emit): Implement code emission for expressions.
20594
20595         * typemanager.cs (TypeManager): Added two new core types: sbyte
20596         and byte.
20597
20598 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20599
20600         * class.cs (TypeContainer::FindMembers): Method which does exactly
20601         what Type.FindMembers does, only we don't have to use reflection. No
20602         implementation yet.
20603
20604         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20605         typecontainer objects as we need to get at them.
20606         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20607
20608         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20609         typecontainer object.
20610
20611         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20612         of just a Report object.
20613
20614 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20615
20616         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20617         "remove_"
20618         (TypeContainer::Populate): Now define the delegates of the type too.
20619         (TypeContainer.Delegates): Property to access the list of delegates defined
20620         in the type.
20621
20622         * delegates.cs (Delegate::Define): Implement partially.
20623
20624         * modifiers.cs (TypeAttr): Handle more flags.
20625
20626 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20627
20628         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20629         and not <=
20630         (Operator::Define): Re-write logic to get types by using the LookupType method
20631         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20632         (Indexer::Define): Ditto.
20633         (Event::Define): Ditto.
20634         (Property::Define): Ditto.
20635
20636 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20637
20638         * class.cs (TypeContainer::Populate): Now define operators too. 
20639         (TypeContainer.Operators): New property to access the list of operators
20640         in a type.
20641         (Operator.OperatorMethodBuilder): New member to hold the method builder
20642         for the operator we are defining.
20643         (Operator::Define): Implement.
20644
20645 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20646
20647         * class.cs (Event::Define): Make the prefixes of the accessor methods
20648         addOn_ and removeOn_ 
20649
20650         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20651         of the location being passed in too. Ideally, this should go later since all
20652         error reporting should be done through the Report object.
20653
20654         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20655         (Populate): Iterate thru the indexers we have and define them too.
20656         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20657         for the get and set accessors.
20658         (Indexer::Define): Implement.
20659
20660 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20661
20662         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20663         my previous implementation, did not work.
20664
20665         * typemanager.cs: Add a couple of missing types (the longs).
20666
20667         * literal.cs: Use TypeManager.bool_type instead of getting it.
20668
20669         * expression.cs (EventExpr): New kind of expressions.
20670         (Expressio::ExprClassFromMemberInfo): finish
20671
20672 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20673
20674         * assign.cs: Emit stores to static fields differently.
20675
20676 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20677
20678         * Merge in changes and adjust code to tackle conflicts. Backed out my
20679         code in Assign::Resolve ;-) 
20680
20681 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20682
20683         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20684         instead Report.Error and also pass in the location.
20685         (CSharpParser::Lexer): New readonly property to return the reference
20686         to the Tokenizer object.
20687         (declare_local_variables): Use Report.Error with location instead of plain 
20688         old error.
20689         (CheckDef): Ditto.
20690
20691         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20692         (Operator.CheckBinaryOperator): Ditto.
20693
20694         * cs-parser.jay (operator_declarator): Update accordingly.
20695
20696         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20697         (CheckBinaryOperator): Same here.
20698
20699         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20700         on the name without any prefixes of namespace names etc. This is because we
20701         already might have something already fully qualified like 
20702         'System.Console.WriteLine'
20703
20704         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20705
20706 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20707
20708         * cs-tokenizer.cs (location): Return a string which also contains
20709         the file name.
20710
20711         * expression.cs (ElementAccess): New class for expressions of the
20712         type 'element access.'
20713         (BaseAccess): New class for expressions of the type 'base access.'
20714         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20715         respectively.
20716
20717         * cs-parser.jay (element_access): Implement action.
20718         (base_access): Implement actions.
20719         (checked_expression, unchecked_expression): Implement.
20720
20721         * cs-parser.jay (local_variable_type): Correct and implement.
20722         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20723
20724         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20725
20726         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20727         name and the specifiers.
20728
20729         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20730
20731         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20732         making them all public ;-)
20733
20734         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20735         class anyways.
20736
20737 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20738
20739         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20740         PropertyExprs.
20741         (FieldExpr, PropertyExprs): New resolved expressions.
20742         (SimpleName::MemberStaticCheck): Perform static checks for access
20743         to non-static fields on static methods. Maybe this should be
20744         generalized for MemberAccesses. 
20745         (SimpleName::ResolveSimpleName): More work on simple name
20746         resolution. 
20747
20748         * cs-parser.jay (primary_expression/qualified_identifier): track
20749         the parameter index.
20750
20751         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20752         (EmitContext::EmitBoolExpression): Chain to expression generation
20753         instead of temporary hack.
20754         (::EmitStatementExpression): Put generic expression code generation.
20755
20756         * assign.cs (Assign::Emit): Implement variable assignments to
20757         local variables, parameters and fields.
20758
20759 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20760
20761         * statement.cs (Block::GetVariableInfo): New method, returns the
20762         VariableInfo for a variable name in a block.
20763         (Block::GetVariableType): Implement in terms of GetVariableInfo
20764
20765         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20766         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20767
20768 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20769
20770         * cs-parser.jay (operator_declaration): Continue on my quest : update
20771         to take attributes argument.
20772         (event_declaration): Ditto.
20773         (enum_declaration): Ditto.
20774         (indexer_declaration): Ditto.
20775
20776         * class.cs (Operator::Operator): Update constructor accordingly.
20777         (Event::Event): Ditto.
20778
20779         * delegate.cs (Delegate::Delegate): Same here.
20780
20781         * enum.cs (Enum::Enum): Same here.
20782
20783 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20784
20785         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20786
20787         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20788
20789         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20790         being passed around as an arraylist.
20791         (Attributes::AddAttribute): Method to add attribute sections.
20792
20793         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20794         (struct_declaration): Update accordingly.
20795         (constant_declaration): Update.
20796         (field_declaration): Update.
20797         (method_header): Update.
20798         (fixed_parameter): Update.
20799         (parameter_array): Ditto.
20800         (property_declaration): Ditto.
20801         (destructor_declaration): Ditto.
20802
20803         * class.cs (Struct::Struct): Update constructors accordingly.
20804         (Class::Class): Ditto.
20805         (Field::Field): Ditto.
20806         (Method::Method): Ditto.
20807         (Property::Property): Ditto.
20808         (TypeContainer::OptAttribute): update property's return type.
20809
20810         * interface.cs (Interface.opt_attributes): New member.
20811         (Interface::Interface): Update to take the extra Attributes argument.
20812
20813         * parameter.cs (Parameter::Parameter): Ditto.
20814
20815         * constant.cs (Constant::Constant): Ditto.
20816
20817         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20818         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20819         the attributes as a parameter.
20820         (InterfaceProperty): Update constructor call.
20821         (InterfaceEvent): Ditto.
20822         (InterfaceMethod): Ditto.
20823         (InterfaceIndexer): Ditto.
20824
20825         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20826         pass the attributes too.
20827         (interface_event_declaration): Ditto.
20828         (interface_property_declaration): Ditto.
20829         (interface_method_declaration): Ditto.
20830         (interface_declaration): Ditto.
20831
20832 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20833
20834         * class.cs (Method::Define): Track the "static Main" definition to
20835         create an entry point. 
20836
20837         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20838         EntryPoint if we find it. 
20839
20840         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20841         (EmitContext::ig): Make this variable public.
20842
20843         * driver.cs: Make the default output file be the first file name
20844         with the .exe extension.  
20845
20846         Detect empty compilations
20847
20848         Handle various kinds of output targets.  Handle --target and
20849         rename -t to --dumper.
20850
20851         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20852         methods inherited from Expression return now an Expression.  This
20853         will is used during the tree rewriting as we resolve them during
20854         semantic analysis.
20855
20856         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20857         the spec.  Missing entirely is the information about
20858         accessability of elements of it.
20859
20860         (Expression::ExprClassFromMemberInfo): New constructor for
20861         Expressions that creates a fully initialized Expression based on
20862         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20863         a Type.
20864
20865         (Invocation::Resolve): Begin implementing resolution of invocations.
20866
20867         * literal.cs (StringLiteral):  Implement Emit.
20868
20869 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20870
20871         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20872         member.
20873
20874 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20875
20876         * cs-parser.jay (attribute_arguments): Implement actions.
20877         (attribute): Fix bug in production. Implement action.
20878         (attribute_list): Implement.
20879         (attribute_target): Implement.
20880         (attribute_target_specifier, opt_target_specifier): Implement
20881         (CheckAttributeTarget): New method to check if the attribute target
20882         is valid.
20883         (attribute_section): Implement.
20884         (opt_attributes): Implement.
20885
20886         * attribute.cs : New file to handle attributes.
20887         (Attribute): Class to hold attribute info.
20888
20889         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20890         (attribute_section): Modify production to use 2 different rules to 
20891         achieve the same thing. 1 s/r conflict down !
20892         Clean out commented, useless, non-reducing dimension_separator rules.
20893
20894         * class.cs (TypeContainer.attributes): New member to hold list
20895         of attributes for a type.
20896         (Struct::Struct): Modify to take one more argument, the attribute list.
20897         (Class::Class): Ditto.
20898         (Field::Field): Ditto.
20899         (Method::Method): Ditto.
20900         (Property::Property): Ditto.
20901
20902         * cs-parser.jay (struct_declaration): Update constructor call to
20903         pass in the attributes too.
20904         (class_declaration): Ditto.
20905         (constant_declaration): Ditto.
20906         (field_declaration): Ditto.
20907         (method_header): Ditto.
20908         (fixed_parameter): Ditto.
20909         (parameter_array): Ditto.
20910         (property_declaration): Ditto.
20911
20912         * constant.cs (Constant::Constant): Update constructor similarly.
20913         Use System.Collections.
20914
20915         * parameter.cs (Parameter::Parameter): Update as above.
20916
20917 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20918
20919         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20920         (TypeContainer.delegates): New member to hold list of delegates.
20921
20922         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20923         this time as I seem to be on crack ;-)
20924
20925 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20926
20927         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20928         tell whether an identifier represents a namespace.
20929
20930         * expression.cs (NamespaceExpr): A namespace expression, used only
20931         temporarly during expression resolution.
20932         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20933         utility functions to resolve names on expressions.
20934
20935 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20936
20937         * codegen.cs: Add hook for StatementExpressions. 
20938
20939         * class.cs: Fix inverted test for static flag in methods.
20940
20941 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20942
20943         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20944         to make it coincide with MS' number.
20945         (Operator::CheckBinaryOperator): Ditto.
20946
20947         * ../errors/errors.txt : Remove error numbers added earlier.
20948
20949         * ../errors/cs1019.cs : Test case for error # 1019
20950
20951         * ../errros/cs1020.cs : Test case for error # 1020
20952
20953         * cs-parser.jay : Clean out commented cruft.
20954         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20955         used anywhere - non-reducing rule.
20956         (namespace_declarations): Non-reducing rule - comment out.
20957
20958         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20959         with TypeContainer::AddEnum.
20960
20961         * delegate.cs : New file for delegate handling classes.
20962         (Delegate): Class for declaring delegates.
20963
20964         * makefile : Update.
20965
20966         * cs-parser.jay (delegate_declaration): Implement.
20967
20968 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20969
20970         * class.cs (Event::Define): Implement.
20971         (Event.EventBuilder): New member.
20972
20973         * class.cs (TypeContainer::Populate): Update to define all enums and events
20974         we have.
20975         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20976         readonly fields for all these cases ?
20977
20978 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20979
20980         * class.cs (Property): Revamp to use the convention of making fields readonly.
20981         Accordingly modify code elsewhere.
20982
20983         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20984         the Define method of the Property class.
20985
20986         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20987         trivial bug.
20988         (TypeContainer::Populate): Update to define all the properties we have. Also
20989         define all enumerations.
20990
20991         * enum.cs (Define): Implement.
20992
20993 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20994
20995         * cs-parser.jay (overloadable_operator): The semantic value is an
20996         enum of the Operator class.
20997         (operator_declarator): Implement actions.
20998         (operator_declaration): Implement.
20999
21000         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21001         validity of definitions.
21002         (Operator::CheckBinaryOperator): Static method to check for binary operators
21003         (TypeContainer::AddOperator): New method to add an operator to a type.
21004
21005         * cs-parser.jay (indexer_declaration): Added line to actually call the
21006         AddIndexer method so it gets added ;-)
21007
21008         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21009         already taken care of by the MS compiler ?  
21010
21011 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21012
21013         * class.cs (Operator): New class for operator declarations.
21014         (Operator::OpType): Enum for the various operators.
21015
21016 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21017
21018         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21019         ostensibly handle this in semantic analysis.
21020
21021         * cs-parser.jay (general_catch_clause): Comment out
21022         (specific_catch_clauses, specific_catch_clause): Ditto.
21023         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21024         (catch_args, opt_catch_args): New productions.
21025         (catch_clause): Rewrite to use the new productions above
21026         (catch_clauses): Modify accordingly.
21027         (opt_catch_clauses): New production to use in try_statement
21028         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21029         and re-write the code in the actions to extract the specific and
21030         general catch clauses by being a little smart ;-)
21031
21032         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21033         Hooray, try and catch statements parse fine !
21034
21035 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21036
21037         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21038         string from the hashtable of variables.
21039
21040         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21041         I end up making that mistake ;-)
21042         (catch_clauses): Fixed gross error which made Key and Value of the 
21043         DictionaryEntry the same : $1 !!
21044
21045 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21046
21047         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21048
21049         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21050         when the add and remove accessors are specified. 
21051
21052 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21053
21054         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21055         information about indexer_declarator.
21056         (indexer_declarator): Implement actions.
21057         (parsing_indexer): New local boolean used to keep track of whether
21058         we are parsing indexers or properties. This is necessary because 
21059         implicit_parameters come into picture even for the get accessor in the 
21060         case of an indexer.
21061         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21062
21063         * class.cs (Indexer): New class for indexer declarations.
21064         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21065         (TypeContainer::indexers): New member to hold list of indexers for the
21066         type.
21067
21068 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21069
21070         * cs-parser.jay (add_accessor_declaration): Implement action.
21071         (remove_accessor_declaration): Implement action.
21072         (event_accessors_declaration): Implement
21073         (variable_declarators): swap statements for first rule - trivial.
21074
21075         * class.cs (Event): New class to hold information about event
21076         declarations.
21077         (TypeContainer::AddEvent): New method to add an event to a type
21078         (TypeContainer::events): New member to hold list of events.
21079
21080         * cs-parser.jay (event_declaration): Implement actions.
21081
21082 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21083
21084         * cs-parser.jay (dim_separators): Implement. Make it a string
21085         concatenating all the commas together, just as they appear.
21086         (opt_dim_separators): Modify accordingly
21087         (rank_specifiers): Update accordingly. Basically do the same
21088         thing - instead, collect the brackets here.
21089         (opt_rank_sepcifiers): Modify accordingly.
21090         (array_type): Modify to actually return the complete type string
21091         instead of ignoring the rank_specifiers.
21092         (expression_list): Implement to collect the expressions
21093         (variable_initializer): Implement. We make it a list of expressions
21094         essentially so that we can handle the array_initializer case neatly too.
21095         (variable_initializer_list): Implement.
21096         (array_initializer): Make it a list of variable_initializers
21097         (opt_array_initializer): Modify accordingly.
21098
21099         * expression.cs (New::NType): Add enumeration to help us
21100         keep track of whether we have an object/delegate creation
21101         or an array creation.
21102         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21103         members to hold data about array creation.
21104         (New:New): Modify to update NewType
21105         (New:New): New Overloaded contructor for the array creation
21106         case.
21107
21108         * cs-parser.jay (array_creation_expression): Implement to call
21109         the overloaded New constructor.
21110
21111 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21112
21113         * class.cs (TypeContainer::Constructors): Return member
21114         constructors instead of returning null.
21115
21116 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21117
21118         * typemanager.cs (InitCoreTypes): Initialize the various core
21119         types after we have populated the type manager with the user
21120         defined types (this distinction will be important later while
21121         compiling corlib.dll)
21122
21123         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21124         on Expression Classification.  Now all expressions have a method
21125         `Resolve' and a method `Emit'.
21126
21127         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21128         generation from working.     Also add some temporary debugging
21129         code. 
21130
21131 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21132
21133         * codegen.cs: Lots of code generation pieces.  This is only the
21134         beginning, will continue tomorrow with more touches of polish.  We
21135         handle the fundamentals of if, while, do, for, return.  Others are
21136         trickier and I need to start working on invocations soon.
21137
21138         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21139         s.InitStatement. 
21140
21141         * codegen.cs (EmitContext): New struct, used during code
21142         emission to keep a context.   Most of the code generation will be
21143         here. 
21144
21145         * cs-parser.jay: Add embedded blocks to the list of statements of
21146         this block.  So code generation proceeds in a top down fashion.
21147
21148 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21149
21150         * statement.cs: Add support for multiple child blocks.
21151
21152 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21153
21154         * codegen.cs (EmitCode): New function, will emit the code for a
21155         Block of code given a TypeContainer and its ILGenerator. 
21156
21157         * statement.cs (Block): Standard public readonly optimization.
21158         (Block::Block constructors): Link children. 
21159         (Block::Child): Child Linker.
21160         (Block::EmitVariables): Emits IL variable declarations.
21161
21162         * class.cs: Drop support for MethodGroups here, delay until
21163         Semantic Analysis.
21164         (Method::): Applied the same simplification that I did before, and
21165         move from Properties to public readonly fields.
21166         (Method::ParameterTypes): Returns the parameter types for the
21167         function, and implements a cache that will be useful later when I
21168         do error checking and the semantic analysis on the methods is
21169         performed.
21170         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21171         and made a method, optional argument tells whether this is a class
21172         or a structure to apply the `has-this' bit.
21173         (Method::GetCallingConvention): Implement, returns the calling
21174         convention. 
21175         (Method::Define): Defines the type, a second pass is performed
21176         later to populate the methods.
21177
21178         (Constructor::ParameterTypes): implement a cache similar to the
21179         one on Method::ParameterTypes, useful later when we do semantic
21180         analysis. 
21181
21182         (TypeContainer::EmitMethod):  New method.  Emits methods.
21183
21184         * expression.cs: Removed MethodGroup class from here.
21185
21186         * parameter.cs (Parameters::GetCallingConvention): new method.
21187
21188 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21189
21190         * class.cs (TypeContainer::Populate): Drop RootContext from the
21191         argument. 
21192
21193         (Constructor::CallingConvention): Returns the calling convention.
21194         (Constructor::ParameterTypes): Returns the constructor parameter
21195         types. 
21196
21197         (TypeContainer::AddConstructor): Keep track of default constructor
21198         and the default static constructor.
21199
21200         (Constructor::) Another class that starts using `public readonly'
21201         instead of properties. 
21202
21203         (Constructor::IsDefault): Whether this is a default constructor. 
21204
21205         (Field::) use readonly public fields instead of properties also.
21206
21207         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21208         track of static constructors;  If none is used, turn on
21209         BeforeFieldInit in the TypeAttributes. 
21210
21211         * cs-parser.jay (opt_argument_list): now the return can be null
21212         for the cases where there are no arguments. 
21213
21214         (constructor_declarator): If there is no implicit `base' or
21215         `this', then invoke the default parent constructor. 
21216
21217         * modifiers.cs (MethodAttr): New static function maps a set of
21218         modifiers flags into a MethodAttributes enum
21219         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21220         MethodAttr, TypeAttr to represent the various mappings where the
21221         modifiers are used.
21222         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21223
21224 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21225
21226         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21227         method arguments.
21228
21229         * interface.cs (PopulateIndexer): Implemented the code generator
21230         for interface indexers.
21231
21232 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21233
21234         * interface.cs (InterfaceMemberBase): Now we track the new status
21235         here.  
21236
21237         (PopulateProperty): Implement property population.  Woohoo!  Got
21238         Methods and Properties going today. 
21239
21240         Removed all the properties for interfaces, and replaced them with
21241         `public readonly' fields. 
21242
21243 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21244
21245         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21246         initialize their hashtables/arraylists only when they are needed
21247         instead of doing this always.
21248
21249         * parameter.cs: Handle refs and out parameters.
21250
21251         * cs-parser.jay: Use an ArrayList to construct the arguments
21252         instead of the ParameterCollection, and then cast that to a
21253         Parameter[] array.
21254
21255         * parameter.cs: Drop the use of ParameterCollection and use
21256         instead arrays of Parameters.
21257
21258         (GetParameterInfo): Use the Type, not the Name when resolving
21259         types. 
21260
21261 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21262
21263         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21264         and instead use public readonly fields.
21265
21266         * class.cs: Put back walking code for type containers.
21267
21268 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21269
21270         * class.cs (MakeConstant): Code to define constants.
21271
21272         * rootcontext.cs (LookupType): New function.  Used to locate types 
21273
21274
21275 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21276
21277         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21278         this System.Reflection code is.  Kudos to Microsoft
21279
21280         * typemanager.cs: Implement a type cache and avoid loading all
21281         types at boot time.  Wrap in LookupType the internals.  This made
21282         the compiler so much faster.  Wow.  I rule!
21283
21284         * driver.cs: Make sure we always load mscorlib first (for
21285         debugging purposes, nothing really important).
21286
21287         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21288         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21289
21290         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21291         on namespaces that have been imported using the `using' keyword.
21292
21293         * class.cs (TypeContainer::TypeAttr): Virtualize.
21294         (Class::TypeAttr): Return attributes suitable for this bad boy.
21295         (Struct::TypeAttr): ditto.
21296         Handle nested classes.
21297         (TypeContainer::) Remove all the type visiting code, it is now
21298         replaced with the rootcontext.cs code
21299
21300         * rootcontext.cs (GetClassBases): Added support for structs. 
21301
21302 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21303
21304         * interface.cs, statement.cs, class.cs, parameter.cs,
21305         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21306         Drop use of TypeRefs, and use strings instead.
21307
21308 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21309
21310         * rootcontext.cs: 
21311
21312         * class.cs (Struct::Struct): set the SEALED flags after
21313         checking the modifiers.
21314         (TypeContainer::TypeAttr): new property, returns the
21315         TypeAttributes for a class.  
21316
21317         * cs-parser.jay (type_list): Oops, list production was creating a
21318         new list of base types.
21319
21320         * rootcontext.cs (StdLib): New property.
21321         (GetInterfaceTypeByName): returns an interface by type name, and
21322         encapsulates error handling here.
21323         (GetInterfaces): simplified.
21324         (ResolveTree): Encapsulated all the tree resolution here.
21325         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21326         types. 
21327
21328         * driver.cs: Add support for --nostdlib, to avoid loading the
21329         default assemblies.
21330         (Main): Do not put tree resolution here. 
21331
21332         * rootcontext.cs: Beginning of the class resolution.
21333
21334 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21335
21336         * rootcontext.cs: Provide better error reporting. 
21337
21338         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21339
21340         * rootcontext.cs (CreateInterface): Handle the case where there
21341         are no parent interfaces.
21342
21343         (CloseTypes): Routine to flush types at the end.
21344         (CreateInterface): Track types.
21345         (GetInterfaces): Returns an array of Types from the list of
21346         defined interfaces.
21347
21348         * typemanager.c (AddUserType): Mechanism to track user types (puts
21349         the type on the global type hash, and allows us to close it at the
21350         end). 
21351
21352 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21353
21354         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21355         RecordInterface instead.
21356
21357         * cs-parser.jay: Updated to reflect changes above.
21358
21359         * decl.cs (Definition): Keep track of the TypeBuilder type that
21360         represents this type here.  Not sure we will use it in the long
21361         run, but wont hurt for now.
21362
21363         * driver.cs: Smaller changes to accomodate the new code.
21364
21365         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21366         when done. 
21367
21368         * rootcontext.cs (CreateInterface):  New method, used to create
21369         the System.TypeBuilder type for interfaces.
21370         (ResolveInterfaces): new entry point to resolve the interface
21371         hierarchy. 
21372         (CodeGen): Property, used to keep track of the code generator.
21373
21374 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21375
21376         * cs-parser.jay: Add a second production for delegate_declaration
21377         with `VOID'.
21378
21379         (enum_body): Put an opt_comma here instead of putting it on
21380         enum_body or enum_member_declarations so we can handle trailing
21381         commas on enumeration members.  Gets rid of a shift/reduce.
21382
21383         (type_list): Need a COMMA in the middle.
21384
21385         (indexer_declaration): Tell tokenizer to recognize get/set
21386
21387         * Remove old targets.
21388
21389         * Re-add the parser target.
21390
21391 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21392
21393         * cs-parser.jay: Add precendence rules for a number of operators
21394         ot reduce the number of shift/reduce conflicts in the grammar.
21395
21396 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21397
21398         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21399         and put it here.
21400
21401         Get rid of old crufty code.
21402
21403         * rootcontext.cs: Use this to keep track of the parsed
21404         representation and the defined types available to the program. 
21405
21406         * gen-treedump.cs: adjust for new convention.
21407
21408         * type.cs: Split out the type manager, and the assembly builder
21409         from here. 
21410
21411         * typemanager.cs: the type manager will live here now.
21412
21413         * cil-codegen.cs: And the code generator here. 
21414
21415 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21416
21417         * makefile: Fixed up for easy making.
21418
21419 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21420
21421         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21422         the 
21423
21424         (unary_expression): Expand pre_increment_expression and
21425         post_decrement_expression to reduce a shift/reduce.
21426
21427 2001-07-11  Simon Cozens
21428
21429         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21430
21431         Improve allow_keyword_as_indent name.
21432
21433 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21434
21435         * Adjustments for Beta2. 
21436
21437 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21438
21439         * decl.cs: Added `Define' abstract method.
21440         (InTransit): new property, used to catch recursive definitions. 
21441
21442         * interface.cs: Implement `Define'. 
21443
21444         * modifiers.cs: Map Modifiers.constants to
21445         System.Reflection.TypeAttribute flags.
21446
21447         * class.cs: Keep track of types and user-defined types.
21448         (BuilderInit): New method for creating an assembly
21449         (ResolveType): New function to launch the resolution process, only
21450         used by interfaces for now.
21451
21452         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21453         that are inserted into the name space. 
21454
21455 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21456
21457         * ARGH.  I have screwed up my tree so many times due to the use of
21458         rsync rather than using CVS.  Going to fix this at once. 
21459
21460         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21461         load types.
21462
21463 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21464
21465         * Experiment successful: Use System.Type rather that our own
21466         version of Type.  
21467
21468 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21469
21470         * cs-parser.jay: Removed nsAliases from here.
21471
21472         Use new namespaces, handle `using XXX;' 
21473
21474         * namespace.cs: Reimplemented namespace handling, use a recursive
21475         definition of the class.  Now we can keep track of using clauses
21476         and catch invalid using clauses.
21477
21478 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21479
21480         * gen-treedump.cs: Adapted for all the renaming.
21481
21482         * expression.cs (Expression): this class now has a Type property
21483         which returns an expression Type.
21484
21485         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21486         `Type', as this has a different meaning now in the base
21487
21488 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21489
21490         * interface.cs, class.cs: Removed from all the sources the
21491         references to signature computation, as we can not do method
21492         signature computation during the parsing time, as we are not
21493         trying to solve at that point distinguishing:
21494
21495         class X {
21496                 void a (Blah x) {}
21497                 void a (NS.Blah x) {}
21498         }
21499
21500         Which depending on the context might be valid or not, as we do not
21501         know if Blah is the same thing as NS.Blah at that point.
21502
21503         * Redid everything so the code uses TypeRefs now instead of
21504         Types.  TypeRefs are just temporary type placeholders, that need
21505         to be resolved.  They initially have a pointer to a string and the
21506         current scope in which they are used.  This is used later by the
21507         compiler to resolve the reference to an actual Type. 
21508
21509         * DeclSpace is no longer a CIR.Type, and neither are
21510         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21511         are all DeclSpaces, but no Types. 
21512
21513         * type.cs (TypeRefManager): This implements the TypeRef manager,
21514         which keeps track of all the types that need to be resolved after
21515         the parsing has finished. 
21516
21517 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21518
21519         * ARGH.  We are going to have to store `foreach' as a class rather
21520         than resolving it, as we need to verify error 1579 after name
21521         resolution.   *OR* we could keep a flag that says `This request to
21522         IEnumerator comes from a foreach statement' which we can then use
21523         to generate the error.
21524
21525 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21526
21527         * class.cs (TypeContainer.AddMethod): we now add methods to the
21528         MethodGroup instead of the method hashtable.  
21529
21530         * expression.cs: Add MethodGroup abstraction, which gets us one
21531         step closer to the specification in the way we handle method
21532         declarations.  
21533
21534         * cs-parser.jay (primary_expression): qualified_identifier now
21535         tried to match up an identifier to a local variable reference or
21536         to a parameter reference.
21537
21538         current_local_parameters is now a parser global variable that
21539         points to the current parameters for the block, used during name
21540         lookup.
21541
21542         (property_declaration): Now creates an implicit `value' argument to
21543         the set accessor.
21544
21545 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21546
21547         * parameter.cs: Do not use `param' arguments as part of the
21548         signature, per the spec.
21549
21550 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21551
21552         * decl.cs: Base class for classes, structs and interfaces.  This
21553         is the "Declaration Space" 
21554
21555         * cs-parser.jay: Use CheckDef for checking declaration errors
21556         instead of having one on each function.
21557
21558         * class.cs: Factor out some code for handling error handling in
21559         accordance to the "Declarations" section in the "Basic Concepts"
21560         chapter in the ECMA C# spec.
21561
21562         * interface.cs: Make all interface member classes derive from
21563         InterfaceMemberBase.
21564
21565 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21566
21567         * Many things: all interfaces are parsed and generated in
21568         gen-treedump.  Support for member variables, constructors,
21569         destructors, properties, constants is there.
21570
21571         Beginning of the IL backend, but very little done, just there for
21572         testing purposes. 
21573
21574 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21575
21576         * cs-parser.jay: Fix labeled statement.
21577
21578         * cs-tokenizer.cs (escape): Escape " and ' always.
21579         ref_line, ref_name: keep track of the line/filename as instructed
21580         by #line by the compiler.
21581         Parse #line.
21582
21583 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21584
21585         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21586         to match the values in System.CodeDOM.
21587
21588         Divid renamed to Divide.
21589
21590         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21591         statements. 
21592         (Statements.set): remove.
21593
21594         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21595         statements. 
21596
21597         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21598         falseStatements always have valid values. 
21599
21600         * cs-parser.jay: Use System.CodeDOM now.
21601